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

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.

主站蜘蛛池模板: 福建省| 黄冈市| 望都县| 新余市| 克什克腾旗| 兴和县| 汤原县| 新化县| 甘孜| 宽甸| 东城区| 广饶县| 海口市| 同江市| 青河县| 平舆县| 河南省| 确山县| 永平县| 临海市| 吴川市| 五指山市| 财经| 盱眙县| 交口县| 旅游| 体育| 呼伦贝尔市| 孟津县| 怀化市| 高台县| 嘉兴市| 益阳市| 安丘市| 叙永县| 雅安市| 偃师市| 英山县| 道真| 育儿| 浮梁县|