Let's Make Robots!

Once you've decided on batteries, how do you regulate the voltage?

Regulate voltages in your robot.
DSE200405_catalogue_data.pdf1.02 MB
LM2940CT-5.pdf409.32 KB
LM7805.pdf1.7 MB

Recently I've noticed some people are a bit unsure of how to regulate their robots batteries and since there was a tip/walkthrough on batteries recently I though this might be a good time to explain voltage regulation. Since robots and their power requirements vary so much I've presented several general purpose schematics showing different configurations. These should work with most of the robots I've seen on this site. Note that a heatsink should be used on the regulator. I've attached data sheets for the regulators.

To begin with the most common configuration is a battery with a voltage greater than 5V and a simple 5V regulator.

I've notice many people use a 9V battery so that is what I've shown here. The large electrolytic capacitors (470uF) help the regulator deal with big surges in power such as a heavy load being turned on. The smaller capacitors help filter out noise and spikes. This setup cannot produce a lot of current due to the battery. A 8.4V NiMh or NiCd rechargeable battery is the way to go here as it saves you money and can usually deliver more current for longer.

This setup isn't very efficent because up to 4V is dropped across the regulator. If your circuit is drawing 100mA at 5V then it uses 5x0.1=0.5W of power. If you are using a 9V then 4V at 100mA = 0.4W is wasted as heat by the regulator and a small heatsink may be required. Once again the rechargeable is a better choice as it will only waste 0.34W of power.

This is a more efficent design that can deliver more power. It also has a 6V output for servos, motors, relays etc. You can use 4xalkaline batteries or 5xNiMh. I recommend 5xNimh as they last longer and the voltage stays at 6V almost to the end where as the alkaline batteries will steadily drop in voltage. I've used a low dropout regulator for efficency. The popular 7805 needs the input to be at least 2.5V higher than the output for reliable opperation. This LM2940CT-05 will work reliably with an input just 0.5V higer than the output. As I mentioned before, the more a regulator has to drop the voltage the less efficent it is.

This is another variation using a popular 7.2V NiCd or NiMh battery pack from a radio controlled car. This circuit gives you 7.2V for bigger motors. I've used two power diodes in series to give you a 6V supply for servos. Each diode will drop about 0.6V and will handle up to 1A, together they drop aprox. 1.2V. If you need more than an amp for servos then bigger diodes can be installed. You may want to install a fuse as well since those battery packs can put out a lot of current if a motor stalls.

This is a typical setup with two batteries. I've shown a 12V car or SLA battery as might be used in a big robot like Walter. I've also shown a 9V as in some cases a 9V supply can be handy for op-amps. You can use whatever batteries suit your needs. The batteries shown in these circuits are just typical examples.


These are typical capacitors I use in my circuits.
I've shown them here for those who are uncertain what capacitors to use.

At the top you can see two electrolytic capacitors. These capacitors may be a different colour but will always have the polarity marked on them. Note in the photo that a negative symbol is shown in an arrow pointing to the negative lead. Usually the negative lead is a bit shorter than the positive as well. They also have a voltage rating on them. Never exceed this or connect them the wrong way around as the can leak a foul substance.

The next down is a greencap, polyester or mylar capacitor. They are not always green but reguardless of their name they work the same. The capacitor in this picture is a 0.1uF and could be used in the above circuits. This capacitor is not polarised (no plus or minus) and is rated up to 100V.

The smaller grey capacitor below is a modern equivalent called a MKT or minature polyester. It is the same as the greencap above in value and voltage rating but noticably smaller.

At the bottom is a monolithic ceramic capacitor which is what I tend to use these days. These capacitors have a lower ESR (equivalent series resistance) that allows them to charge / discharge quicker and filter higher frequencies. The capacitor in the picture is also a 0.1uF and non-polarised. It has a rating of 50V.

I've attached a general purpose datasheet from Dick Smith Electronics that has good information on electronic components in general including a section on regulators.

Our friends at SparkFun has a good article on capacitors here: https://www.sparkfun.com/news/1271


Finally a brief mention on DC-DC converters. As mentioned above, the more voltage a regulator has to drop the less efficent it is. When you need to use higher voltage batteries such as the 24V I use for BoozeBot then regulators are bad news. They can deal with input voltages in excess of 30V with suitable heatsinks but to get 5V at 1A from a 24V battery means 19W of power would be wasted as heat to give me 5W of usable power or just over 20% efficency. This is where DC-DC converters are well worth the money as they are usually 80%-90% efficent depending on load and design.

