Hi, I have an Uno R2 that I am using. It works fine when connected to the computer, but if I use a 9V battery and the bayonet plug, the code does not function. I do have a power light on on the board, however.
Am I missing something?
Thanks.
Hi, I have an Uno R2 that I am using. It works fine when connected to the computer, but if I use a 9V battery and the bayonet plug, the code does not function. I do have a power light on on the board, however.
Am I missing something?
Thanks.
Are you sure the battery has juice? Might be enough to light the LED, but not much else.
Put a meter on the 5V header, see what has.
4.99 volts on the board. The program is a simple test program that oscillates a servo arm when a button is pressed. When I attach the power, the servo initializes and resets the arm position, so I know it has power. However, when the button is pressed, nothing.
It works just as expected when connected via the usb...
Can't offer anymore without a schematic of whats connected and your code.
chiliman77:
4.99 volts on the board. The program is a simple test program that oscillates a servo arm when a button is pressed. When I attach the power, the servo initializes and resets the arm position, so I know it has power. However, when the button is pressed, nothing.It works just as expected when connected via the usb...
It's been shown in the past by lots of people that those small 9 volt batteries just cannot handle the current requirements that a servo demands. Your lucky the USB can supply enough current (500ma max limited by fuse) to work the servo, but those wimpy smoke alarm 9vdc batteries just don't cut it for powering servos. You need an independent 5vdc voltage source to power the servo, like 4 AA cells with the ground wired to the arduino ground.
Lefty
Ok, thanks. I didn't expect one small servo to draw that much, so thought I was pretty safe with my example code. So, I just changed a button to blink an LED and it worked fine with the 9V battery.
I appreciate the help.