¿Qué extremo del header del Pi Zero W es el pin 1? Mi DHT22 se calienta y no devuelve nada
Traducido del English por IA ·
Proyecto de primer año: un registrador de temperatura y humedad que envía datos a Hermetry. Tengo una Raspberry Pi Zero W con header soldado, un módulo DHT22 (3 pines: VCC DATA GND) y cables jumper. Seguí un tutorial que dice VCC al pin 1, data al pin 7 y GND al pin 6.El script siempre muestra:
RuntimeError: DHT sensor not found, check wiring
Y cuando toqué el DHT22 después de unos minutos, estaba muy caliente. Creo que puede que haya puesto la placa al revés, porque los diagramas muestran una Pi 3/4 y la Zero es pequeña, y no estoy seguro de qué esquina es el pin 1. ¿He roto el sensor?
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?
Traducido del English por IA ·
¿Puedes publicar una foto del cableado? Es difícil decir otra cosa sin ella.
Can you post a photo of the wiring? Hard to say otherwise.
Traducido del English por IA ·
Todavía no puedo adjuntar imágenes (cuenta nueva). El cable rojo está en el pin más cercano a la esquina donde está la tarjeta SD, la fila exterior, la que está junto al borde de la placa.
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.
Traducido del English por IA ·
Ese es el problema. En la Zero, el pin 1 está en el extremo de la tarjeta SD, pero en la fila interior. El pin que usaste, la fila exterior en esa esquina, es el pin 2, que es 5V. Cuenta desde ahí: el pin 6 de la fila exterior es GND, el pin 7 está en la fila interior. Si tu cable rojo fue al pin 2 y el resto siguió el tutorial con la placa al revés, es probable que el DHT22 tuviera 5V o GND en las patas equivocadas, por eso se calentó.Formas de asegurarte la próxima vez: la almohadilla de soldadura del pin 1 es cuadrada, las demás son redondas. Y en la propia Pi:
$ pinout # viene con gpiozero, muestra un mapa ASCII de tu placa
3V3 (1) (2) 5V
GPIO2 (3) (4) 5V
GPIO3 (5) (6) GND
GPIO4 (7) (8) GPIO14
Entonces: VCC al pin 1 (3V3), DATA al pin 7 (que es GPIO4 en el código), GND al pin 6. Usa 3V3 para el DHT22, no 5V, para que la línea de datos se mantenga en un nivel que la Pi pueda soportar.Sobre si el sensor sobrevivió: los DHT22 son más resistentes de lo que parece. Vuelve a cablear, deja que se enfríe e inténtalo de nuevo. Si con el cableado correcto sigue diciendo que no lo encuentra, está muerto, y son baratos.
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.
Traducido del English por IA ·
Además, si usas la antigua biblioteca Adafruit_DHT, está obsoleta. La versión de CircuitPython funciona en el Pi OS actual: adafruit-circuitpython-dht más 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.
Traducido del English por IA ·
Guardo una de esas tarjetas de referencia GPIO impresas que se colocan sobre el header. Me ha salvado más de una vez en el laboratorio.
I keep one of those printed GPIO reference cards that slide over the header. Saved me more than once in lab.
Traducido del English por IA ·
¡¡El sensor sobrevivió!! Lo recableé con el pinout abierto en otra ventana, cambié a la biblioteca circuitpython, y ahora lee 26,8 C y 61 %. Las lecturas ya están en mi panel de Hermetry. Tenía todo el header en espejo, pin 2 para VCC como dijo Ciaran.
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.
- Debes estar registrado para responder a este debate.
Únete a la conversación
Inicia sesión para preguntar y responder, dar me gusta a las publicaciones útiles y marcar la respuesta que resolvió tu problema. Cada aportación suma puntos y niveles.

