Welches Ende des Pi Zero W Headers ist Pin 1? Mein DHT22 wird heiß und liefert keine Werte
Von English mit KI übersetzt ·
Erstes Projekt im Studium, ein Temperatur- und Feuchtelogger, der Daten an Hermetry sendet. Ich habe einen Raspberry Pi Zero W mit angelötetem Header, ein DHT22-Modul (3 Pins, VCC DATA GND) und Jumperkabel. Ich habe einem Tutorial gefolgt, das VCC an Pin 1, Data an Pin 7 und GND an Pin 6 angibt.Das Skript meldet immer:
RuntimeError: DHT sensor not found, check wiring
Und als ich den DHT22 nach ein paar Minuten angefasst habe, war er richtig warm. Ich glaube, ich habe das Board vielleicht falsch herum angeschlossen, weil die Diagramme einen Pi 3/4 zeigen und der Zero sehr klein ist. Ich bin mir nicht sicher, welche Ecke Pin 1 ist. Habe ich den Sensor kaputt gemacht?
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?
Von English mit KI übersetzt ·
Kannst du ein Foto der Verkabelung posten? Ohne das ist es schwer zu sagen.
Can you post a photo of the wiring? Hard to say otherwise.
Von English mit KI übersetzt ·
Ich kann noch keine Bilder anhängen (neues Konto). Das rote Kabel liegt am Pin, der der Ecke mit der SD-Karte am nächsten ist, in der äußeren Reihe, neben dem Platinenrand.
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.
Von English mit KI übersetzt ·
Genau das ist das Problem. Beim Zero liegt Pin 1 am SD-Kartenende, aber in der inneren Reihe. Der Pin, den du benutzt hast, also der äußere Reihenpin an dieser Ecke, ist Pin 2, und der ist 5V. Ab dort weiterzählen: Pin 6 der äußeren Reihe ist GND, Pin 7 liegt in der inneren Reihe. Wenn dein Rot an Pin 2 ging und der Rest der Anleitung mit gespiegelter Platine gefolgt ist, hatte der DHT22 wahrscheinlich 5V oder GND an den falschen Beinen, deshalb wurde er warm.So kannst du es beim nächsten Mal sicher prüfen: Das Lötpad für Pin 1 ist eckig, alle anderen sind rund. Und direkt auf dem Pi:
$ pinout # kommt mit gpiozero, gibt eine ASCII-Karte deiner Platine aus
3V3 (1) (2) 5V
GPIO2 (3) (4) 5V
GPIO3 (5) (6) GND
GPIO4 (7) (8) GPIO14
Also: VCC an Pin 1 (3V3), DATA an Pin 7 (im Code GPIO4), GND an Pin 6. Für den DHT22 3V3 statt 5V verwenden, damit die Datenleitung auf einem Pegel bleibt, den der Pi verkraftet.Ob der Sensor überlebt hat: DHT22s sind robuster, als man denkt. Neu verkabeln, abkühlen lassen, erneut versuchen. Wenn er mit der korrekten Verkabelung immer noch „not found“ meldet, ist er hin, und die sind günstig.
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.
Von English mit KI übersetzt ·
Falls du noch die alte Adafruit_DHT-Bibliothek verwendest: Sie ist veraltet. Die CircuitPython-Version funktioniert unter aktuellem Pi OS: adafruit-circuitpython-dht plus board.D4.
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.
Von English mit KI übersetzt ·
Ich habe eine dieser gedruckten GPIO-Referenzkarten, die man über die Stiftleiste schiebt. Im Labor hat sie mir schon mehr als einmal geholfen.
I keep one of those printed GPIO reference cards that slide over the header. Saved me more than once in lab.
Von English mit KI übersetzt ·
Der Sensor hat überlebt!! Neu verkabelt, mit dem Pinout in einem anderen Fenster offen, auf die circuitpython-Bibliothek umgestiegen, und jetzt liest er 26,8 °C und 61 %. Die Messwerte werden jetzt auf meinem Hermetry-Dashboard angezeigt. Ich hatte den ganzen Header gespiegelt, Pin 2 für VCC, so wie Ciaran gesagt hat.
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.
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.
Mitdiskutieren
Melde dich an, um Fragen zu stellen und zu beantworten, hilfreiche Beiträge mit „Gefällt mir“ zu markieren und die Antwort zu kennzeichnen, die dein Problem gelöst hat. Jeder Beitrag bringt Punkte und Stufen.

