DHT-11 with Arduino and LCD display
Components required:-
1.Arduino Uno
2. 16x2 LCD display
3.DHT-11
DHT-11 module
This module is used to measure humidity and temperature of surrounding. It comprises a thermistor and a capacitive humidity plates to measure temperature and humidity.
- 3 to 5V power
- 2.5mA max current usage
- 2 seconds sampling rate
Circuit diagram
1.Connect LCD with Arduino as mentioned here.
2.Connect + terminal of DHT-11 to 5volts of Arduino.
3.Connect - terminal of DHT-11 to GND of Arduino.
4.Connect OUT terminal of DHT-11 to A0 pin of Arduino.
Arduino Code
________________________________________
#include <LiquidCrystal.h>
#include "DHT.h"
DHT dht(A0, DHT11);
LiquidCrystal lcd(6,7,8,9,10,11,12);
float humidity,celcius,fahrenheit;
void setup() {
lcd.begin(16,2);
dht.begin();
}
void loop()
{
delay(2000);
lcd.clear();
humidity = dht.readHumidity();
celcius = dht.readTemperature();
lcd.print("Humidity:");
lcd.print(humidity);
lcd.print("%");
lcd.setCursor(0,1);
lcd.print(celcius);
lcd.print("C || ");
fahrenheit=1.8*celcius + 32;
lcd.print(fahrenheit);
lcd.print("F");
}
____________________________________________________
To understand this project in more detail, click here or on this image to understand this project in detail
Comments
Post a Comment