Measuring temperature and humidity has become a very easy thing. We using the Arduino board and the temperature and humidity sensor (DHT), in addition to a Lcd to display the values. It only requires the installation of these components together. As well as programming the Arduino board with the appropriate code to measure the temperature and humidity and display it on the Lcd 16×2.
In this post we will learn how to measure temperature and humidity using Arduino
Electronic components needed :
- DHT sensor
- 16×2 lcd display + I2C
- Electrical wires
- Arduino UNO
- Breadboard
Measure Temperature and humidity using Arduino, project with code
Circuit diagram :

Arduino programming code :
#include <DHT.h> #include <LiquidCrystal_I2C.h> //by www.andprof.com DHT dht(2, DHT11); LiquidCrystal_I2C lcd(0x27, 16, 2); //0x27 or 0x3F int temp; int humidity; void setup() { // put your setup code here, to run once: dht.begin(); lcd.init(); lcd.backlight(); } void loop() { // put your main code here, to run repeatedly: delay(2000); temp = dht.readTemperature(); humidity = dht.readHumidity(); lcd.setCursor(0,0); lcd.print("Temp: "); lcd.print(temp); lcd.print(" C"); lcd.setCursor(0,1); lcd.print("Humidity: "); lcd.print(humidity); lcd.print(" %"); }
Explainer video :
Discover also :
Clap Switch with Arduino and Sound Sensor
Control Any Device by Remote Control