Let's Make Robots!

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

OddBot's picture
Regulate voltages in your robot.
AttachmentSize
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.

DC_regulator_Schematic0.jpg

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.

DC_regulator_Schematic1.jpg

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.

DC_regulator_Schematic2.jpg

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.

DC_regulator_Schematic3.jpg

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.

 

Capacitors__small_.jpg

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 capacitor which is what I tend to use these days. 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.

 

 

 

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.

BoozeBot_DC-DC_inverters__small_.jpg

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.
Andres Briano's picture

Thanks for taking the time to educate some of us!

OddBot's picture

Alway happy to help. It's great to see so many people making robots.

RoboSerg's picture

Thank you all for your comments, hepled a lot. How do I know the maximum safe voltage for my motors if they dont have any info printed on them or I dont want to take the mechanics apart? For example the RC car drives from a 6V battery. I just want a little more power, can I drive it safely with 7.2V or even 9V ? I.e. is 20-30% more voltage OK for toy DC motors? 

Second question would be on how to know when the battery dies? I want to have the speed of the robot as constant as possible. I.e. if I go PWN 200, I want to be sure the speed will be the same for the whole trip, and not slowing down because the battery is dying. Thank you all for your help

OddBot's picture

If your motors are from a 6V toy car then 7.2V - 9V should be ok. Basically the rated voltage of the motors is a voltage that they can opperate at for long periods of time. If you run it continuously at higher voltages then it will have a shorter life expectancy and might get hot.

If you increase the voltage by 50% then you increase the current by roughly 50% so the power consumption and thus heat is increased by 225% (150% Volts x 150% Amps).

For the most fun I suggest using 9V but then use PWM to limit the speed under normal conditions and then use 100% as a "Turbo Boost".

 

RoboSerg's picture

Why use two 470uF capasitor before and after the voltage regulator ? Also some people are using 100uF caps. Who is right ?

OddBot's picture
I assume beginners will copy this circuit exactly. I do not know what their robot's demands will be. I went extra big to be safe. I drew a circuit that should work for 90% of the robots I see on this site.
ignoblegnome's picture

That's a fair question. I did some reading before answering.

Some monolithic (single chip) regulators like the ones in this post need capacitors before the regulator, especially if the regulator is more than a couple of inches from the power source (battery).

The recommended capacitor values may vary. However, as OddBot says, "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."

So a single 100uF cap before or after the regulator is a compromise between large surge handling and noise/fast spikes.

You may be fine with a 100uF cap in some cases. However, keep in mind that with robots we are usually dealing with motors and servos, which can put variations on the battery voltage. For an extra couple of caps, I'll stick with a big one and a small one on each side.

 

Ro-Bot-X's picture

Keep in mind that on a robot you'll have motors and servos powered directly from the battery. The first large capacitor BEFORE the voltage regulator helps to keep the battery voltage steady when the motors start or reverse. The second large capacitor, AFTER the voltage regulator, helps keeping the regulated voltage steady when power hungry sensors (or sometimes servos) draw too much power, or when the input voltage drops too much for the regulator to be able to keep up. These capacitors act like power storage tanks.

The 0.1uF capacitors before and after the voltage regulator help filtering high frequency spikes in the voltage created by motors and servos, as well as by active sensors.

So you need all of them.

What is the best value? Depends how much amperage your motors/servos draw from the battery. The bigger the amperage, the larger the voltage drop across the battery terminals. You need to have big enough capacitors to compensate. If you build a SHR, then 220uF is good enough. For motors that draw more than 1A each, you need to double the capacitors, or get up to 1000uF. Also, make sure the capacitors are rated for at least double the battery voltage, I usually like to use triple the voltage, if I can get them in small enough size.

It is also a good practice to use a 0.1uF in parallel with a 10uF as close as possible with each IC or bank of sensors/servos. The 0.1uF for filtering and the 10uF as a small power storage tank.

Gabriel_f's picture

Thank you OddBot!

If it wasn't for your tutorial and these comments I would never have figured out that my LM7805 was giving flaky voltage. It caused some really strange symptoms.

I've placed an order for a 2940 instead. It'll arrive in two weeks, until then I'll just have to live with powering my Arduino straight of my 5x1.2V NiMh :)

OddBot's picture

Yes you can use a LM2937 regulator and different value capacitors. I have shown a typical circuit using common parts.

LDO regulators (Low Drop Out) are prefered as you can use lower battery voltages which gives better efficiency. Another good choice is an L4940V5 which has a 1.5A rating asumming a suitable regulator is used.

Unless a datasheet states otherwise then generally bigger capacitors are better which is why I showed 470uF. 2x 220uF in parallel is even better as the two capacitors combined have a lower ESR (Equivalent Series Resistance) which allows them to cope with big surges better.