I am building a robot which has an arduino mega as controller, two 3v geared motors driven by a L293D driver and a micro servo (Power Pro micro servo 9g). I'm powering the whole circuit using a 6v 2000 mAh lead-acid battery. Now here I have a problem. Everything works perfect but my servo wont turn as programmed. It would swiftly move to one extreme end and move a couple of degree back and forward rapidly. I replaced the servo but same thing happened.
So I checked the code and the servo and did a lot of tinkering and lastly discovered that if I try to run both the servo and arduino from the same battery then it showed the same symptom as I mentioned. The servo works perfect if I power it with the battery and run the arduino on usb power from my pc and add a common ground.
Can anybody say what is wrong and how can I run the whole robot with that 6v battery?
Note: arduino and the servos have no fault. The battery is also fully charged.
Can anybody say what is wrong and how can I run the whole robot with that 6v battery?
You will need to work out a way to operate the arduino from a 6v power source. Perhaps a UBEC or buck boost converter can be used for the arduino power from 6v.
Is that enough current for the servo and the arduion?
Try adding capacitors on both the servo driver board, and the arduino board.
If you don't need to move the servo that far and fast, then use baby steps (it uses lots less power).
That battery sounds a bit shy to me. Can you try a larger one?
How are you feeding the 6v from that battery to the arduino? What arduino pin?
Make sure there is a common ground everywhere.
Some servos when given a writemicroseconds() command that is out of their normal operational range will go to a safe angle until the message stops.
Other times the servo can have a safe angle it goes to when the current on the servo is overloaded, or it tries to recover but fails an reaching the command angle. If the signal wire is more than 2 ft. the signal may not be clean to the servo. Not sure if that helps.
Is that enough current for the servo and the arduion?
Yes that will be plenty. 2000mAh lead-acid battery will provide perhaps 20--30A without too much
effort for brief periods. 2Ah is a capacity rating, not a current rating. The datasheet for the battery
will have the real gen, discharge and charging curves...
If 6V is going to Vin then the Arduino will be running under-voltage and the servo might then
be fussy about logic levels.
How is all the power supply and ground wiring arranged?
Hi xxxTESLAxxx,
I found that with some of those cheap Chinese servos that they work back to front!! That is what should be left at 0 is in fact right which should be at 180, so working normally you're asking it to go further right that it can, just try reversing the values for left and right, I too have build the odd buggy-bot, using these servos!!
Here's a picture, but that was Picaxe based! (This used my version of the Picaxe shield?) I am very new to the Arduino Uno and C programming...