Project showcase
Arduino Temperature - Humidity - Rain Sensor

Arduino Temperature - Humidity - Rain Sensor

On the display is printed temperature (celsius) and humidity (%) with a DHT11. When it's raining the LED lights up. You need a rain sensor!

  • 12,700 views
  • 6 comments
  • 18 respects

Components and supplies

About this project

Code

Weather Station CodeArduino
#include <dht.h>
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

dht DHT;

#define DHT11_PIN 7
int pin=8;
int pinLed=9;

void setup(){
  lcd.begin(16, 2);
  Serial.begin(9600);
  pinMode(pin, INPUT);
  pinMode(pinLed,OUTPUT);
}
int rain=0;
int measurement=0;

void loop()
{
  int chk = DHT.read11(DHT11_PIN);
  lcd.setCursor(0,0); 
  lcd.print("Temp: ");
  lcd.print(DHT.temperature);
  lcd.print((char)223);
  lcd.print("C");
  lcd.setCursor(0,1);
  lcd.print("Umid: ");
  lcd.print(DHT.humidity);
  lcd.print("%");
  delay(1000);
  rain = digitalRead(pin); 
  if(rain==1) 
    digitalWrite(pinLed,LOW);
  if(rain==0)
    digitalWrite(pinLed,HIGH);
    measurement = analogRead(A0);
    Serial.println(measurement);
  
  
  
  delay(1000);
  }

Schematics

Weather Station Schematics
humidity_-_temperature_-_rain_sensor_wNZsYznNaz.fzz
Weather Station Schematics
Weather station schematic 0xcyom5l8v

Comments

Similar projects you might like

DHT11 Humidity + Temperature Sensor with 16x2 LCD display

Project showcase by onatto22

  • 9,068 views
  • 1 comment
  • 17 respects

Temperature and Humidity Sensor

by Amarantowy

  • 5,173 views
  • 1 comment
  • 15 respects

Beautifully Finished Humidity and Temperature Sensor

Project tutorial by Wicked Makers

  • 16,866 views
  • 21 comments
  • 135 respects

Date, Time, Temperature and Humidity Display

Project tutorial by Chamath Vithanawasam

  • 15,795 views
  • 9 comments
  • 38 respects

Ultrasonic Sensor with Alarm, LCD and Temperature

Project tutorial by MichDragstar

  • 4,647 views
  • 7 comments
  • 19 respects

Portable Arduino Temp/Humidity Sensor with LCD

Project tutorial by ThothLoki

  • 153,295 views
  • 115 comments
  • 185 respects
Add projectSign up / Login