0
\$\begingroup\$

yesterday I asked a question about pull-ups and pull-downs and resistance in an input pin, but I feel that the question that invaded me today is different from my yesterday's post so this is why I'm asking a new question instead of just editing yesterday's question.

Maybe my question is similar to other questions in this site (like this: Why does a pull down resistor eliminate floating input , but I feel that they are not exactly answering what I want to know.

Let's start with the question, we have this:

enter image description here

I understand that, if the pull-down didn't exist, we would have a floating input in our microcontroller pin, because some interferences could give a logic '1' to our microcontroller. But what I don't understand is how the pull-down does to always get a logical 0 on that pin (when the button is not pressed). I mean: supose that interferences are giving 4V (logical 1), for example because we touch it with the finger. Here:

enter image description here

So what I imagine that is happening is this:

enter image description here

This is why I'm not able to understand why pull-down is avoiding a voltage on the microcontroller pin due to interference.

I want to add this question too because I don't understand very well this concept: Why is it considered to be a weak 0 in a pull-down and not a strong 0?

\$\endgroup\$
0

3 Answers 3

6
\$\begingroup\$

If you don't have a pull-down, and you push the button to give the MCU 4V which it understands as logic one, everything is fine.

Now, as the MCU input is a CMOS input, it has extremely high impedance, assume it's infinite, and assume there is some parasitic capacitance that is now charged to 4V as well.

When you stop pushing the button, the MCU input is disconnected from 4V supply, but since there is nothing to discharge that 4V from the parasitic capacitance, it will stay at 4V forever, and will never read as logic 0, no matter how long you wait.

When you have the pull-down resistor there, as soon as you stop pushing the button, it will be a DC path to discharge the 4V, so the voltage will end up to 0V and the MCU is able to read that as logic 0.

The pull-down resistor has to be low enough in value, that any interference that might be there, will not be able to make the voltage rise above logic 1 threshold.

So if you pick a too high value as the pull-down resistor, like 100 Megaohms, it too high to prevent voltage fluctuations if you touch the pin with a finger. If you pick too low value as the pull-down resistor, like 1 ohm, you are just wasting power with too high current, and the pushbutton may not be rated for it.

It is considered a weak pull-down because it is not strong. It's weak in the sense that it allows the pushbutton to control the voltage without too much current, and it's strong enough to keep the voltage at 0V when pushbutton is not pushed. For argument's sake assume it is 10 kilo-ohms.

\$\endgroup\$
3
  • \$\begingroup\$ I would like to focus on finger touching the pin: You touch it and you give 4V to it, why wouldn't the MCU pin recieve this voltage? I mean, where is the difference between using 4V power suply (button pressed) and touching the pin and giving 4V (button not pressed)? How is the pull-down avoiding 4V in the MCU pin in a finger touch? And if you can also add some clarification to my last line in the original question I would be very thankful \$\endgroup\$
    – isma
    Jul 1, 2020 at 12:23
  • \$\begingroup\$ Your finger is not an ideal power supply. If you measure your finger resistance with a multimeter, what do you get? 100 kilo-ohms? 1 Megaohms? 10 Megaohms? If the pull-down resistor is 10k ohms, it is much more stronger impedance pulling the voltage to 0V, than the impedance of your finger trying to pull the voltage to 4V. The effect can be that instead of 0.0V the voltage goes to 0.1V and that's still logic 0. But if there is no pull-down at all, your finger has enough impedance to drive 4V into the MCU input pin. \$\endgroup\$
    – Justme
    Jul 1, 2020 at 12:47
  • \$\begingroup\$ Oh, now I have understood this!! Thank you! \$\endgroup\$
    – isma
    Jul 1, 2020 at 12:50
1
\$\begingroup\$

There is a simple rule that comes from Ohm's Law: there is a current -> there is voltage drop (difference). No current - no voltage drop. When signal is high, you obviously have current through the resistor, which means there MUST BE a voltage drop across it. Voltage is not equal on the sides of the resistor. But if you disconnect the switch and you have just a pull-down resistor, there is no power source attached to the pulled down line, thus no current across resistor, thus both sides of the resistor have the same voltage. The only defined voltage is the ground, so the other side will automatically be zero too, preventing floating. I tried to simplify the model for understanding a little

\$\endgroup\$
0
\$\begingroup\$

Think about what voltage is. A voltage source has to supply some power at some potential. A resistor can't supply power or potential as it's not a voltage source.

The voltage across a resistor with zero current flowing in it is zero. Ohms law. As the input has zero current flowing (ok in reality there IS a very tiny current) but zero as near as matters. Zero current in resistor, zero voltage across it.

A weak pull down (a large resistor) may exhibit a small voltage due to current leaking out of the input. A strong pull down will see the same current but generate a smaller voltage.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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