Button causing power surge

I am doing a project where we use a button to control a function except the only problem is whenever the button is pressed the computer that is powering the arduino leaves a message that says the usb is drawing too much power and disables power to it. I was wondering if anyone knew why this is happening thanks.

Because you have wired it up wrong.

Grumpy_Mike:
Because you have wired it up wrong.

Most likely. This is how I would test it, very first test. Disconnect your circuit. Put a continuity tester or ohmmeter between VCC and ground. Hopefully it is not shorted. Press the button. Does it short? If it does, that means you have zero ohms in your circuit between power and ground when it is depressed which you cannot have, ever.

Are you doing a pullup on the button where the pullup is not going through a large value resistor? Test the resistance between the pulled up pin and VCC and make sure it is the value you think it should be. Sometimes it's easy to solder the end of the resistor for the pullup onto the switch and end up with a zero resistance pullup, which works great until you actually press the button. :slight_smile:

Try reading this
http://www.thebox.myzen.co.uk/Tutorial/Inputs.html

I was wondering if anyone knew why this is happening thanks.

Any answer is speculative in the absence of the circuit and the code.