Worldfrog
Posts: 9
Joined: Mon Dec 28, 2015 12:35 am

Internal pull up/down resistors

Mon Dec 28, 2015 3:48 am

I was just wondering, how well do the internal pull up/down resistors work? If they work well then it saves me a good bit of time(especially with the way my breakout board is set up.) So, I was just wondering if they are trustworthy, as right now I need a pull down resistor in order to make an off button I'm making (I know it's simple but I'm a Pi noob and just got mine 2 days ago)

User avatar
Burngate
Posts: 6313
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Internal pull up/down resistors

Mon Dec 28, 2015 10:34 am

Depends on your definition of "working well"

Their good points are 1) They're quite high resistance, so easily overcome, meaning not much current needs to be drawn by your external circuit, and 2) your program can set them the way you want them, even on-the-fly, so you have total control

Their draw-backs are 1) they're quite high resistance, so if there's something likely to pull the opposite way, such as interference spikes they may not be good enough, and 2) your program has to set them, and something else could unset them.

User avatar
karrika
Posts: 1125
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Internal pull up/down resistors

Mon Dec 28, 2015 10:54 am

I was using several 3 meter cables with push-buttons. Only internal pull-ups. No other components. Worked well. But I would not trust this setup with interrupting GPIO pins. There may be a lot of noise.

You could read the data twice before relying on it like:

Code: Select all

FIRSTDING=`/usr/local/bin/gpio read 15`
sleep 0.1
SECONDDING=`/usr/local/bin/gpio read 15`
if [ "$SECONDDING" = "$FIRSTDING" ]; then
    echo ding
fi

Worldfrog
Posts: 9
Joined: Mon Dec 28, 2015 12:35 am

Re: Internal pull up/down resistors

Mon Dec 28, 2015 4:17 pm

Burngate wrote:such as interference spikes
I'm curious as to what may cause that? Because all I have on my board right now is a button to short GPIO 5 and 6, and then the one I'm working on(which will be an off button)

User avatar
Burngate
Posts: 6313
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Internal pull up/down resistors

Mon Dec 28, 2015 5:55 pm

An engineer's view of electronics is that electricity only travels through wires, just as a plumber's view is that water only travels through pipes.
However, in the real world, water always finds a way to escape and ruin your Persian carpet, and electricity does the same.

Whenever something switches on or off, the change in current causes an electromagnetic wave to propagate from its wires. Any wire near by will pick that up, and the result is a spike in the signal on that wire - essentially that's how radio works.
Since there's always a lot of things around, switching on and off, our world is full of electromagnetic noise, which may (or may not) cause you problems.

User avatar
karrika
Posts: 1125
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Internal pull up/down resistors

Tue Dec 29, 2015 8:31 am

The spikes can be really big. I was working with MRI a long time ago and we had a very friendly nurse that always wanted the old patients to feel well during the scan. So she walked in her nylons and touched the patient sending in some 10kV spike that ruined the image. It took me a long time to spot the cause of the error. Finally we asked the nurse to dress in cotton and the problem went away.

Return to “Beginners”