Main Content

Publish Data to Internet of Things Using ThingSpeak

You can publish data from your hardware board, such as sensor data, to the Internet of Things using theThingSpeak Writeblock.

For more information about how to use ThingSpeak, visit theirApps,Plugins, orTutorialstopics.

Set Up the Model and ThingSpeak

  1. Configure your Simulink®model to run on the target hardware.

  2. Add aThingSpeak Writeblock to the model.

  3. (Optional) Open theThingSpeak Write块和配置参数。

  4. Connect signals from your model to the block inputs on theThingSpeak Writeblock.

  5. Sign up for an account athttps://thingspeak.com/and log in.

  6. ClickCreate New Channel.

  7. Update the channel name and fields for the data you are publishing.

  8. ClickUpdate Channel.

Update and Deploy the Model

  1. Click theAPI Keystab and copy theWrite API Key.

  2. In theThingSpeak Writeblock, paste the key into theWrite API keyparameter.

  3. InThingSpeak.com, click theData Import/Exporttab and copy the URL fromUpdate Channel Feed — GETorUpdate Channel Feed — POST.

  4. In theThingSpeak Writeblock, paste the URL into theUpdate URLparameter.

  5. Save your changes to the model.

  6. ClickDeploy to Hardwarebutton.

    After several minutes, the model application starts running the target hardware.

  7. OnThingSpeak.com, click the Private View tab or, if enabled, the Public View tab.

    The view displays the data that your target hardware is publishing to ThingSpeak.