New: the AI firewall watches the whole platform and explains each incident in plain words. See how it works

Which end of the Pi Zero W header is pin 1? My DHT22 gets hot and reads nothing

Which end of the Pi Zero W header is pin 1? My DHT22 gets hot and reads nothing

Solved 6 5

First year project, a temperature and humidity logger that sends to Hermetry. I have a Raspberry Pi Zero W with a soldered header, a DHT22 module (3 pins, VCC DATA GND) and jumper wires. I followed a tutorial that says VCC to pin 1, data to pin 7, GND to pin 6.

The script always says:

RuntimeError: DHT sensor not found, check wiring

and when I touched the DHT22 after a few minutes it was really warm. I think I may have the board the wrong way round because the diagrams show a Pi 3/4 and the Zero is small and I’m not sure which corner is pin 1. Did I break the sensor?

♥ 1

Can you post a photo of the wiring? Hard to say otherwise.

♥ 0

I can’t attach images yet (new account). The red wire is on the pin closest to the corner where the SD card is, the outer row, the one next to the board edge.

♥ 1

That’s the problem. On the Zero, pin 1 is at the SD card end, but on the inner row. The pin you used, outer row at that corner, is pin 2, which is 5V. Count from there: pin 6 on the outer row is GND, pin 7 is on the inner row. If your red went to pin 2 and the rest followed the tutorial with the board mirrored, the DHT22 probably had 5V or GND on the wrong legs, which is why it got warm.

Ways to be sure next time: the solder pad for pin 1 is square, all the others are round. And on the Pi itself:

$ pinout          # comes with gpiozero, prints an ASCII map of your board
   3V3  (1) (2)  5V
 GPIO2  (3) (4)  5V
 GPIO3  (5) (6)  GND
 GPIO4  (7) (8)  GPIO14

So: VCC to pin 1 (3V3), DATA to pin 7 (which is GPIO4 in code), GND to pin 6. Use 3V3 for the DHT22, not 5V, so the data line stays at a level the Pi can take.

Whether the sensor survived: DHT22s are tougher than you’d think. Rewire, let it cool, try again. If it still says not found with the correct wiring, it’s dead, they’re cheap.

Accepted solution♥ 5

Also if you’re on the old Adafruit_DHT library, it’s deprecated. The circuitpython one works on current Pi OS: adafruit-circuitpython-dht plus board.D4.

♥ 2

I keep one of those printed GPIO reference cards that slide over the header. Saved me more than once in lab.

Timestamps in UTC or it didn't happen.
♥ 0

The sensor survived!! Rewired with pinout open in another window, switched to the circuitpython library, and it reads 26.8 C and 61%. Readings are on my Hermetry dashboard now. I had the whole header mirrored, pin 2 for VCC like Ciaran said.

♥ 0
Viewing 7 posts – 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Join the conversation

Sign in to ask and answer, like helpful posts and mark the reply that solved your problem. Every contribution earns points and levels.

Share