5083+ reviews
Order by 16:00 for same day shipping
14 days return
GB
EN
Individual
Business
This project gives you the opportunity to collect and visualize temperature and humidity data using the Arduino IoT Cloud. You will also learn how to connect a DHT22 temperature and humidity sensor and collect data from it. What makes this project extra special is that you are not tied to having your laptop nearby. Your Arduino will continue to function autonomously, collecting data and sending it to the cloud, even without a direct connection to a computer. This allows you to place it anywhere you are interested in monitoring environmental conditions, without the need for constant physical presence.
Start by configuring your board in Arduino Create. Follow these steps:
After logging in and opening the IoT Cloud page, you will see a box with “Create”. Select this and you will be taken to a new screen. Here you can name your project and choose the correct Arduino board. For this project we will select the Arduino R4 WiFi. Follow the further instructions to configure your network.
On the screen you see variables. Add variables for temperature and humidity measurement:
At the top of the page you will see “Dashboard”. Click on this:
Optional: Add Charts
If you want to view historical temperature and humidity data, you can add graphs:
To connect you need:
Connect your DHT22 sensor to your Arduino this way:
In the “sketch” you can see the code generated by Arduino for cloud connections. However, it lacks code for measuring temperature and humidity. Replace the automatic code of the sketch with the code below:
arduinoCopy code
#include "thingProperties.h"#include
#define DHTPIN 8
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600);
delay(1500);
initProperties();
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
dht.begin();
}
void loop() {
ArduinoCloud.update();
float h = dht.readHumidity();
float t = dht.readTemperature();
if (!isnan(h) && !isnan(t)) {
luchtvochtigheid = h;
temperatuur = t;
}
}
Now you are ready to upload the code to your Arduino: