DHT11 temperature and humidity sensor
STM32-Experiments Free Updated Sep 21, 2026

DHT11 temperature and humidity sensor

DHT11 , temperature and humidity sensor

1. Introduction

Automotive climate control systems and home humidifiers both need to know how humid the surrounding air currently is before deciding what to do next, and this experiment builds exactly that capability. A DHT11 sensor is wired to the STM32F070RB using a proprietary single-wire digital protocol, and the microcontroller reads both temperature and humidity from it, printing the humidity reading to a PC over UART.

2. Scope

This experiment covers implementing the DHT11's single-wire communication protocol entirely in software, including the host-initiated start sequence, detecting the sensor's acknowledgement response, reading forty bits of data by precisely measuring pulse widths, and validating the received data using its checksum byte. This is the most timing-critical software protocol covered in this series, since there is no dedicated hardware peripheral handling the communication, every bit of timing must be measured directly by the application.

3. Prerequisite

3.1 Hardware

  • STM32 Nucleo-F070RB development board

  • DHT11 temperature and humidity sensor module

  • Breadboard and jumper wires

  • Micro-USB cable

  • PC with PuTTY

3.2 Software

  • STM32CubeMX (standalone)

  • STM32CubeIDE

  • ST-LINK USB driver

  • PuTTY, or an equivalent serial terminal application

Community Q&A

0 questions

Ask questions and get answers from our community and staff moderators.

No questions yet — be the first to start the conversation!

Ask a Question

Please log in to ask a question or post a reply.

Login to Participate