Arduino Forum

Using Arduino => General Electronics => Topic started by: Ashleysmith on Mar 04, 2012, 07:27 pm

Title: Arduino is fine when connected to computer but not when on battery
Post by: Ashleysmith on Mar 04, 2012, 07:27 pm
As title,

When the external battery (9v) is connected the controller doesn't function and the servo goes to the right... However when it's connected to the computer directly everything works fine
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Dan_ce on Mar 04, 2012, 07:34 pm
Too much current draw for the battery to cope with but the computer is able to? Get a wall adaptor?
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Techone on Mar 04, 2012, 07:35 pm
The 9 V battery is too weak. ( current wise ). Try a wall AC adapter rated about 9 V at 500 mA at least and see what happen.
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Ashleysmith on Mar 04, 2012, 07:50 pm
Tried that earlier and a similar thing happened but it wasn't as bad, my friend has a similar set up and his works fine
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Dan_ce on Mar 04, 2012, 08:49 pm

Tried that earlier and a similar thing happened but it wasn't as bad, my friend has a similar set up and his works fine


Similar isn't the same as the same, though, right?

Is it a new battery?
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Ashleysmith on Mar 04, 2012, 09:00 pm
true, yes its a brand new battery
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: retrolefty on Mar 04, 2012, 10:23 pm

true, yes its a brand new battery


Well you are fighting the same fight as so many other beginners do when first start trying to use servos. They require an independent DC power source of correct voltage (4.5 to 6vdc) at a current capacity of at least one amp for each servo to be used and this source cannot be reliably supplied from a arduino directly. Some do run one servo OK, if it's a small enough servom from the arduino +5v pin, but it's not a reliable was to power servos.
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Techone on Mar 04, 2012, 10:28 pm
What retrolefty is saying, use two battery. 9 V for the Ardiuno board, and another battery of 4.5 V to 6 V pack for the servo motor. Connect the negative of the battery pack to the Ardiuno gnd, and the plus side to the red wire ( positive )  of the servo.

That might work.
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Ashleysmith on Mar 04, 2012, 10:38 pm
thats the set up i have,

9v into the board and 4.5v connected to the servos...

my problem is, that when i have everything connected to the computer it works fine, but when i run it from the 9v battery it doesnt like it
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Techone on Mar 04, 2012, 10:42 pm
Now, I am lost... 9 V is too week.  Did you have a picture of your setup ( how it is wired ) ?  I would like to see the situation.
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Ashleysmith on Mar 04, 2012, 10:59 pm
this is it running off the computer

http://www.youtube.com/watch?v=68BHYHL9yVw&context=C3ff1949ADOEgsToPDskJ_cmEMIu2Etgj1zkoymeHi
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Techone on Mar 04, 2012, 11:28 pm
Just watch your video. Thank you for showing the situation.

Let see what you got.  A DIY board under the Arduino board, a shield on top of the Ardiuno and the Arduino board. I can see also a battery connected to the DIY board, and I am assuming it power the servo. 

No 1, that is a lot of juices being use. What type of 9 V battery you are using and are you putting into the DC barrel ?  You need at least 300 ma to 500 mA into that Arduino setup. If it is not enought current being provided, the 7805 inside the Arduino will shutdown and place the Arduino chip into reset or the 7805 will be unstable. Here the thing... when a device take a lot of currents, the voltage in is going down, that cause problems.   
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Ashleysmith on Mar 04, 2012, 11:32 pm
its a duracell pluss 9v battery

ill do a video of the exact problem (probably easier to show)
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Techone on Mar 04, 2012, 11:41 pm
Quote
its a duracell pluss 9v battery


A square 9 V battery ? Are you sure ?   :smiley-eek:

Man.. That is no good for your set-up.  Use a 9 V pack --> 6 X AA or 6 X C.  A 9 V square battery don't have enough juice in them.

To confirm what I am saying... measured the voltage at the battery when you are connected to your setup. The voltage will be lower than 9 V. If it is going below 6 V... well... your poor ardiuno will not have its breakfast.  ]:)
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Ashleysmith on Mar 04, 2012, 11:45 pm
http://www.youtube.com/watch?v=0UCLCxwy2pA&feature=youtu.be

ah right... my friend is using a 9v square battery and its worked fine, all this set up has to power is the reciever at 3.3v and the board it self
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Techone on Mar 05, 2012, 02:57 am
Fine... what the DVM is saying to you ? Measurment of the voltage of the 9 V battery.

Edit :

Here what I did.   I have an Arduino with just the board and the blink program running.

With power off : 9.39 V  Connect to the board : 8.80 V and going down by the seconds.

What is your ?
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: smeezekitty on Mar 05, 2012, 04:42 am
Just running the board, the type of regulator used wastes tons of power.
I would suggest just putting 3 X AA into the 5v pin.
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Ashleysmith on Mar 05, 2012, 12:45 pm
i thought it was 5.5v output only...

call me stupid (on this occasion you can :-P) but surly its output only and not input? and i would need to earth it too?
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Techone on Mar 05, 2012, 08:31 pm
Quote
but surly its output only and not input? and i would need to earth it too?


The +5 V pin is the input voltage OR output voltage.   Huh ? 

OK...When you connect a external voltage <--- USB or through the barrel, that +5 V is OUTPUT. 

Whith nothing external connected, Well the +5 V is an INPUT. That is when you put a 4.5 V in ( 3 X AA or C or D ). A 4.5 V will work. I try it on a breadboard version.

And of course you must connect the negative to the GND of the Arduino, same of the battery controlling the servo motor.

FYI.  I did some current measurement of a servo motor. I use two type of servo. One normal servo and one for continous turn. The current for a continious is : about 160 mA.  and the normal servo : from 50 mA ( slowest ) to 200 mA ( fastest ) And my Arduino board with a 9 V battery, the current is about 40 mA. <-- That is no Led's, no shields, nothing connected except the control logic of the servo motor.

In your case, I am curious what type of current and voltage measurements ( at the barrel ) when you connect the 9 V battery.
Title: Re: Arduino is fine when connected to computer but not when on battery
Post by: Ashleysmith on Mar 07, 2012, 06:25 pm
Well, I've connected an LED between the CS on the receiver and the GND and it seems to be working now...