Pages: 1 [2] 3   Go Down
Author Topic: Trying to understand pull-up resistors  (Read 2398 times)
0 Members and 1 Guest are viewing this topic.
Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1658
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

My 2 Cents...  markT gave an excellent description of how 1-wire works...

 There are basically 3 states in TTL logic.  "High", "Low", and a word I like "Uncommitted".  We commonly call that "floating", and in some cases,  it is used on purpose with TTL devices that claim they are "tri-state", like a 74125 for example.

When you have devices that can only create a connection to GND (switches, transistors, whatever) , a 5V "high" logic level signal does not magically appear in the absence of GND or "low" state.  You can assume it will be low... but a nearby finger can make it be otherwise.

So, back to the transistor idea... if you have a ttl input attached to TP, without R2 to pull the input signal pin HIGH, no amount of turning "on" or "off" either transistor will guarantee that signal at TP will go to logic "1" or "HIGH".  Adding R2 will PULL UP the voltage on TP to hold the signal "HIGH" or at "1" unless either or both transistors turn on, pulling the signal... in a stronger  manner.. closer to ground... changing the logic state at TP from Logic 1 "high" to Logic 0 "low".

The PULLUP will eliminate an undesired "3rd" state.



* NOR.JPG (32.46 KB, 611x384 - viewed 11 times.)
« Last Edit: November 08, 2012, 04:12:55 pm by pwillard » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'll need to sit down with this all later, but MarkT, your advice/explanation to ignore current for this discussion has been extremely helpful. I didn't realize that in this context the current wasn't really important, and thinking about where current was flowing was definitely confusing the hell out of me.

So in general then (at least in situations as simple as the one we're examining), is it true that if part of a circuit is connected to more than 1, what I'll call terminator (ex: +5v, GND), measuring voltage at that part will always reflect the connection to the lowest impedance terminator?

Andy
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26495
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Something that often surprises is the case of a 1 kohm resistor with one end connected to, say, 5V and the other end to one side of an open switch whose other side is connected to ground.
What is the voltage across the open switch?
And if the resistor is 1 Mohm?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Something that often surprises is the case of a 1 kohm resistor with one end connected to, say, 5V and the other end to one side of an open switch whose other side is connected to ground.
What is the voltage across the open switch?
5V
And if the resistor is 1 Mohm?
Still 5V
Lefty

Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Still 5V

It depends on what this switch is.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Still 5V

It depends on what this switch is.


Your trying too hard to be helpful, once again, and failing once again.

Lefty
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Something that often surprises is the case of a 1 kohm resistor with one end connected to, say, 5V and the other end to one side of an open switch whose other side is connected to ground.
What is the voltage across the open switch?
And if the resistor is 1 Mohm?

Another "I know nothing" question: By "across the open switch" do you mean measuring between each side of the open switch? Essentially closing the switch with the tester?

Andy
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 34559
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
do you mean measuring between each side of the open switch
Yes.

Quote
Essentially closing the switch with the tester?
No the tester is a very high impedance so it does not close the switch.

Note to dhenry :-  That is unless you have the meter set on current which you should not be doing here.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26495
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Essentially closing the switch with the tester?
Yes, but the impedance of the voltmeter is (should be) extremely high.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

0
Offline Offline
Shannon Member
****
Karma: 215
Posts: 12486
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well that's the point - the tester isn't ideal, its not a completely open circuit (which theoretically an ideal voltmeter should be).   Similarly real ammeters have some resistance (ideally they would be 0 ohms).
Logged

[ I won't respond to messages, use the forum please ]

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 634
Posts: 34559
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Similarly real ammeters have some resistance (ideally they would be 0 ohms).
Yes but a real ammeter will look like a switch and behave just like a switch.
Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 159
Posts: 2916
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'll need to sit down with this all later, but MarkT, your advice/explanation to ignore current for this discussion has been extremely helpful. I didn't realize that in this context the current wasn't really important, and thinking about where current was flowing was definitely confusing the hell out of me.

So in general then (at least in situations as simple as the one we're examining), is it true that if part of a circuit is connected to more than 1, what I'll call terminator (ex: +5v, GND), measuring voltage at that part will always reflect the connection to the lowest impedance terminator?

Andy

In the ckt being discussed in post #7, the pullup R is in there to bias the "voltage" on the 74HC04 input, not to drive
current into it. The input-impedance of an 'HC input pin is very high, so little current will flow into it.

When the switch is open, pin 1 -> Vcc = logic 1 to the gate. Essentially no current flows through R1 since the only
path for it is into the 74HC04 = high-impedance.

When the switch is closed, pin 1 -> 0V [ground potential] = logic 0 to the gate. Now, current will flow though R1
and to ground, of value I = Vcc/R1.

You're just using the pullup and a simple switch to develop the input voltage to the 74HC04, Vcc in one case and 0V
in the other. You could do the same thing with no pullup and a more complicated, double-throw switch by wiring one
side of the switch to Vcc and the other side to ground.

http://www.autolumination.com/images/auto_bulbs/switch_spdt_diagram_wm.jpg
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks again to everyone who replied. I'm still shaky on most of my basics but you all have definitely helped me get a handle on precisely how/why a pull-up resistor works.

Andy
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

One more question to tack on here.

I just got a second ds18b20 and put it on a long-ish run to a spot outdoors. It's connected to the same board as my existing indoor sensor.

Powered by USB, both sensors work. Powered by my 9v 650ma wall wart, they don't. I think I need to get a stronger pull-up resistor (1k vs. 4.6k) to solve this problem, but I want to make sure I understand why that's the case. I'm pretty sure I don't.

I believe that my USB 3.0 port provides less voltage, but more ma than the wall wart. I'm using this as a clue, but maybe I'm using it incorrectly:

I read elsewhere that you need a stronger pull up on longer runs because of cable capacitance. I don't know that I comprehend the impact. Here's a try: the increased capacitance keeps the cable from pulling high, and using a stronger pull-up resistor allows more current down the cable (there I go talking current again), which somehow quiesces the impact of the increase capacitance.

Perhaps?

Thanks. Still trying to learn stuff.
Andy
Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 159
Posts: 2916
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Basically, what you're looking at is similar to first-order capacitor charging, although strictly-speaking,
the capacitance is distributed over the cable. Voltage still pulls high [eventually], but takes longer for
more capacitance, proportional to R*C.

http://www.ehobbycorner.com/pages/tut_capacitors.html

http://www.google.com/search?q=capacitor+charging&hl=en&safe=off&tbo=u&tbm=isch&biw=1154&bih=870&sei=Fh2jUMrtAozmiwK5g4H4Bg

By a stronger pullup, you're wanting to mean lower resistance value.
Logged

Pages: 1 [2] 3   Go Up
Jump to: