Hi beautiful people!
I already successfully tested the code to control a servo motor (MG996R) with an Arduino Uno and a realtime clock/calendar (DS1302).
I have powered the Uno via USB connected to my notebook and the servo motor directly the the 5v pin of arduino and everything works perfectly. I tried connecting the project via usb to a usb smartphone wall charger (Output: DC5V - 1000mA) and it still worked fine, but I have a few questions.
The motor is going to be used at max 6 times in 24h everyday, and for each time it will rotate for 90 degrees and after a second or less it will go back to it's original position of 0 degrees (so this would happen six times in a day).
QUESTIONS:
1- EDIT: added to point 2
2- I would like to switch from the Uno to the Nano, but testing with the same environment and connections the servo motor doesn't work correctly on the Nano.
I've read that servos should't be powered by the board (not even with the Uno that is controlling the servo just fine in my project), but rather by an external power source, is this true? Am I risking to damage the board or the motor? If this is the case how can I power both the Nano and the servo using the electric wall socket?
3- Is it possible to power the whole thing by rechargeable batteries (1.2v NiMH AAA or/and AA batteries in series)?
LIST AND SPECS of hardware I have:
Arduino Uno (this is just used to test the project, I would like to use the Nano as the final hardware)
Arduino Nano (ATMEGA328P/168P)
Servo motor MG996R (Working voltage: 4.8-7.2V)
realtime clock/calendar (DS1302)
1x 4xAA battery case box with on/off switch
1x 4xAAA battery case box with on/off switch
usb wall charger (Output: DC5V - 1000mA)
Thank you very much for any help you'll be willing to give.
It is a bad idea to power motors or servos from the 5V pin. In some cases it may work, in others it may destroy the on-board regulator. But if you have a regulated 5V power supply you can connect that to the servo and to the Nano 5V pin and power both of them.
Yes. 4 x 1.2V AA NiMH cells work well, again connect to the 5V pin and to the servo. I wouldn't trust AAA cells with that powerful servo but they MIGHT work for you.
"I've read that servos should't be powered by the board (not even with the Uno that is controlling the servo just fine in my project), but rather by an external power source, is this true?"
Pretty much. If your project is working fine, why are you wanting to change it? Servos can draw enough power under load that they can cause a low voltage reset of a board supplying power to them.
It is a bad idea to power motors or servos from the 5V pin. In some cases it may work, in others it may destroy the on-board regulator. But if you have a regulated 5V power supply you can connect that to the servo and to the Nano 5V pin and power both of them.
Yes. 4 x 1.2V AA NiMH cells work well, again connect to the 5V pin and to the servo. I wouldn't trust AAA cells with that powerful servo but they MIGHT work for you.
Steve
Thanks for the reply.
I successfully managed to power the Arduino nano and the servo with 4xAA 1.2V rechargeable NiMH batteries and everything works fine! (also tried with a mini pro and it works).
zoomkat:
"I've read that servos should't be powered by the board (not even with the Uno that is controlling the servo just fine in my project), but rather by an external power source, is this true?"
Pretty much. If your project is working fine, why are you wanting to change it? Servos can draw enough power under load that they can cause a low voltage reset of a board supplying power to them.
If what I was using (usb charger that powered the Uno/nano from the usb port and the servo powered directly by the board) is working but it's considered dangerous for the components, why should I keep pushing my luck and not try to improve the project.
Maybe I've misunderstood your reply.
fishboneDiagram:
Another very important number for that servo is given here:
That's not peanuts.
Apart from a decent power supply, you'll need some decent wiring.
Cool, thanks for the info. The 4xAA 1.2 batteries seam to manage to keep up the requirements, but I'm not sure that that will be the case as soon as the voltage drops.
In any case I am considering using my Universal wall adapter power supply to power the whole thing. I think that I can just set the psu to output 5V (DC 1500mA), and then with the help of a female power socket (similar to what the Uno has, or maybe those that you don't even need to solder) power both the Nano/mini pro and the Servo.
Will that work? Or do I need something else to protect the parts?
Specs of the PSU are in the attachments.
Thank you.
Give it a try. You may get away with because although in theory the servo may take up to 2.5A when it starts to move in real life servos often draw a lot less than their theoretical stall current.
If the servo does turn out to have difficulty starting on the power supply try adding a 1000uF capacitor across the + and - connections to help out with the short term current requirements.
slipstick:
Give it a try. You may get away with because although in theory the servo may take up to 2.5A when it starts to move in real life servos often draw a lot less than their theoretical stall current.
If the servo does turn out to have difficulty starting on the power supply try adding a 1000uF capacitor across the + and - connections to help out with the short term current requirements.
Steve
Thank you very much for your help Steve/slipstick!
I'll follow your suggestions, they are really appreciated!
Have a good one!