Pages: [1]   Go Down
Author Topic: Arduino Analog inputs not operating correctly when usb cable unplugged  (Read 444 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Detroit, MI
Offline Offline
Full Member
***
Karma: 0
Posts: 117
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What's so funny about a 9volt battery? smiley

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

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6106
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What's so funny about a 9volt battery? smiley
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.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Pages: [1]   Go Up
Jump to: