View Single Post
  #6   Report Post  
 
Posts: n/a
Default Understanding pull up resistors

I want to thank everyone for the excellent explanations. I even
printed some of them out and added them to my notebook. I had not
thought of building and testing the circuit with parts left out and
that really helped me 'get' it.

The key thing was thinking of the other voltages as relative to or as
one poster put it (W.ith R.espectT.o) ground. I also tried the
circuit out using a TTL gate chip and I get it now. It seems like I
have to see things work in this fasion to understand them. Thank
you, Thank you, Thank you! This has really been bugging me along with
the old radio mentioned in another thread.


On Sun, 19 Oct 2003 09:47:46 GMT, Jeff Wiseman
wrote:

Just a few comments below:


wrote:
stuff deleted
WHY OH WHY doesn't R1 come into the picture with the switch open. It



That's the whole issue! If it wasn't there, the potential at the device pin would remain close to 0volts all the time even with the switch open. With the R1 there, it "pulls" the voltage up to 3.5volts when the switch is open (see below)


is hooked to Vcc. Is the voltage flowing from the device pin through
LED1 and R2 to ground.



In this case, the internal resistance of the device will be very large with respect to the R1&R2 values therefore any effect of the device itself on the circuit in question is negligible. For all intents and purposes of this discussion, there is no current going into or out of the device.


why doesn't it flow from Vcc to ground anymore.



This is incorrect. It *IS* flowing from Vcc through R1, then the LED, Then R2 to ground. The fact that there IS current flowing through these devices is what forces the potential at the device pin to 3.5volts relative to gnd (or -1.5volts relative to Vcc--we typically measure w.r.t. gnd though). resistances in series is refered to as a "voltage divider" for this very reason.


This is where the whole concept of a "Pull up resistor" on a input pin
just totally looses me. I know it works, I just don't get how it
works. Can someone here express it in different words or something.



Point (A): Again, assume that the internal resistances of the device are very large. With this being the case, for this discussion you can view your circuit as existing without the device. I.e., your device pin is only a test point now.


It takes the path of least resistance because the switch is like a
zero ohm resistor.



Point (B): Right, in other words when your switch is CLOSED it is as though the LED and R2 have been "removed" since their resistance is many times higher than that of the closed switch, ie. nearly all of the current bypasses them. Remember this when reading my next comment below:


I just dont understand why it goes to zero at my device pin.



Considering points (A) and (B) above, simply redraw your circuit with the switch closed and the things that can't affect the circuit removed and see what you get. It will now look like this:

VCC
|
|
\
/ R1
\
/
|
|
|--------------------------------------Test point
|
|
+
|
| SW1
+
|
|
|
|
|
GND

With SW1 closed bypassing the LED and R2, it is as though they aren't there. Since the device's internal resistance is extrememly high, it is as though IT isn't there. In fact, with the switch closed, the test point will be a 0volts regardless of whether or not R1 even exists (i.e., SW1 looks like a piece of wire connecting the device pin directly to ground). As you can see, in the above circuit R1 has no effect at all. It could be removed and the test point still sits at 0 volts w.r.t. gnd because it is locked there by the closed switch.

If you open the switch, it then appears as though R2 and the LED are returned to the circuit and the switch now has no effect and is removed thusly:

VCC
|
|
\
/ R1
\
/
|
|
|-------------------------------------- Test Point
|
|
V
_ LED1
|
\
/ R2
\
/
|
|
GND


As you can see now, if R1 were not present the voltage at the test point would still be at 0volts since the LED and R2 would be acting like a very poor switch (remember the internal resistance of the device is very high relative to the LED/R2 components). R1 is necessary to provide a path for current to flow to the LED/R2 and then to gnd. The more you lower the value of R1, the greater the current through it and R2/LED, the greater the voltage drop across R2/LED and thus the higher the voltage at the test point. Thus, the presence of R1 in the circuit when the switch is OPEN (and only then), has the effect of "pulling" the voltage at the test point "up", otherwise it would just remain at 0.

Now if the device's internal resistances were much lower, then it would get much more complicated but that is a totally different issue :-)

Hope this procides another perspective on it for you. Keep at it, it'll all come naturally soon enough.

- Jeff