This repo contains a simple Arduino sketch that reads temperature and humidity from a DHT11 sensor, prints the values to the Serial Monitor, and turns an LED ON when the temperature crosses a threshold (default 30°C).
- Arduino UNO
- DHT11 sensor/module
- LED + 220Ω–1kΩ resistor
- Jumper wires
DHT11 Arduino UNO
----- -----------
VCC ---> 5V
GND ---> GND
DATA ---> D7 (use 10k pull‑up to 5V if your module doesn't include one)
LED Arduino UNO
--- -----------
Anode ---> D12 (through a resistor)
Cathode -> GND
- Arduino IDE 1.8.x or 2.x
- Install libraries via Sketch ▸ Include Library ▸ Manage Libraries...
DHT sensor libraryby AdafruitAdafruit Unified Sensor
- Open
src/DHT11_LED_Control.inoin Arduino IDE. - Select Tools ▸ Board ▸ Arduino AVR Boards ▸ Arduino Uno.
- Select the correct Port.
- Upload the sketch.
- Open Serial Monitor (9600 baud) to see:
TEMPERATURE: 28.5 °C | HUMIDITY: 62.0 % - The LED on D12 turns ON when temperature
>= 30°C.
- Change the temperature threshold in the code:
const float TEMP_THRESHOLD_C = 30.0;
- Adjust the sampling interval by editing the
delay(5000);line (milliseconds).
arduino-dht11-led-monitor/
├─ src/
│ └─ DHT11_LED_Control.ino
├─ .gitignore
├─ LICENSE
└─ README.md
MIT