It’s “simple” tasks like these that make me realize I remember much, much less from the 6 weeks of circuit design I took in college than I wish.
OK, all I’m trying to do is get 5 switches wired up to the digital inputs on an Arduino Uno. I’ve tested these switches and they’re NO. The issue is that when I press a button, it resets the Arduino.
Here’s how I have them wired up. Ignore the multiplexer, I just needed something to represent the inputs.
I’ll cop to not understanding at all what the 10K ohm resistor is bringing to the party here. It seems like when the button is pressed the current is just going to follow the path of least resistance into the input, which could very well be why it’s rebooting. But this seems to be how the internet says to wire them.
I don’t know the answer to your question but I suspect it doesn’t lie in the circuitry you have shown here.
The 10K resistor is a pulldown resistor. It keeps the inputs low when the switches are open. When a switch is pressed, the corresponding input goes high. Without the 10 K resistor, when a switch was pressed it would short the supply to ground and the input would stay low.
I’ll admit to acting like I know more about electronics than i really do, but doesn’t this diagram show that all of your switches are wired together on the ground side? When you press SW1, what’s preventing the current from flowing to all five inputs in parallel?
I think you have more than one problem here. In addition to your reset issue, the way that the circuit is currently drawn, if none of the switches are pressed, then all of the inputs will be pulled down to 0 volts.However, if any of the switches are pressed, then ALL of the inputs will be pulled high.
You need to electrically separate the switches and have a pull-down resistor for each input.
Are all of the pins configured as inputs? If any of the five are set as outputs, you could plausibly see a reset. Also, as ecg notes, the circuit doesn’t work–the pins are all connected together. So pressing any of the 5 buttons would cause a problem, even if it were some other pin that was misconfigured.
Agree. But I am a bigger fan of pull-up resistors vs. pull-down resistors. Reason being: with a pull-down resistor, any short to ground - accidentally, intentionally, or due to a failure - will result in the power supply being shorted. Not good. A pull-up resistor offers better fail-safe protection. (Of course, there is a difference in the polarity of the signal. But hopefully the firmware can be programmed to accept either.)
Thanks for the guidance everyone! Just to close the loop, aside from the problems pointed out above, the small prototyping PCB that I bought at MicroCenter to use as a common +5V and GND rail wasn’t just a bunch of unconnected holes, but the rows were actually internally connected (ironically for the specific purpose I wanted.) I just assumed that since I couldn’t see any printed connections that there wasn’t anything going on in the internal layers… very dumb of me.
Anyway, the result of that was that my resistor was effectively doing nothing, which is why it measured 0 ohms when installed. I moved the connections to different rows, added a resistor for each button, and now I’m back in business.