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 the ThingSpeak Write block.

For more information about how to use ThingSpeak™, visit their Apps, Plugins, or Tutorials topics.

Set Up the Model and ThingSpeak

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

  2. Add a ThingSpeak Write block to the model.

  3. (Optional) Open the ThingSpeak Write block and configure its parameters.

  4. Connect signals from your model to the block inputs on the ThingSpeak Write block.

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

  6. Click Create New Channel.

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

  8. Click Update Channel.

Update and Deploy the Model

  1. Click the API Keys tab and copy the Write API Key.

  2. In the ThingSpeak Write block, paste the key into the Write API key parameter.

  3. In ThingSpeak.com, click the Data Import/Export tab and copy the URL from Update Channel Feed — GET or Update Channel Feed — POST.

  4. In the ThingSpeak Write block, paste the URL into the Update URL parameter.

  5. Save your changes to the model.

  6. Click Deploy to Hardware button.

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

  7. On ThingSpeak.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.