IoT Based Humidity and Temperature Monitoring Using Arduino Uno
IoT Based Humidity and Temperature Monitoring Using Arduino Uno
Introduction
Using Internet of Things (IOT), we can control any electronic equipment in
homes and industries. Moreover, you can read a data from any sensor and
analyse it graphically from anywhere in the world. Here, we can read
temperature and humidity data from DHT11 sensor and upload it to a
ThingSpeak cloud using Arduino Uno and ESP8266-01 module. Arduino
Uno is MCU, it fetch a data of humidity and temperature from DHT11
sensor and Process it and give it to a ESP8266 Module.ESP8266 is a WiFi
module, it is one of the leading platform for Internet of Things. It can
transfer a data to IOT cloud.
Hardware Requirements
• Arduino Uno
• ESP8266-01
• DHT11
• AMS1117-3.3V
• 9V battery
Software Requirements
• Arduino IDE
Other Applications
We can also include a sensor like gas, infrared, ultrasonic sensors based on
their requirements. Moreover, it is possible to control the relay, actuators
through internet once a sensor values are going above/below
predetermined values
Arduino code
#include "DHT.h"
#include
String apiKey = "OX9T8Y9OL9HD0UBP"; // Edit this API key according to your Acco
unt
int i=1;
void setup() {
cmd+= inv;
cmd+= Host_Name;
cmd+= inv;
cmd+= ",";
cmd+= inv;
cmd+= Password;
cmd+= inv;
// the loop
void loop() {
ser.println(cmd);
Serial.println(cmd);
if(ser.find("Error")){
Serial.println("AT+CIPSTART error");
return;
getStr += apiKey;
getStr +="&field1=";
getStr +="&field2=";
getStr += "\r\n\r\n";
cmd = "AT+CIPSEND=";
ser.println(cmd);
Serial.println(cmd);
if(ser.find(">")){
ser.print(getStr);
Serial.print(getStr);
else{
// alert user
Serial.println("AT+CIPCLOSE");