The steps for this recipe are as follows:
- Open Fritzing and on the right-hand side panel's Parts section, click on the menu and select Import.... Then, select the ESP32 and DHT11. Both of these can be found in the source code for this chapter:
- Search for a resistor in the Parts list. Once you've dragged it onto the screen, adjust its properties to 4.7kΩ:
- Now, place the DTH11 on the board and hook up the power rails using 3.3 volts and a ground:
- Then, attach the power rails to the board. Also, connect the General-Purpose Input/Output (GPIO) pin 27 to the DHT11s data pin. We must also add a 4.7k ohm resistor between the 3.3V power rail and the data pin on the DHT11:
- Next, connect the ESP32 to your computer and pull up the /src/main.cpp file from the PlatformIO project we started in the Getting ready section.
- In main.cpp, include the DHT.h library reference:
#include "DHT.h"
- Create references to your data pin on the...