m1cr0s0ft
Published

Arduino Weather Station

This Is An Project To Help View Us The Current Temperature And Humidity In Time.

BeginnerFull instructions provided1,761
Arduino Weather Station

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Solderless Breadboard Full Size
Solderless Breadboard Full Size
×1
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
×1
Jumper wires (generic)
Jumper wires (generic)
×1
DHT11 Temperature & Humidity Sensor (3 pins)
DHT11 Temperature & Humidity Sensor (3 pins)
×1
Standard LCD - 16x2 White on Blue
Adafruit Standard LCD - 16x2 White on Blue
×1
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Schematics For This Project.

Code

code

C/C++
#include<LiquidCrystal.h>
#include "DHT.h"
#define DHTPIN 8
#define DHTTYPE DHT11
DHT dht(DHTPIN,DHTTYPE);
LiquidCrystal lcd(7,6,5,4,3,2);//CONNECT THESE PINS ON LCD
void setup(){
delay(2000);
Serial.begin(9600);
lcd.begin(16,2);
dht.begin();
lcd.print("LCD IS STARTING");
delay(1000);
lcd.clear();
}
void loop(){
float h= dht.readHumidity(); // FUNCTION FOR READING HUMIDITY DATA
float t= dht.readTemperature();// FUNCTION FOR READING TEMPERATURE DATA
if(isnan(h) || isnan(t)){
Serial.print("Failed to get data");
lcd.setCursor(0,1);
lcd.print("FAILED! TRY AGAIN");
}
else{
// For printing the humidity data on SERIAL MONITOR
Serial.print("CURRENT HUMIDITY_");
Serial.print(h);
Serial.print("%");
Serial.print("||");
// FOR PRINTING THE TEMPERATURE DATA O0N SERIAL MONITOR
Serial.print("CURRENT TEMPERATURE_");
Serial.print(t);
Serial.println("C");
// FOR PRINTING THE HUMIDITY DATA ON LCD
lcd.setCursor(0,0);
lcd.print("HUMIDITY_");
lcd.setCursor(10,0);
lcd.print(h);
lcd.setCursor(14,0);
lcd.print("%");
// FOR PRINTING THE TEMPERATURE DATA ON LCD
lcd.setCursor(0,1);
lcd.print("TEMPERATURE_");
lcd.setCursor(12,1);
lcd.print(t);
lcd.setCursor(15,1);
lcd.print("C");
//MADE BY HOX DIPAN NEW
}
}

Credits

m1cr0s0ft

m1cr0s0ft

2 projects • 0 followers

Comments