I'm making a little test board with a switch that intend to plug into a popular southern European microcontroller system. Obviously, it's intended to plug into a pin which is configured for input, but I want to protect against the case that I accidentally connect it to an output pin and set it HIGH. What's the difference between the two schematics below?


simulate this circuit – Schematic created using CircuitLab

The left hand version seems more common on Google, but is there a rationale behind this? Is it because closing SW1 will bring the input voltage to zero whereas closing SW2 will bring it to 0.5V (approx). For a digital input, would this effectively matter?


Bringing a digital input to 0.5V will still register as a zero input, but in general you want digital inputs to be close to the rails. Values in the middle of the rail leave both the input transistors on and may cause damage.

  • \$\begingroup\$ 0.5V is probably a solid "low", but keep in mind that the thresholds are usually asymmetrical. "High" inputs can often be farther from the rail than "low". For one of my recent projects, I switched from active-low to active-high buttons for exactly that reason, and because I had some diode-or's that dropped about 0.7V. But this asymmetry is not universally true. \$\endgroup\$ – AaronD Mar 6 '15 at 18:08

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.