Go Down

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

#### pwillard

#15
##### Nov 08, 2012, 10:07 pmLast 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

#16
##### Nov 08, 2012, 10:35 pm
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

#17
##### Nov 08, 2012, 10:48 pm
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.
I speak for myself, not Arduino.

#### retrolefty

#18
##### Nov 09, 2012, 01:40 am

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

#19
##### Nov 09, 2012, 01:48 am
Quote
Still 5V

It depends on what this switch is.

#### retrolefty

#20
##### Nov 09, 2012, 01:52 am

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

#21
##### Nov 09, 2012, 09:47 pm

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

#22
##### Nov 09, 2012, 09:50 pm
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

#23
##### Nov 09, 2012, 09:52 pm
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.
I speak for myself, not Arduino.

#### MarkT

#24
##### Nov 09, 2012, 09:52 pm
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 will NOT respond to personal messages, I WILL delete them, use the forum please ]

#### Grumpy_Mike

#25
##### Nov 09, 2012, 10:02 pm
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

#26
##### Nov 09, 2012, 10:59 pm
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

#27
##### Nov 11, 2012, 01:03 am
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

#28
##### Nov 14, 2012, 04:07 am
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

#29
##### Nov 14, 2012, 05:26 am
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