This photo shows the 3 DC-DC converters used in BoozeBot. The two converters at the top are kits I bought and assembled. They can put out in excess of 2A each. The 6V output is regulated down to 5V where necessary and the 9.5V output is for an ASUS Eee-Pc. These kits were reasonably priced and because you make them yourself they can be setup to produce almost any voltage. Both of mine reduce the voltage but they can be made to increase the voltage as well. At the bottom is a bought unit. It can produce about 10A and will run BoozeBots arm motors.

I hope this information is helpful. Good luck and enjoy!


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
One place you can get them cheap is Futurlec. They deliver around the world and there is no minimum order. Downside is that postage is slow.
The local hardware store don´t have it, for now I will use the 7805.  Later I will buy some 2940  :)

hey OB, I love the info that you've put here, and I'm going to look into dc to dc regulation(maxim-ic has a few I think), but I was wondering if you knew what sort of drawbacks it may have when using dc->dc vs just using a vreg in a more efficient manner say like using 7.2-9.6v?

This is who I was going to get my components from...hopefully samples  :)



Most DC-DC converters are about 85% efficent at their rated load, their biggest downfall is the price and they may need some external filtering since the internal switching can be quite noisy. If your 5V supply doesn't need a lot of current (less than 200mA for example) and your not competing in endurance events then I'd probably stick with a regulator. Otherwise you need to look at how many Watts of power each device is going to waste, do you need a heatsink, does it need a fan and how much power will that use etc.

Thanks, this is a really useful posting. I've worked with plenty of LM7805's and LM317's, but this gave me some ideas I hadn't thought of. I definitely want to pick up some LDO regulators. I really like that idea about getting all three voltages from a 7.2v R/C car battery pack -- I realized a while back that BullyBot really needs three different voltage sources, and was trying to think of a way to avoid adding a third battery pack. I think your circuit will solve my problem nicely.


Here is my question that I have had forever, but never had time to play with capacitors. Lets say I have a 9 volt battery. How do I know which type of capacitor to use and what is th equation to see which value I need to get to a certain voltage/amerpage or see what effect a specific capacitor (say a 4.7 uF) will have?

The type is usually chosen by the value required and voltage. As for amperage, it depends on frequency. Since most robots are running off of batteries the frequency of the supply is zero. Sounds like you want a walkthrough on mains based power supplies.

I posted this to help people avoid formula but I forgot about the intelligence and therefore the curiosity of everyone here so now I keep getting asked for formula. As I mentioned in another question, when a capacitor is placed across a power supply it doesn't short out the supply because a capacitor is essentially an open circuit to DC. However to AC components such as ripple, spikes, surges, commutator noise etc. a capacitor has a low impedance. The formula for capacitive reactance is Xc=1/2ΠfC where f is the frequency in Hertz and C is the capacitance in Farads.

The lower the capacitave reactance the better it shorts out the ac components. Bigger capacitors have the storage capacity to handle low frequencies but have a higher reactance. Small capacitors have a much lower reactance but can only handle higher frequencies.

The circuits I've shown have a reasonably large capacitor to deal with low frequency stuff like a relay coil turning on and drawing more power. And a smaller capacitor to deal with higher frequency noise from the thousands of transistors in the MCU turning on and off and a small amount of com noise from an electric motor. The regulator deals with the frequencies in between. 

In some cases the 470uF capacitors may need to be increased. In rare cases you might even add say a 47pF ceramic.

The types of capacitor used in power supplies are mainly Electrolitics for their large storage capacity. They come in many different voltage ratings so choose carefully and be aware of their polarity and temperature rating in some cases. With the smaller values polyesters are common. For very small values ceramics are used.



What is Π?

To spell it out is the formula capacitive reactance equal to one half of frequency (in hertz) times capacitance (in farads)? I wasn't sure what the extra character is unless it means divided by? Thanks for the walkthrough. I knew I was going to need to work with this in the near future because I wanted to make a robot that had a circuit to recharge batteries. 

I used the special character feature to put in pi and it looked ok in the edit box but came out different in the final text.

Pi=3.1415. I'll do a walkthrough on mains power supplies / chargers next.

That make sense. I was goign to try to use VB or excel to add a bunch of forumals and have them spit out which resistor to use, capacitor, etc. This is of course a future project, but it would help me a ton and maybe others as well.