Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Hawaii00000 on November 06, 2009, 11:01:22 PM

Title: Arduino bot only works on USB power
Post by: Hawaii00000 on November 06, 2009, 11:01:22 PM
I just finished my arduino bot this week and I'm having a problem with the power. Its simply a wall avoiding robot that uses two modified servos and a ping sensor (powered by the arduinos 5v output). I seems to work fine when I plug the USB in for power,but as soon as I use a 9v battery the ping sensor stops working. Everything else works.

my guess is that the sensor automatically shuts off because the arduino regulator isn't doing a good job at regulating the 9v.

Any ideas/solutions?
Title: Re: Arduino bot only works on USB power
Post by: SmAsH on November 07, 2009, 12:35:33 AM
Have you tested the regulator output with and without loads while the 9v is connected?
Title: Re: Arduino bot only works on USB power
Post by: Ro-Bot-X on November 07, 2009, 07:28:26 AM
The Ping sensor doesn't need too much power, but the servos do. The servos probably take whatever it is available and because the sensor does not have enough, it shuts down. Solution: use a 6V battery to power the servos directly and leave the Ping sensor connected to the regulated 5V. Be sure you connect all grounds together.
Title: Re: Arduino bot only works on USB power
Post by: Soeren on November 07, 2009, 11:41:33 AM
Hi,

[...] as soon as I use a 9v battery the ping sensor stops working. Everything else works.

my guess is that the sensor automatically shuts off because the arduino regulator isn't doing a good job at regulating the 9v.

Any ideas/solutions?
The reason it shuts down is likely the inrush surge. an (alkaline) 9V (PP3) has slightly less than half the capacity of an (alkaline) AAA cell! and the internal resistance of the PP3 is much higher (for a slightly used cell, it can be several Ohms). PP3s are just too weenie for anything using serious currents.

Best thing is to use larger cells of course, but you can remedy things a little, by placing a large capacitor over the battery (preferably after the power switch and as close to the load as physical possible).
The lower the ESR of the cap(s) the better, so a handfull of smaller caps will be better than one large with the equivalent capacity.
Title: Re: Arduino bot only works on USB power
Post by: awally88 on November 08, 2009, 07:41:51 PM
How are you connecting the 9V battery to the Arduino? Through the barrel plug? Are you sure that you have the connectors the correct way if you are?
Title: Re: Arduino bot only works on USB power
Post by: SmAsH on November 08, 2009, 11:28:29 PM
If it was the wrong way how could everything else work?
Title: Re: Arduino bot only works on USB power
Post by: Hawaii00000 on November 09, 2009, 02:19:52 AM
Ok so I'll try giving it more amps and if that doesn't work I'll have to put the servos on a different circuit.
Title: Re: Arduino bot only works on USB power
Post by: SmAsH on November 09, 2009, 03:27:46 AM
Wait, whats powering the servos? Regulated or 9v?
Title: Re: Arduino bot only works on USB power
Post by: Hawaii00000 on November 09, 2009, 07:39:28 PM
Regulated
Title: Re: Arduino bot only works on USB power
Post by: SmAsH on November 09, 2009, 08:12:32 PM
That might be why, the servos might be drawing too much current...
Title: Re: Arduino bot only works on USB power
Post by: awally88 on November 09, 2009, 09:03:42 PM
@Smash

I thought that the output wasn't regulated which is why I asked, the regulator in the Arduino switches if its wired in the wrong way I believe. I always generally use my power supply with Arduino so I wasn't sure.


@ Hawaii00000

Can you write a program which just gets a value from the sensor and kill all the code which deals with the servos and see if it works.
Title: Re: Arduino bot only works on USB power
Post by: Hawaii00000 on November 10, 2009, 01:23:16 AM
Ok I finally got it working, but its kinda unpredictable. Sometimes it works, sometimes it doesn't. The arduino does have a home-made shield on it. Could that be cause some kind of noise that messes everything up?
Title: Re: Arduino bot only works on USB power
Post by: SmAsH on November 10, 2009, 01:54:38 AM
Nah, a homemade shield shouldn't screw anything up, unless its shorting something...
It shouldn't cause much noise unless its switching high voltages or motors etc...
Title: Re: Arduino bot only works on USB power
Post by: Soeren on November 10, 2009, 04:44:39 AM
Hi,

Ok I finally got it working, but its kinda unpredictable. Sometimes it works, sometimes it doesn't. The arduino does have a home-made shield on it. Could that be cause some kind of noise that messes everything up?
Did you place a cap or two (in the range 47µ to 470µ) between the output of the regulator and the load(s).
Title: Re: Arduino bot only works on USB power
Post by: Hawaii00000 on November 10, 2009, 05:12:54 PM
Nope none whatsoever.
Title: Re: Arduino bot only works on USB power
Post by: SmAsH on November 11, 2009, 01:10:00 AM
Maybe try placing one on the line close to the load, as close as possible to absorb some of the spikes etc...
Does the regulator get hot at all? when the servos are running, they may be drawing too much current and not leaving any for the ping, maybe consider getting a 6v battery for the servos?
Title: Re: Arduino bot only works on USB power
Post by: Hawaii00000 on November 11, 2009, 08:42:10 PM
Ok I'll give it a try. The regulator's doing fine, I haven't actually been running it for long periods of time yet.
Title: Re: Arduino bot only works on USB power
Post by: Hawaii00000 on November 13, 2009, 09:21:55 PM
Does it matter what type of cap? I think the one I have is electrolytic.
Title: Re: Arduino bot only works on USB power
Post by: SmAsH on November 13, 2009, 11:03:37 PM
Yeah, electrolytic are the ones you need :P
Title: Re: Arduino bot only works on USB power
Post by: Hawaii00000 on November 16, 2009, 01:39:24 AM
Ok so I put a 100µF electrolytic capacitor where the "5v to sensor/servo connection." Is that right because now the board only turns on with the USB... kinda weird.
Title: Re: Arduino bot only works on USB power
Post by: SmAsH on November 16, 2009, 03:44:36 AM
You sure the batteries are charged?
Try to place the cap as close to the servos as possible.
Title: Re: Arduino bot only works on USB power
Post by: WhomBom on November 18, 2009, 07:37:25 AM
I experienced the same problem with my arduino bot, i solved it by running the arduino of a 7,2v battery and the servos off a separate 6V battery pack (7,2 will fry most servo's) make sure the grounds are connected though. this way servo's sucking away power won't influence the arduino power supply.
Title: Re: Arduino bot only works on USB power
Post by: Hawaii00000 on November 20, 2009, 02:19:42 AM
Hey guys, sorry for the late reply- I've had a really crazy week. Anyways the arrow on the cap should be pointing toward the sensors/ servos right? And is there difference btween µF and µ?
Title: Re: Arduino bot only works on USB power
Post by: Soeren on November 21, 2009, 04:39:22 AM
Hi,

Anyways the arrow on the cap should be pointing toward the sensors/ servos right?
Arrow? (Diodes won't work here).
The metal part is the most negative side of an electrolyte and should go to ground (0V).
Place it as close to the servo as possible.


And is there difference btween µF and µ?
µF means microfarad
µ just means micro, but on a capacitor, the F for farad is usually dropped (Like you rarely see and Ohm sign on a resistor).