ohmio

Circuits / Sensors

Arduino UNO: temperature and humidity with a DHT11

A sensor read through its library: the DHT11 answers on one data pin, in whole degrees and whole %RH, read through a library that asks at most every 2 s (the chip itself admits one a second); isnan() tells a failed read

Arduino UNO: temperature and humidity with a DHT11, simulated on a breadboard

Tap a part to see its voltages and currents. It is a model, not a measurement.

What do you need?

The AliExpress links are affiliate links: if you buy through them ohmio.dev gets a commission, at no extra cost to you. Affiliate links

This page is a guide: the numbers come from a simulation, and real parts vary. Check your parts before you power the circuit. Safety and responsibility

How does an Arduino read temperature and humidity from a DHT11?

The DHT11 holds a temperature sensor and a humidity sensor and sends both as one digital message on its single data pin, S. This module has its own 10 kΩ pull-up, so S idles at the UNO's 5 V. The program does not count the bits itself: the DHT library does, and the sketch calls readHumidity() and readTemperature(). It waits 2 s before each read, the library's limit. If either value is NaN, which isnan() detects, the read failed and the sketch prints fail. Otherwise it prints a line like T: 24.00 C H: 41.00 %. The DHT11 reports whole numbers: in the model, 24.6 °C is read as 25.00. Its range is 0 to 50 °C (±2 °C) and 20 to 90 %RH (±5 %). On a real module, check the silkscreen: the order of S, + and − changes between boards.

Values from the Protoboard ISO simulation: a model, not a bench measurement.