2
\$\begingroup\$

I'm using an Arduino Micro for my project.

I'm planning on using two switches as digital inputs. One is for an override switch and a setting switch, but their functions aren't particularly important.

My question is this: is there an issue in using switches? There may be times when the switch is on for long periods of time. I was planning on using the built in pull-ups on the imputs, but I don't want to cause any overheating or issues.

Essentially all of the examples I've seen are with pushbutton momentaries that act as a toggle through software that are only pressed for a fraction of a second at a time, so I didn't know if the lack of examples was indicative of issues with regular switches.

\$\endgroup\$
5
  • \$\begingroup\$ What are the electrical specs of the input? \$\endgroup\$ Jun 11, 2013 at 2:15
  • \$\begingroup\$ The Micro works on 5V logic. The ATmega32u4 datasheet lists internal pull-ups between 20 and 50 kOhms. I would be connecting the pin to the switch on one side, and bringing it low by connecting to ground. \$\endgroup\$
    – tehsusenoh
    Jun 11, 2013 at 2:25
  • \$\begingroup\$ The Arduino is not a micro. It is a circuit board with an Atmel Micro on it. \$\endgroup\$ Jun 11, 2013 at 9:01
  • 1
    \$\begingroup\$ @ConnorWolf: arduino.cc/en/Main/ArduinoBoardMicro \$\endgroup\$ Jun 11, 2013 at 19:42
  • \$\begingroup\$ @IgnacioVazquez-Abrams - Argh, Derp. That's a stupid name. Are they trying for a namespace collision? They shouldn't intentionally name their stuff so confusingly. \$\endgroup\$ Jun 11, 2013 at 20:26

1 Answer 1

2
\$\begingroup\$

The ATmega32U4 datasheet recommends not connecting (unused) pins directly to ground in case the pin gets configured as an output. VIL is defined as approximately 0.2VCC maximum, which with a pull-up of 20k means a pull-down of no more than about 4k7. With 5V this means approximately 200uA at most will be consumed by each switch when held on. As long as your PSU can accommodate all switches being on, there should be no problem with this configuration:

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
5
  • \$\begingroup\$ Why don't I see similar schematics with that extra resistor elsewhere? Here's an official Arduino page about using an internal pull-up. Not to sound condescending; I'm just curious. \$\endgroup\$
    – tehsusenoh
    Jun 11, 2013 at 2:49
  • \$\begingroup\$ If you're absolutely, positively, 100% certain that the pin can never be configured as an output then you can forgo the pull-down. But do note that power usage will go up a bit as a result. \$\endgroup\$ Jun 11, 2013 at 2:50
  • \$\begingroup\$ Okay. By default, the Arduino sets all pins as inputs, and I'll be manually switching them back in my code (not the ones used for inputs of course). This thing will be powered through the USB header, and the polyfuse on the board is 500mA. Is that too little? I mean you were talking in uA, so I can't imagine that's too small. \$\endgroup\$
    – tehsusenoh
    Jun 11, 2013 at 2:55
  • \$\begingroup\$ I can't see it being a problem either. \$\endgroup\$ Jun 11, 2013 at 2:57
  • \$\begingroup\$ Okay, thanks for your help! Love CircuitLab too. Didn't know you could embed them into StackExchange. \$\endgroup\$
    – tehsusenoh
    Jun 11, 2013 at 3:01

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.