Iot Weather
Iot Weather
CIRCUIT DIAGRAM
61
ARDUINO WIRING
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x3F for a 16 chars and 2 line
display
#include <ESP8266WiFi.h>
62
const char *ssid = "Mywifi"; // replace with your wifi ssid and wpa2 key
WiFiClient client;
void setup()
lcd.init();
lcd.clear();
lcd.print("welcome");
Serial.begin(115200);
delay(10);
dht.begin();
Serial.println("Connecting to ");
Serial.println(ssid);
63
WiFi.begin(ssid, pass);
delay(500);
Serial.print(".");
Serial.println("");
Serial.println("WiFi connected");
void loop()
float h = dht.readHumidity();
float t = dht.readTemperature();
lcd.clear();
lcd.print("Temperature:");
lcd.print(t);
lcd.print("Humidity:");
lcd.print(h);
64
if (isnan(h) || isnan(t))
return;
postStr +="&field1=";
postStr += String(t);
postStr +="&field2=";
postStr += String(h);
postStr += "\r\n\r\n";
client.print("Host: api.thingspeak.com\n");
client.print("Connection: close\n");
client.print("X-THINGSPEAKAPIKEY: "+apiKey+"\n");
client.print("Content-Type: application/x-www-form-urlencoded\n");
client.print("Content-Length: ");
65
client.print(postStr.length());
client.print("\n\n");
client.print(postStr);
Serial.print("Temperature: ");
Serial.print(t);
Serial.print(h);
client.stop();
Serial.println("Waiting...");
delay(1000);
66
RESULTS AND OUTPUT SCREENS
67
CHAPTER 6
CONCLUSION
The future scope of IoT weather monitoring systems is vast, with advancements in
AI and machine learning enhancing weather predictions and disaster management. These
systems will play a critical role in smart cities, agriculture, and environmental monitoring by
providing real-time, personalized weather data. IoT weather sensors will integrate with smart
homes, renewable energy, and autonomous systems for more accurate data collection. With
lower costs and greater accessibility, IoT-based weather systems will offer improved global
climate monitoring and better preparedness for natural disasters, benefiting industries and
communities alike.
68
REFERENCE:
https://www.arduino.cc/en/software/
https://docs.arduino.cc/language-reference/
https://thingspeak.mathworks.com/login?skipSSOCheck=true
https://www.electronicsforu.com/category/electronics-projects/hardware-diy
https://www.wikipedia.org/
69