Go Down

Topic: Arduino Analog inputs not operating correctly when usb cable unplugged (Read 488 times) previous topic - next topic

mmenne1

I have an arduino uno with a sparkfun proto shield kit.  I am using the analog inputs for pushbutton capture.  Pushbuttons trigger LEDS connected to digital outputs.  Project works fine with the USB cable connected.  After removing the USB cable, the pushbuttons seem to trigger multiple lights randomly.  Any ideas?

PaulS

Quote
I am using the analog inputs for pushbutton capture.

Why? Switches are digital devices. They are either on or off.

Quote
After removing the USB cable, the pushbuttons seem to trigger multiple lights randomly.  Any ideas?

First thing I'd want to do is look at your code. Second thing I'd want to do is look at your alternate power supply. Hopefully, it's not a dinky 9V battery. Third thing I'd want to do is look at a schematic of your wiring.

johnnyonthespot

What's so funny about a 9volt battery? :)

My bet is that the answer lies within your schematic/wiring...

James C4S


What's so funny about a 9volt battery? :)

It sucks for powering anything but very low current devices.


After removing the USB cable, the pushbuttons seem to trigger multiple lights randomly.  Any ideas?

How are you buttons wired?  Are you using resistors to pull-up or pull-down the INPUT pin when the button is pressed?  Elaborate here and, as Paul suggests, post your code.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Go Up