Arduino DHT11 Temperature and Humidity Monitor with LCD
This project demonstrates a simple yet effective temperature and humidity monitoring system using an Arduino, a DHT11 sensor, and a Liquid Crystal Display (LCD). It allows real-time monitoring of environmental conditions—ideal for learning sensor integration and basic display outputs.
🔧 Key Features
- Real-time temperature and humidity readings with DHT11
- Visual output on a 16x2 LCD display
- Temperature threshold alert system (30°C)
- Data also sent to Serial Monitor
📋 Components Required
- Arduino Uno or Mega
- DHT11 Sensor
- 16x2 LCD (with I2C or pins)
- Breadboard and Jumper Wires
🔌 How It Works
- The DHT11 continuously measures temperature and humidity.
- Arduino reads these values and shows them on the LCD screen.
- If the temperature ≥ 30°C, an alert can be triggered.
- The same data is logged to the Serial Monitor for debugging or extension.
📷 Schematic
💻 Code
#include <Wire.h>
#include <LiquidCrystal.h>
#include <DHT.h>
#define DHTTYPE DHT11
#define DHTPIN A0
DHT dht11(DHTPIN, DHTTYPE);
LiquidCrystal lcd(12, 11, 5, 4, 3, 2, 10, 9, 8, 7);
const int THRESHOLD = 30;
void setup() {
Wire.begin();
lcd.begin(16, 2);
lcd.print("DHT11 Sensor");
dht11.begin();
}
void loop() {
float t = dht11.readTemperature();
float h = dht11.readHumidity();
if (t >= THRESHOLD) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Temp:"); lcd.print(t);
lcd.setCursor(0, 1);
lcd.print("Humidity:"); lcd.print(h);
}
delay(2000);
}
🛠Optional Components
If you need components for this project, here are some helpful links:
0 Commentaires