3
\$\begingroup\$

I can't seem to find decent information on this topic as all articles only explain general concepts of pull-ups and pull-downs or only cover pull-ups in greater depth.

I understand the general concept of pull-up/pull-down resistors. I understand the working of a pull-up resistor and how to calculate its value. It's the concept of voltage drops considered when calculating R for a pull-down resistor that confuses me.

enter image description here

I will start with a pull-up (ignoring the 100 Ohm resistor):

  1. Switch open: digital input acts as a current sink in a HIGH state. It has a leakage current of ~20uA and Vhigh(min) = 2V. Therefore, the circuit simplifies to +5V -> 10k resistor -> GND.

Rmax = (5.0 - 2.0)/(20*10^-6) = 150k

So with a switch closed and R = 150k, we will have a V = 2V at the junction, which is the minimum voltage required to register as logic HIGH. By picking a smaller resistor value we can ensure the voltage drop across R is smaller so the voltage at the junction is closer to +5V. For example, a 10k resistor would only have a voltage drop of 0.2V, leaving us with 4.8V at the junction when the switch is open.

  1. Switch closed: digital input acts as a current source in a LOW state. That current is pulled straight to ground. So we can simplify this to two separate circuits: Vin -> GND and +5V -> 150k -> GND.

So essentially the pull-up resistor value has to be high enough to prevent a short circuit when the switch is open and low enough not to cause a high enough voltage drop.

Now, I am failing to come up with same logical conclusions when applying the same method for the pull-down (again, ignoring the 100 Ohm resistor):

  1. Switch open: digital input as a current source in a LOW state. It has a leakage current of 400uA and Vlow(max) = 0.8V. How do I use this information?

In my eyes I see it like this: The input is connected directly to GND, the drop across R will always be 5V no matter what, giving us exactly 0V.

  1. Switch closed: most of current bypasses R, thus a large amount of current at 5V is going straight into input (bad thing?).

So why do people always talk about voltage drops across R when it comes to pull-downs? It doesn't make any sense to me, it's been bugging me for a while now, any help is greatly appreciated!

\$\endgroup\$
0

3 Answers 3

2
\$\begingroup\$

The pulldown is just like the pullup. In both cases we are concerned with the situation with the switch open, since the resistor doesn't enter into it otherwise (except to prevent shorting the supply, as you say).

In the case of the pullup you have an input which is desired to be (say) at 2.0V and is sinking a current of 20uA. The current flows through the resistor. So the maximum value is (5V-2V)/0.02mA = 150K.

In the case of the pulldown you have an input which is desired to be (say) at 800mV and is sourcing a current of 400uA. That current flows through the resistor. So by Ohm's law the maximum resistor is 0.8V/0.4mA = 2K.

schematic

simulate this circuit – Schematic created using CircuitLab

In reality we would likely use 2.4V and 0.4V for the voltages to give 400mV noise immunity (LSTTL levels)- rather than zero noise immunity- in a real design, so the resistors would be 130K/1K and 130K is too high impedance and invites EMI to enter so more likely it would be something like 10K or 4.7K and 1K.

\$\endgroup\$
4
  • \$\begingroup\$ What I don't get is why R1 matters at all in your circuit. If there is a 400 uA current flowing, that means there has to be a higher potential at the point from where it's flowing. That's basically the same as having a single resistor in series with a battery. Hence the voltage drop across the resistor will always be the same as that potential, am I wrong? \$\endgroup\$ Mar 15, 2018 at 11:16
  • 1
    \$\begingroup\$ Wait, I1 and I2 are current sources, not voltage sources, correct? Meaning the current is fixed, the voltage varies, am I right? \$\endgroup\$ Mar 15, 2018 at 11:20
  • 2
    \$\begingroup\$ @Hypomania Yes, that's exactly what happens. Those are current sources, they either sink or source and V across the resistor is always I*R. In an ideal current source, current remains constant regardless of the voltage across it. \$\endgroup\$
    – Big6
    Mar 15, 2018 at 11:27
  • \$\begingroup\$ That makes everything clear now, I was assuming the leakage current was sourced from a constant voltage source :) Thanks you! \$\endgroup\$ Mar 15, 2018 at 11:30
