programming esp32-wrover with DHT22 (AM2302) humidity and temperature sensor

Referring to the original material at ESP32 with DHT11/DHT22 Temperature and Humidity Sensor using Arduino IDE | Random Nerd Tutorials

The reference is straight forward; however, it is not for the esp32-wrover.

Based on the from the reference, using educated guess without reading the specification, it is a hindsight that the original wiring will not work.

Original wiring on the breadboard for the ESP32-wrover, spoiler this is wrong for many reasons

It didn’t work, was getting the error “Failed to read from DHT sensor!” from the sample code.

DHTPIN were used is 4, which I had wrongly assumed it to be the physical pin number. Little did I know that, the reference is referring to GPIO4 instead of the physical pin number.

Based on the reference, ESP32-wrover spec sheet page 9, the physical pin 4 is the SENSOR_VP.

Continue reading