- Interface the DHT11 digital humidity and temperature sensor with the NodeMCU
- Read the values of humidity and temperature of the surroundings.
- NodeMCU board (quantity: 1 no.)
- Micro USB cable A to B (quantity: 1 no.)
- Breadboard (quantity: 1 no.)
- DHT11 temperature and humidity sensor (quantity: 1 no.)
- DHT sensor library
- Adafruit Unified Sensor library
- Jumper wire – male to male (quantity: 4 no.)
- Arduino IDE on your computer
The DHT11 is a digital humidity and temperature sensor. It has one digital output which can be connected to any digital input pin of the NodeMCU.
You need to install the DHT library and the Adafruit Unified Sensor library.
- Open Arduino IDE
- Navigate to Sketch -> Include Library -> Manage Libraries
- Search for DHT library and install
- Search for Adafruit Unified Sensor library and install
Interfacing the DHT11 sensor with NodeMCU
To copy the code, right click on view raw at the bottom of the code, click on open link in new tab and then copy the code.
There you go!