Hi, I'm new to all of this and I've been struggling with understanding how to power a servo from a motor shield.
I am running an Arduino Uno, the Adafruit Motor Shield v2, and this servo.
]Continuous%20Servo]BotBrain CRS Continuous Rotation Robotics Servo
I am trying to replicate this project (please watch video): Servo door
Q1: How do I power all of this from one battery? I have a 12v 5ah battery but from what I've read that is too much for the servo. Can you give me a link to a recommended battery setup that could run this project with low maintenance?
Q2: How is the timer in this project connected to control the servo? It seems to be turning the microcontroller on and off which runs the servo sketch. This would save a lot of battery life because Arduino would only be on for a few minutes a day while the door opens and closes.
Q3: What type of timer is it? Can you provide a link to a similar timer? How would you wire it to the Arduino?
Bonus question: How would you code this assuming the timer turned on the Arduino and it simply ran a sketch to open in the morning and close in the evening? Do you have sample code for this specific operation?
Thank you to anyone who helps this newbie learn the basics!
You do not need or want to power a servo from a motor shield. Just connect it to a supply and let the Arduino give it control signals.
Thanks, Mike.
What kind of battery power supply would you suggest? I would want a rechargeable setup that last a reasonably long time given that the servo only runs a few moments a day.
Any thoughts on the other questions in the post?
Q2: How is the timer in this project connected to control the servo?
It is not. It just turns on the board and the code inside the board controls the servo.
Q3: What type of timer is it?
No idea.
Bonus question: How would you code this assuming the timer turned on the Arduino and it simply ran a sketch to open in the morning and close in the evening?
It seems the controller board is not doing much of anything except putting out the pulses to drive the servo and stopping them when a limit switch is reached. All the time of day is in the timer. You should be able to eliminate the timer and do it all with just an arduino.
There have been loads of projects like this on the forum, just google for them.
Sparkfun sells a solarbuddy solar lipo charger board that this could be an ideal option for very intermittent use.
Thanks for the suggestions!
I spent hours last night looking and I couldn't find anything to point me in the right direction. Where should I be focusing my search?
The timer seems like the best route only because it conserves battery life because the Arduino isn't running all the time.
I'm still not sure which battery pack to use for this application. Can you make a suggestion?
The timer seems like the best route only because it conserves battery life because the Arduino isn't running all the time.
Yes but the timer is running all the time, something has to. A real time clock with an alarm function and an Auduino in sleep mode will run at much less power.
LionKing:
I'm still not sure which battery pack to use for this application. Can you make a suggestion?
Your 12V, 5Ah battery should be fine if you drop the voltage for the servo (and probably the Arduino).
You can use Adafruit's shield to connect the servo, though it's not really doing you much good. If you use the Adafruit shield, you should cut the trace as discussed on this page. The only benefit of using the shield is it gives you a place to connect the servo's power supply (though you have to provide a connector) and it gives you a place to connect the servo. A breadboard, piece of perfboard or some wires with appropriate connectors could also be used for this purpose.
You could probably use one of these inexpensive switching regulators for your servo. I linked to the first LM2596 regulator on the list. There may be less expensive options.
If you get two (or more) of these regulators, you could use one for the servo and one for the Arduino. You could either drop the voltage down to 7.5V and connect the output to the Arduino's Vin line or drop the voltage to 5V and power the Arduino with the 5V line.
Using the Vin line at 7.5V has the advantage of providing the Arduino a cleaner power than when powering the Arduino directly from a cheap switching regulator at 5V.
The downside to powering the Arduino through its 5V regulator is the energy lost from the combination of the switching (LM2596) regulator and the Arduino's linear regulator will be greater than the energy lost if you only used the switching regulator.
By using two separate LM2596 regulators, the servo is less likely to cause problems for the Arduino. (Powering an Arduino and a motor (including hobby servos) from the same power source doesn't always work well.)
I think an Arduino can be powered directly from 12V but you'll end up wasting more power than if you use a switching regulator to drop the voltage. The Arduino's 5V regulator could end up getting pretty hot if used it with a 12V supply for extended periods of time.
I really like the idea of sticking with my 12v 5ah battery and using something like this solar panel to charge it.
Solar panel: 18v 5W Solar Charger
Can you help me understand how the power system would work and what the power usage would be when using the step down you recommended?
This is how I could connect the system:
18v 5w Solar panel-->12v 5ah battery-->step down-->7.5v Aruduino-->servo
Do the step downs drain the power continuously or do they only drain power when the Arduino is pulling power? I want to make sure the battery is charged enough when it's time to run the servo.
Thanks for all the help! I feel like I'm almost there!
Do step downs drain power continuously or do they only "step down" when something draws a current through them? Meaning, if the Arduino is in idle mode using 50mah, what can I expect the battery's power drain to be given the step down is dropping the voltage? (I'm not sure the correct terminology)
I would like to use a step down but it would need to be power efficient so my battery doesn't die.
Does this configuration make sense from a voltage standpoint?
18v 5w Solar panel-->12v 5ah battery-->step down-->5.2v Aruduino via DC jack-->servo
The step down uses some nominal amount all the time.
If the load draws 50ma and the conversion is 90% efficient, then ~56mA will be used.
5.V into Arduino 5V on the power header, or to the USB connecter, would be best.
~7.5V is needed into the DC jack to allow for the reverse protection diode and for losses in the onboard 5V regulator.
Go direct and bypass both of those.
Will your battery survive 18V being applied across it? Or does the 18V need to power a battery charge control circuit (which will likely charge a 12V sealed lead acid battery at 14.5V for example)?
Thanks for helping, CrossRoads!
Here's what I was planning to use in the following order:
- 18V 5W Solar Charger
- Solar Controller 10a 12v/24v Solar Charge Controller
- Add a 50V 1A DO-41 diode inline with the + side of solar panel to prevent reverse drain.
- DROKĀ® LM2596 Analog Control Buck Converter DC-DC Step-down
- Arduino Uno
- Servo
Think this will work well? What should I change?