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.
Set Up the Model and ThingSpeak
Configure your Simulink® model to run on the target hardware.
Add a ThingSpeak Write block to the model.
(Optional) Open the ThingSpeak Write block and configure its parameters.
Connect signals from your model to the block inputs on the ThingSpeak Write block.
Sign up for an account at https://thingspeak.com/ and log in.
Click Create New Channel.
Update the channel name and fields for the data you are publishing.
Click Update Channel.
Update and Deploy the Model
Click the API Keys tab and copy the Write API Key.
In the ThingSpeak Write block, paste the key into the Write API key parameter.
In ThingSpeak.com, click the Data Import/Export tab and copy the URL from Update Channel Feed — GET or Update Channel Feed — POST.
In the ThingSpeak Write block, paste the URL into the Update URL parameter.
Save your changes to the model.
Click Deploy to Hardware button.
After several minutes, the model application starts running the target hardware.
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.