官术网_书友最值得收藏!

Wiring

Let's begin by exploring the DHT22 sensor module. This module can sense temperature and humidity. In general, the DHT22 has four pins. You can see the sensor pinout in Figure 2-3:

Figure 2-3: A general pinout for a DHT22 sensor module

For our demo, we need to wire the hardware as follows:

  • Connect DHT22 pin 1 to the ESP32 board 3.3V.
  • Connect DHT22 pin 2 to the ESP32 board GPIO 26 (IO26). You can add a pull resistor 4K7 (optional).
  • Connect DHT22 pin 4 to the ESP32 board GND. You can add a pull resistor 4K7 (optional).

You can see my hardware wiring with the ESP-WROVER-KIT board and DHT22 in Figure 2-4:

Figure 2-4: A wiring sample from my hardware

Now that we have covered hardware wiring, let's move on to writing the program.

主站蜘蛛池模板: 宁强县| 兴安县| 伽师县| 石家庄市| 安远县| 双城市| 安新县| 报价| 灵宝市| 洪洞县| 金平| 开封县| 通州市| 福泉市| 安庆市| 同德县| 桃源县| 永泰县| 尖扎县| 北宁市| 玛曲县| 浙江省| 儋州市| 醴陵市| 泾源县| 抚宁县| 遂昌县| 宜宾市| 顺义区| 阿城市| 渑池县| 舞钢市| 昭苏县| 且末县| 云龙县| 平南县| 三河市| 新巴尔虎左旗| 齐河县| 鱼台县| 长岛县|