2

When using a digital pin as input, one has the option of using the internal arduino resistor, which is connected to VCC; that is setting the digital pin as INPUT_PULLUP, and then the pin reads HIGH. Does this uses electricity?.

I mean the resistor is connected directly to VCC and I presume electricity is constantly flowing through the system, no?. as oppose to having the pin as just INPUT?

2

3 Answers 3

2

Only the leakage current on the input itself is constantly consumed if there is no external connection. This is usually much less than the waste caused by having the input floating.

If a voltage between 0.8 V and 2 V is applied to the input for a prolonged period of time, this situation becomes critical and should not be ignored, especially with higher bit count and more dense packages [...]. For example, if an 18-bit transceiver has 36 I/O pins floating at the threshold, the current from VCC can be as high as 150 mA to 200 mA.

1
  • There is not really a load applied to the pin with the INPUT_PULLUP. I am using only for a push button, for a counter.
    – Camilo
    Commented Oct 6, 2015 at 4:35
2

The pullups have a value between 20k and 50kOhm. If the input is connected to ground (button pressed), between 0.1mA and 0.25mA is flowing through the resistor. So bare anything.

2
  • What happens if the switch is open? Does it use power?
    – Basj
    Commented Nov 14, 2019 at 17:39
  • @Basj basically; no current will go though the resistor when the switch is open. Though I found out there is a tiny amount (1 µA max) of leakage current
    – Gerben
    Commented Nov 15, 2019 at 16:18
1

See Deviation of power consumption between datasheet and real world? - there we established that leaving the pins input consumed considerably more power than input_pullup. That was with the pins not connected to anything.

3
  • Is there a typo here or am I reading wrong? You said leaving pins as INPUT is more than INPUT_PULLUP, but your experiments show 0.35 µA for INPUT and 1.25 µA for INPUT_PULLUP
    – rfii
    Commented Mar 26, 2021 at 15:42
  • 1
    @rfii Yes, I did say that, and indeed it contradicts what I wrote. However as a general principle you are not supposed to leave chip inputs "floating", and configuring for input, with nothing connected, does that. You would probably get variable results depending on what noise was present near the inputs. I should probably re-measure the examples I gave on the quoted page.
    – Nick Gammon
    Commented Mar 26, 2021 at 22:51
  • Thanks your website is very helpful in how it tests everything so orderly
    – rfii
    Commented Mar 27, 2021 at 4:24

Your Answer

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

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