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

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.

主站蜘蛛池模板: 定安县| 福清市| 慈利县| 霍邱县| 叙永县| 安泽县| 丰顺县| 景洪市| 克拉玛依市| 黑河市| 神农架林区| 平定县| 阿尔山市| 邛崃市| 泾川县| 镇安县| 札达县| 龙州县| 宜昌市| 泗洪县| 胶州市| 竹溪县| 天长市| 土默特右旗| 武穴市| 颍上县| 融水| 冷水江市| 包头市| 三亚市| 大安市| 延川县| 鄂托克旗| 黑山县| 宁阳县| 广河县| 武乡县| 沁阳市| 秦安县| 麟游县| 浙江省|