Professional Documents
Culture Documents
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
.
Aim: Write a program on
Arduino/Raspberry Pi to
retrieve temperature and
humidity data from
thingspeak cloud.
Aim: Write a program on Arduino/Raspberry Pi to retrieve temperature and
humidity data from thingspeak cloud.
ThingSpeak Read: Read data stored in a ThingSpeak channel
Description
You can retrieve data from the Internet of Things website by using ThingSpeak
to download the data to your target hardware. ThingSpeak is an application
platform that you can use for the Internet of Things. You can build an
application around data that is collected by sensors. ThingSpeak includes real-
time data collection, data processing, visualizations, apps, and plugins. You can
see the ThingSpeak server response to a data download request by selecting
the Print diagnostic messages option. This option has no effect when you use
External mode, Serial Transmit, or Serial Receive blocks that use port 0.
• Parameters
Channel ID
1. Get the Channel ID parameter from your channel on ThingSpeak.com.
2. After creating a ThingSpeak channel for your target hardware:
3. On the ThingSpeak.com website, select Channels > My Channels.
4. Under the channel that you created for this target hardware, click
Settings.
5. Click the Channel Settings tab and copy the Channel ID.
6. Open the ThingSpeak Read block in your model and paste the value into
the Channel ID parameter.
1.2. After creating a ThingSpeak channel for your target hardware:
2.3. On the ThingSpeak.com website, select Channels > My Channels.
3.4. Under the channel that you created for this target hardware,
4.click Settings.
5.5. Click the Channel Settings tab and copy the Channel ID.
6.6. Open the ThingSpeak Read block in your model and paste the value
into
7. the Channel ID parameter.
8. Channel Access
9. By default, the ThingSpeak channel access is private. To access the
channel,
10.you must have a read API key.
11.You can make the channel public to allow other users to use your feed
without a
12.Read API key.
Channel Access
By default, the ThingSpeak channel access is private. To access the channel,
you must have a read API key. You can make the channel public to allow other
users to use your feed without aRead API key.
Read API Key
1. On the ThingSpeak.com website, select Channels > My Channels.
2. Under the channel that you created for this target hardware, click Settings.
3. Click the API Keys tab.
4. Copy the key from Read API Key parameter.
5. Open the ThingSpeak Read block in your model and paste the copied API key
into the Read API key parameter.
Field Number
Specify a field that you want to read from the ThingSpeak channel.
Print diagnostic messages
Select this check box to get ThingSpeak server response data and send it to the
standard output device.
Program:
#include <WiFi.h>
#include "ThingSpeak.h"
#include <Adafruit_BME280.h>
#include <Adafruit_Sensor.h>
WiFiClient client;
// Timer variables
unsigned long lastTime = 0;
unsigned long timerDelay = 30000;
void initBME(){
if (!bme.begin(0x76)) {
Serial.println("Could not find a valid BME280 sensor,
check wiring!");
while (1);
}
}
void setup() {
Serial.begin(115200); //Initialize serial
initBME();
WiFi.mode(WIFI_STA);
if(x == 200){
Serial.println("Channel update successful.");
}
else{
Serial.println("Problem updating channel. HTTP error
code " + String(x));
}
lastTime = millis();
}
}
Result
Sample time
Specify in seconds how often this block reads the ThingSpeak channel.
Outcomes:
Student will be able to understand how can retrieve data from the Internet of
Things website by using ThingSpeak to download the data to your target
hardware.
Applications:
Machine learning uses data and produces a program to perform a task.
Application is Cloud-based people counter by detecting faces with the
Computer Vision System. The raw people count is then sent to the ThingSpeak
IoT platform for data collection in the cloud and further data analysis.