DHT11 Temperature and Humidity Sensor Module

DHT11 Temperature & Humidity Sensor
Basic Environmental Sensing with Status LED for Arduino Projects
Introduction
The DHT11 is a basic, low-cost digital temperature and humidity sensor with a built-in status LED. It provides adequate accuracy for most hobbyist projects and includes visual feedback through its indicator LED.
Key Features
Status LED
Built-in indicator for power/activity
Low Cost
Affordable solution for basic projects
Low Power
3-5V operation with minimal current draw
Plug & Play
Pre-calibrated digital output
Technical Specifications
Temperature Range | 0°C to 50°C (±2°C accuracy) |
---|---|
Humidity Range | 20-90% RH (±5% accuracy) |
LED Indicator | Red power/activity light |
Sampling Rate | 1Hz (1 reading per second) |
Operating Voltage | 3.3V – 5.5V DC |
Dimensions | 23mm × 12mm × 5mm |
Pin Configuration
Pin | Function | Connection |
---|---|---|
1 | VCC | 3.3V-5V (Red LED connected here) |
2 | DATA | Digital Pin (with pull-up resistor) |
3 | NC | Not Connected |
4 | GND | Ground |
LED Behavior: The red LED will light when powered and blink during data transmission
Wiring with Arduino
// Basic Connections: // VCC → 5V (LED will light up) // DATA → D2 (with 4.7KΩ pull-up to VCC) // GND → GND
Tip: The LED provides visual confirmation of power and data transmission activity
Library Setup
- Install the DHT sensor library by Adafruit
- Include the library in your sketch:
#include <DHT.h>
- Initialize the sensor (note DHT11 type):
#define DHTPIN 2 // Digital pin #define DHTTYPE DHT11 // DHT 11 DHT dht(DHTPIN, DHTTYPE); void setup() { Serial.begin(9600); dht.begin(); }
Basic Example with LED Monitoring
#include <DHT.h> #define DHTPIN 2 #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); void setup() { Serial.begin(9600); dht.begin(); pinMode(LED_BUILTIN, OUTPUT); // Arduino's onboard LED } void loop() { // Blink Arduino LED when reading sensor digitalWrite(LED_BUILTIN, HIGH); float h = dht.readHumidity(); float t = dht.readTemperature(); digitalWrite(LED_BUILTIN, LOW); if (isnan(h) || isnan(t)) { Serial.println("Sensor error!"); delay(500); // Rapid blink on error digitalWrite(LED_BUILTIN, HIGH); delay(500); return; } Serial.print("Humidity: "); Serial.print(h); Serial.print("%\tTemperature: "); Serial.print(t); Serial.println("°C"); delay(2000); // Match DHT11's 1Hz sampling rate }
LED Status Guide
LED State | Meaning |
---|---|
Steady On | Power connected properly |
Brief Flicker | Data transmission occurring |
Off | No power or wiring issue |
Irregular Blinking | Communication problems |
Troubleshooting
LED Not Lighting
- Check VCC and GND connections
- Verify power supply voltage (3.3V-5V)
- Test with different power source
LED On But No Data
- Confirm DATA pin connection
- Add/check 4.7KΩ pull-up resistor
- Try different digital pin
Inconsistent Readings
- Ensure 2-second delay between readings
- Keep sensor away from heat sources
- Check for condensation on sensor
Related Posts
MG90S Mini Digital 180° Servo
MG90S Mini Digital 180° Servo
Metal Gear, 2.2kg·cm Torque for RC and Robotics
Introduction
The MG90S is a compact di...
XKC-Y25-V Non-Contact Water Liquid Level Sensor
XKC-Y25-V Non-Contact Water Liquid Level Sensor
Capacitive Detection Without Physical Contact
Introduction
The XKC-Y...
Waterproof Ultrasonic Obstacle Sensor, Sensor with Separate Probe
+
Waterproof Ultrasonic Obstacle Sensor
Distance Measurement with Separate Waterproof Probe
Introduction
The Wa...
Water Level Depth Detection Sensor
Water Level Depth Detection Sensor
Liquid Measurement for Arduino and IoT Projects
Introduction
The Water Level Dept...
VL53L0X Purple Laser Distance Sensor Module
VL53L0X Laser Distance Sensor Module
High-Speed, High-Precision Time-of-Flight Distance Measurement
Introduction
The...
TCS34725 RGB Color Sensor Module
TCS34725 RGB Color Sensor Module
High-Accuracy Digital Color Detection with IR Filter
Introduction
The TCS34725 is a...
TCS3200 Color Sensor Module
TCS3200 Color Sensor Module
Precise RGB Color Detection for Arduino and Embedded Projects
Introduction
The TCS3200 C...
PN532 NFC RFID Read/Write Module V3 Kit
PN532 NFC RFID Read/Write Module V3 Kit
Advanced Near Field Communication for Arduino and Embedded Systems
Introducti...
HC-SR501 PIR Motion Sensor Module
HC-SR501 PIR Motion Sensor Module
Passive Infrared Detection for Security and Automation Projects
Introduction
The H...
Flex Sensor 5.6 cm (Detect Bending Motion)
Flex Sensor 5.6cm
Bend Detection Sensor for Arduino and Wearable Electronics Projects
Introduction
The 5.6cm...
ACS712 Current Sensor Module
ACS712 5A Current Sensor Module
Hall-Effect Based AC/DC Current Measurement for Arduino Projects
Introduction
The AC...
AS608 Optical Fingerprint Sensor Module
AS608 Optical Fingerprint Sensor Module
High-Precision Biometric Recognition for Arduino and Microcontroller Projects
...
Recent Comments