Go Down

Topic: Trying to understand pull-up resistors (Read 2797 times) previous topic - next topic

pwillard

#15
Nov 08, 2012, 10:07 pm Last Edit: Nov 08, 2012, 10:12 pm by pwillard Reason: 1
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.


vdavidoff

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

AWOL

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?
"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.

retrolefty


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


dhenry

Quote
Still 5V


It depends on what this switch is.

retrolefty


Quote
Still 5V


It depends on what this switch is.



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

Lefty

vdavidoff


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

Grumpy_Mike

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.

AWOL

Quote
Essentially closing the switch with the tester?

Yes, but the impedance of the voltmeter is (should be) extremely high.
"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.

MarkT

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).
[ I won't respond to messages, use the forum please ]

Grumpy_Mike

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.

oric_dan

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

vdavidoff

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

vdavidoff

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

oric_dan

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.

Go Up