1
\$\begingroup\$

It depends on the load that the digital input pin presents. Generally we use as large a resistor as possible that meets the requirements of the digital input pin.

If the digital input is CMOS, so needs nA, then a 1meg, even a 10meg resistor will be OK for either pullup or pulldown, though lower are acceptable.

If it's TTL, then no current is actually needed to be sourced into the pin, the TTL input sources up to 400uA anyway. However, you typically see 2.2k to 10k values for pullups.

We generally avoid pulldowns with TTL, as they have to sink that 400uA down to 0.8v to make a valid '0' level, which needs 2k or lower value resistor.

Once you get down to 2k and lower, then the current the resistor takes may start to get to be a significant part of your power budget, troubling if you are running on batteries. If you're using TTL, then you're probably not running on batteries.

\$\endgroup\$
3
  • \$\begingroup\$ Thank you, I appreciate your answer. I would however like to understand how these values are derived using voltage drops and currents flowing through the resistors, it's not easy for me just to just accept the value. I don't understand what values of pull-downs depend on or how they actually work in the first place. I know what they are supposed to be doing, I don't see how they do it. \$\endgroup\$ Mar 15, 2018 at 10:28
  • \$\begingroup\$ what about as they have to sink that 400uA down to 0.8v to make a valid '0' level, which needs 2k or lower value resistor. don't you understand? I've spelt out the input specifications for TTL to work propoerly, and then there's Ohms Law. \$\endgroup\$
    – Neil_UK
    Mar 15, 2018 at 13:31
  • \$\begingroup\$ What I was doing wrong is assuming that the leakage current was being sinked/sourced from a current voltage source so my maths wasn't adding up as I thought the voltage drop had always been the same across the resistor. I got it now, thank you for your reply again :) \$\endgroup\$ Mar 15, 2018 at 17:22
1
\$\begingroup\$

The same principle applies to the pull-down. If the leakage current is 400uA, it means that with the switch open, the voltage across the pull-down will be 400uA*\$R_{pulldown}\$. You need to ensure that in that scenario, 400uA*\$R_{pulldown}<0.8V\$ in order to guarantee that the digitial input reads it a '0' (that maximum it'll read as a logic zero is 0.8V).

This link should answer your question; it explains the selection of pullup and pulldowns based on the leakage and I*R drops:

http://www.ti.com/lit/an/slva485/slva485.pdf

Add: This is the leakage current flow when the switch is open for the pull-down case. Need to keep \$I_LR<.8V\$, that'll give you your max R value. Actually, the 100 Ohm resistor plays a role but it's so small compared to typical values for pullups/pulldowns (in kOhms) that it's not gonna change the result significantly.

enter image description here

\$\endgroup\$
7
  • \$\begingroup\$ But that's what confuses me, won't the voltage drop always be 5V in such case? As we have Vin -> Rpulldown -> GND. \$\endgroup\$ Mar 15, 2018 at 10:48
  • \$\begingroup\$ @Hypomania in the pull down case, when the switch is open, 5V is disconnected from the pull down. You have a path from the digital input to ground through the pull down, 5V is out of the picture. Your first figure shows it. \$\endgroup\$
    – Big6
    Mar 15, 2018 at 10:53
  • \$\begingroup\$ Yes, but where does the current come from? There is leakage current going from the input to GND through the resistor, doesn't that mean Vin has to be at some voltage potential? \$\endgroup\$ Mar 15, 2018 at 10:55
  • \$\begingroup\$ @Hypomania That's what I am saying in my answer. The leakage current, for the case of the pull down, creates a voltage drop across R. If that voltage drop is too high (which corresponds to a high R value), V=IR) then, the input may not be read as a logic 0 (<0.8Vdc). See edited \$\endgroup\$
    – Big6
    Mar 15, 2018 at 11:04
  • \$\begingroup\$ Okay, I see what you mean. But why does the voltage drop matter? Is it not gonna be the same every time? I see it as a single resistor connected in series with a battery.. \$\endgroup\$ Mar 15, 2018 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.