When I read articles/tutorials about the Arduino Uno, the potentiometer and button always get power from the 5 V pin instead of from digital pins.

May I know whether the two components above can be powered by digital pins?

What is the situation that the components must only get power from 5 V pin instead of digital pins?

  • 1
    First thing Digital I/Os are designed for operation not giving power to other devices. digital I/Os Fan out and source current is low(40mA) it's may not sufficient for all devices. As per your question you can power button and some low power devices making that digital pin OUTPUT and HIGH pinMode (pin, OUTPUT) and digitalWrite (pin, HIGH) Jun 29 '17 at 4:38

You can likely use an I/O pin as an output to "power" fairly high-impedance devices such as pullup resistors for buttons, or even potentiometers of moderate to high total resistance.

A reason you might wish to do so would to be able to stop the device from draining power while the entire system is in a low-power sleep mode, or to otherwise disable it beyond merely ignoring its input.

However, it's worth noting that powering an analog device such as a potentiometer from an I/O pin is likely to inject noise and full scale voltage uncertainty into the signal so derived, as the output voltage under load may be neither the same as the supply rail, not "quiet".

And, of course, you must not attempt to use an I/O pin to power lower-impedance (aka more "power hungry") loads via an output pin. Generally, active devices should not be powered in this way - especially ones such as radio transmitters, other microcontrollers or complex logic functions, ultrasonic transmitters, and definitely not motors, relays, or solenoids.

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.