In this tutorial, I’ll show you how to connect the DHT11 to the Raspberry Pi and output the humidity and temperature readings to an LCD.

The DHT11 temperature and humidity sensor is a nice little module that provides digital temperature and humidity readings. It’s really easy to set up, and only requires one wire for the data signal. These sensors are popular for use in remote weather stations, soil monitors, and home automation systems

Connecting the DHT11 to the Raspberry Pi

There are two variants of the DHT11 you’re likely to come across. One is a three pin PCB mounted module and the other is a four pin stand-alone module. The pinout is different for each one, so connect the DHT11 according to which one you have:

Also, some of the PCB mounted modules might have a different pinout than the one above, so be sure to check your sensor for any labels indicating which pin is Vcc, ground or signal.