jclark1245
Posts: 1
Joined: Thu Jun 04, 2015 3:10 am

GPIO pins with pull up resistors

Thu Jun 04, 2015 3:17 am

I am trying to connect 10 push buttons as inputs. When I run the python script, it warns me that pins 2 and 3 have physical pull up resistors fitted on their channels. Does this mean I can't use them if my circuit requires pull down resistors? I have been searching and searching about using GPIOs but couldn't find this answer.

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

Re: GPIO pins with pull up resistors

Thu Jun 04, 2015 7:28 am

Probably best to use another pair of gpios. The pull-ups are 1k8 to 3V3. You'd need a strong (lower resistance) pull-down to defeat them (say 1k), but now you start to draw an appreciable current for not a particularly good reason.

texy
Forum Moderator
Forum Moderator
Posts: 5155
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: GPIO pins with pull up resistors

Thu Jun 04, 2015 2:01 pm

jclark1245 wrote:I am trying to connect 10 push buttons as inputs. When I run the python script, it warns me that pins 2 and 3 have physical pull up resistors fitted on their channels. Does this mean I can't use them if my circuit requires pull down resistors? I have been searching and searching about using GPIOs but couldn't find this answer.
You don't state which Pi you are using, but there are plenty of other GPIO pins you can use instead. As long as it is 10 and you have no need for any of the other GPIO's that have 'special' use.
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Massi
Posts: 1691
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: GPIO pins with pull up resistors

Thu Jun 04, 2015 2:09 pm

jclark1245 wrote:I am trying to connect 10 push buttons as inputs. When I run the python script, it warns me that pins 2 and 3 have physical pull up resistors fitted on their channels. Does this mean I can't use them if my circuit requires pull down resistors? I have been searching and searching about using GPIOs but couldn't find this answer.
Since you are using switch buttons, you can simply use them with pullup.. so connect GPIO with pullup -> button -> ground
That i like more than gpio with pull down -> button -> Vcc

plugwash
Forum Moderator
Forum Moderator
Posts: 3439
Joined: Wed Dec 28, 2011 11:45 pm

Re: GPIO pins with pull up resistors

Thu Jun 04, 2015 3:03 pm

jclark1245 wrote:I am trying to connect 10 push buttons as inputs. When I run the python script, it warns me that pins 2 and 3 have physical pull up resistors fitted on their channels. Does this mean I can't use them if my circuit requires pull down resistors? I have been searching and searching about using GPIOs but couldn't find this answer.
If you connect a pull-up and a pull-down on the same pin you will end up with an intermediate voltage level when there is nothing driving the pin hard. Depending on where that intermediate voltage level sits it may read high, low or results may be erratic.

You may get away with using a pull-down by using one that is much stronger (lower resistance) than the one on the pi (I wouldn't consider the 1K suggested by joan to be low enough to ensure reliable operation, unfortunately we don't have exact input specs for the pi's pins to let us calculate how much stronger the pull-down needs to be than the pull-up to override it but my rule of thumb would be that the pull-down should be 5-10 times lower resistance than the pull-up you are attempting to override). Unfortunately the low value needed will waste power and depending on what you are driving the line from may cause problems for the driver (made worse by the fact that most drivers are worse at driving high than driving low).

Return to “General discussion”