User avatar
yy502
Posts: 30
Joined: Sun Aug 03, 2014 2:15 am
Location: Cambridge, UK

Pi Zero GPIO pin stuck at low even when pulled up

Thu Mar 02, 2017 11:24 am

Background

I've been using a DHT22 sensor with my RP0 for some time already and it worked perfectly well.
I use a 10k Ohm resistor to pull up GPIO 5 (BCM 24) to 3.3V, and all the voltage tests fine using a multimeter. i.e. 3.3V across GPIO 5 and GND.

Issue

One day I found my DHT22 isn't reading data and it turned out GPIO 5 is stuck in low (reads 0 using "gpio readall" by WiringPi) even it's physically pull-up?! I tried to change it to out put mode and set it to high using WiringPi. The mode changes fine, but the output is always stuck at low.

Reboot, upgrade firmware didn't make a difference.

Please share your experiences in debugging similar issues with GPIO. Thanks.

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Pi Zero GPIO pin stuck at low even when pulled up

Thu Mar 02, 2017 11:54 am

With nothing connected to the GPIO try wiringPi's pintest utility or try my gpiotest.

User avatar
yy502
Posts: 30
Joined: Sun Aug 03, 2014 2:15 am
Location: Cambridge, UK

Re: Pi Zero GPIO pin stuck at low even when pulled up

Thu Mar 02, 2017 11:57 am

joan wrote:With nothing connected to the GPIO try wiringPi's pintest utility or try my gpiotest.
will do this evening and post an update. thanks for the advice!

User avatar
yy502
Posts: 30
Joined: Sun Aug 03, 2014 2:15 am
Location: Cambridge, UK

Re: Pi Zero GPIO pin stuck at low even when pulled up

Fri Mar 03, 2017 1:07 pm

joan wrote:With nothing connected to the GPIO try wiringPi's pintest utility or try my gpiotest.
got some faults :-(
--> Pin 4 failure. Expected 1, got 0
--> Pin 5 failure. Expected 1, got 0
Is there a way to fix these?

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Pi Zero GPIO pin stuck at low even when pulled up

Fri Mar 03, 2017 1:27 pm

move to another pin, but post your circuit diagram first so we can fix it
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Pi Zero GPIO pin stuck at low even when pulled up

Fri Mar 03, 2017 1:28 pm

yy502 wrote: Is there a way to fix these?
It'll cost you a fiver or a tenner if you want on-board wireless.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
yy502
Posts: 30
Joined: Sun Aug 03, 2014 2:15 am
Location: Cambridge, UK

Re: Pi Zero GPIO pin stuck at low even when pulled up

Fri Mar 03, 2017 1:58 pm

RaTTuS wrote:move to another pin, but post your circuit diagram first so we can fix it
hmmm, it's a very simple circuit as below:

Code: Select all

+-------+
|       |
| DHT22 |
|       |
+-+-+-+-+
  | | |
  | | |
  | | +-----+ GND
  | |
  | +--+----+ GPIO
  |    |
  |  +-+-+
  |  |10k|
  |  +-+-+
  |    |
  +----+----+ 3.3V

I guess I can use another pin, but I'm curious why and how those GPIO pins are broken...

User avatar
yy502
Posts: 30
Joined: Sun Aug 03, 2014 2:15 am
Location: Cambridge, UK

Re: Pi Zero GPIO pin stuck at low even when pulled up

Fri Mar 03, 2017 2:00 pm

DougieLawson wrote:
yy502 wrote: Is there a way to fix these?
It'll cost you a fiver or a tenner if you want on-board wireless.
yeh.... already ordered the new Zero W... but I just don't get it why the pins broke for no good reason?

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Pi Zero GPIO pin stuck at low even when pulled up

Fri Mar 03, 2017 2:05 pm

yy502 wrote: yeh.... already ordered the new Zero W... but I just don't get it why the pins broke for no good reason?
It's usually done by sending 5V (or higher) into a GPIO (that isn't true for the SDA/SCL pins which have 1K8 pullups).
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
yy502
Posts: 30
Joined: Sun Aug 03, 2014 2:15 am
Location: Cambridge, UK

