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.

I would like to build the second circuit that provided both 5v and 6v.  I still have some areas of confusion that i would like to ask about...

1)  let's say the power source i used for my controller (arduino) is 7.2 v and this is the same power source i use for the regulator.  I use the 6v output of the regulator to power my two servos and i use the 5v to power some other sensors, while the arduino also powers yet some more sensors.   Are the circuits powered by these three sources isolated?  Can one affect the other?  for instance if i push my servo to its limit, could the power/amps it draws affect the available power to other sensors powered by the 6v or 5v sources?

2.  As mentioned, i would like to try my hand at build the 2nd circuit.  What is the maximum amps that this circuit can provide.  If i wanted the circuit to provide more current, how can i do that (assume maybe i want to use it for motors that have a 2 or 3amp stall current).   

3.  In general, is there any downside to modifying this to provide more max current (other than maybe cost)?  

I know some of these questions are newbie questions or may not even make sense...but trying to learn.  Thanks

Question 1: you would need circuit 3. The 6V is not regulated but each diode drops the voltage by aproximately 0.6V so your servos will get aproximately 6V. This is good enough for servos as they do not need an exact voltage.

No they are not isolated but if your battery can supply enough current it is not a probem. Use good quality NiMh batteries with at least a 2000mAh rating and all will be fine.

Question 2: The maximum current depends on your batteries, the size of your wire, the current rating of your power switch and the current rating of the regulator you use. The circuit shown can deliver about 1A @ 5V. If you want higher currents then you will need to use a different regulator.

Note: Circuit 2 assumes the use of 5x 1.2NiMh batteries or perhaps a 6V SLA so that the servos are supplied with 6V directly from the battery.

Question 3: the only down side apart from expense is heat dissapation. I show an LDO regulator that can work with an input voltage as low as 5.5V and run this from 6V to minimise wasting battery power as heat. You can get LDO regulators that can handle higher currents but you may need to add a heatsink and should not use a battery voltage greater than 6V.

Thank you Oddbot, you guys are just amazing here and i'm learning quite a bit.  I notice you mentioned guage of the wire as did bdk6.  It's something i haven't really paid much attention to..but will now.

Most of us hobbyist start with low power stuff (1 or 2 Amps)  that can be wired with hookup wire. We don't need to think about guage. But once you start going bigger such as a hexapod with 18 high torque servos where the peak current can be 20A then you really need to take guage into consideration.

Many hobbyist only realise this when their processors start reseting for no obvious reason. High current spikes and thin wire equals big voltage drops. Do not forget that your switch needs to have the same current rating otherwise it can cause similar problems.

So as you said in the post,if we need more current for servos we should install bigger diodes.  How do you know how much a diode will drop the voltage by?  I need to power roughly 8 servos for a project from a 7.2 volt battery.  


I found this diode( the 1N5402)  which is rated for 3 amps at radioshack, would this be suitable for my needs?


I'm not sure where to look in the datasheet to see how much these would drop the voltage by.  Any help would be appreciated.

First of all you need to find out if 3A diodes will be big enough. For 8x miniature servos it should be but 8x standard servos could draw 8A or more when all are working under a heavy load. 8xHD servos could draw 16A! If you are using big servos then consider using a full bridge rectifier instead. Just use it's +V and -V terminals (ignor the AC terminals)  it will probably be cheaper and easier to find.

We will assume you are using miniature servos and that the average current will not exceed 3A. It can briefly exceed 3A as long as the diodes do not get too hot.

Diode datasheets are fairly easy. Especially for a standard rectification diode like these. You can see at the top that the maximum reverse voltage for each diode number in this family are shown. Your 1N5402 is rated for 200V which is more than enough for servos.

It tells you here at the bottom of the first page that the maximum forward voltage drop at 3A (Vfm) is 1V but that is not the whole story.
If you look at the second page it has a graph (top right)  that shows the relationship between forward voltage drop and current. Here you will see it is closer to 0.9A although these values will vary slightly with the temperature of the diode. When there is virtually no current the voltage drop will only be 0.4V.

So from this information I think two diodes in series should do the job. At no load the servo power will be about 6.4V which is fine. If all your servos are drawing a heavy load and the current is reaching 3A then the voltage will drop to 5.2V which will reduce the servo power slightly but will not damage the servos.


I find posts like this that you do invaluable.  The explanations are very clear and well done. 

Thanks Oddbot, I hadn't seen this before. It is a treasure of info for me!

Glad to know this walkthrough is still helping people.

thank you