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

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.

主站蜘蛛池模板: 本溪| 大余县| 新安县| 吴桥县| 肃南| 平遥县| 徐州市| 固镇县| 通州市| 清徐县| 阿拉善左旗| 安顺市| 乃东县| 泸定县| 柘城县| 武夷山市| 望江县| 辽阳县| 墨玉县| 义马市| 鄂托克前旗| 许昌市| 莆田市| 敖汉旗| 溆浦县| 丰宁| 原阳县| 五常市| 革吉县| 彰化市| 余江县| 普洱| 汤原县| 都江堰市| 胶南市| 溆浦县| 安庆市| 荆州市| 射洪县| 康定县| 永平县|