DHT11
Digital temperature and humidity sensor, the simpler sibling of the DHT22: smaller range and whole numbers only. It connects the same way (one data wire) and uses the same dht module of MicroPython, with dht.DHT11.
Pinout
| Pin | Connect to | Note |
|---|---|---|
| VCC (1) | 3V3 | |
| DATA (2) | GPIO (e.g. 4) with a pull-up resistor | modules with a board already have the resistor |
| NC (3) | leave unconnected | |
| GND (4) | GND |
FastTeacherFor teachers
From the syllabus to a planned semester
- Teaching plan and calendar built automatically
- Class diary ready to paste into SIGA
- Slides and exercise lists with answer keys
Free Community edition · Windows
MicroPython example
import dht
from machine import Pin
import time
sensor = dht.DHT11(Pin(4))
while True:
sensor.measure() # at most one reading per second
print(sensor.temperature(), "°C", sensor.humidity(), "%")
time.sleep(2)
Specifications
| Item | Value | Source |
|---|---|---|
| Power supply | 3.3–5.5 V (same as the DHT22) | Typical datasheet values |
| Temperature | 0 to 50 °C, ± 2 °C | Typical datasheet values |
| Humidity | 20–90 % RH, ± 5 % | Typical datasheet values |
| Interval between readings | ≥ 1 s | Typical datasheet values |
| Resolution | whole numbers | PyPlaca component catalog — Under review: newer DHT11 units send tenths of °C |
| Pin order | VCC, DATA, NC, GND | Typical datasheet values |
Values marked "Under review" will still be checked against the parts in the lab.