Re: Pi Zero GPIO pin stuck at low even when pulled up

Fri Mar 03, 2017 2:14 pm

DougieLawson wrote:
yy502 wrote: yeh.... already ordered the new Zero W... but I just don't get it why the pins broke for no good reason?
It's usually done by sending 5V (or higher) into a GPIO (that isn't true for the SDA/SCL pins which have 1K8 pullups).
For the record, I moved the sensor data wire to GPIO 6 and it works again.

In my case, I soldered the wires to physical pins 17, 18 (now 22) and 20, so it couldn't be the 3.3v wire accidentally tapped onto the 5V neighbour pin.

And GPIO 4 was unused, which broke the same way as GPIO 5... stuck to low no matter what even it measures 3.3v.

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Pi Zero GPIO pin stuck at low even when pulled up

Mon Mar 13, 2017 9:37 am

If the GPIO pin was ever set as an output and set high the lack of a current limiting resistor would burn out the pin. Add a 1k current limiting resistor to avoid the risk.

Code: Select all

+-------+
|       |
| DHT22 |
|       |
+-+-+-+-+
  | | |
  | | |
  | | +-----------+ GND
  | |       +--+
  | +----+--|1k|--+ GPIO
  |      |  +--+
  |    +-+-+
  |    |10k|
  |    +-+-+
  |      |
  +----------+----+ 3.3V
Doug.
Building Management Systems Engineer.

User avatar
yy502
Posts: 30
Joined: Sun Aug 03, 2014 2:15 am
Location: Cambridge, UK

Re: Pi Zero GPIO pin stuck at low even when pulled up

Mon Mar 13, 2017 10:06 am

Thanks for the tip! I always thought RPi would have some kind of current protection built-in for the GPIOs.

I'm using 2 pins to control some relays. Do I need current limiting resistors for them too?
BMS Doug wrote:If the GPIO pin was ever set as an output and set high the lack of a current limiting resistor would burn out the pin. Add a 1k current limiting resistor to avoid the risk.

Code: Select all

+-------+
|       |
| DHT22 |
|       |
+-+-+-+-+
  | | |
  | | |
  | | +-----------+ GND
  | |       +--+
  | +----+--|1k|--+ GPIO
  |      |  +--+
  |    +-+-+
  |    |10k|
  |    +-+-+
  |      |
  +----------+----+ 3.3V

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Pi Zero GPIO pin stuck at low even when pulled up

Mon Mar 13, 2017 4:21 pm

yy502 wrote:Thanks for the tip! I always thought RPi would have some kind of current protection built-in for the GPIOs.

I'm using 2 pins to control some relays. Do I need current limiting resistors for them too?
I imagine that you are using some kind of relay driver board? If so then current limiting resistors shouldn't be necessary (as they will be built into the relay board). If you are trying to energise relays directly from the Pi then expect to lose another Pi, they cant handle the load directly.
Doug.
Building Management Systems Engineer.

User avatar
yy502
Posts: 30
Joined: Sun Aug 03, 2014 2:15 am
Location: Cambridge, UK

Re: Pi Zero GPIO pin stuck at low even when pulled up

Mon Mar 13, 2017 4:23 pm

BMS Doug wrote: I imagine that you are using some kind of relay driver board? If so then current limiting resistors shouldn't be necessary (as they will be built into the relay board). If you are trying to energise relays directly from the Pi then expect to lose another Pi, they cant handle the load directly.
Yes, it's one of the common blue relay modules.

Thanks again for your insights. :-)

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Pi Zero GPIO pin stuck at low even when pulled up

Tue Mar 14, 2017 8:11 am

yy502 wrote:
BMS Doug wrote: I imagine that you are using some kind of relay driver board? If so then current limiting resistors shouldn't be necessary (as they will be built into the relay board). If you are trying to energise relays directly from the Pi then expect to lose another Pi, they cant handle the load directly.
Yes, it's one of the common blue relay modules.

Thanks again for your insights. :-)
You are welcome, happy Pi'ing
Doug.
Building Management Systems Engineer.

Return to “Troubleshooting”