Fundamentally there are two types of voltage regulators: linear and switching. The names come from how they operate and how they achieve voltage regulation. Linear regulators tend to be a little cheaper to implement, but they aren’t as efficient as their more complex switching variants.
There are also some “cheap and dirty” methods that some designs use. Below is a brief description and example of each.
A simple way to think of a linear regulator is to think of it as an active series resistor. It will vary its effective resistance so that the output voltage remains the same. The upside to such a design is that it is cheap, simple to implement, and provides a relatively clean output. The downside is that the regulator dissipates a relatively large amount of power.
If you consider a linear regulator as a series resistor, you can understand how it dissipates power. The voltage drop of the regulator is like that of a resistor: the difference between the input side and output side. So if a nominal 9V goes in and a nominal 5V comes out, there is a nominal 4V drop. Using the equation Power = Current * Voltage you can see that even 100mA of current causes 400mW of heat dissipation. That is 400mW of power just lost!
Most linear regulator chips work with just themselves, an input capacitor and an output capacitor. While you should follow the recommendations in the datasheet, the value you pick for these caps usually isn’t all that critical. The most common linear regulator is the LM7805. This design has been around for many years and is typically found in a TO-220 package.
Page 22 of the Fairchild LM78xx datasheet shows that the input capacitor needs to be at least 0.33µF while the output capacitor 0.1µF. Many people opt to use much larger values. However, it is rarely necessary. So get a couple of ceramic capacitors and you are set!
Watch the input voltage
Keep in mind that Linear Regulators like the LM78xx series (where XX is the output voltage) require about 2V more on Vin than the expected Vout to function. For example, on an Arduino board, putting 5 volts in on Vin will result in only about 3.5 volts on the 5V node. So to use an LM7805 to get 5V, you would need a source that is at least 7V. Unless you use a Low Drop Out regulator.
Low Drop Out regulator (LDO)
There is one variant of the linear regulator called the Low Drop Out regulator or more commonly LDO. These regulators are designed to operate with an input voltage much closer to the output voltage compared to traditional linear regulators.
The LP2985 LDO [datasheet] from Texas Instruments (National) is a popular LDO. This LDO is only good for low current applications since it is limited to about 150mA. However, if using a 5V version of the chip the input voltage can be about 4.7V and still stay in regulator which is great for battery-powered applications!
When using an LDO it is important to select the correct cap values as they are much more sensitive to output changes, compared to their “bigger” traditional linear counterparts. For example, the datasheet for the LP2985 says:
Like any low-dropout regulator, the LP2985 requires external capacitors for regulator stability. These capacitors must be correctly selected for good performance.
Then almost an entire page is dedicated to discussing what capacitors to choose.
LDOs offer an advantage over traditional linear regulators but are a little more complex. Fundamentally they still operate the same way and can burn quite a bit of power. To save power, there is an entirely differently type of regulator circuit.
The key to understanding how a switching power supply works is based on two principles: how transistors work and how to store energy in inductors and capacitors.
In theory, when a transistor is functioning as a switch it drops no voltage while when it is on and blocks all current when it is off. If there is no voltage drop or there is not current flow, then no power is wasted as heat. Unfortunately, that only occurs in theory. In practice, there is also a small voltage drop or current flow resulting in some power being wasted.
Inductors and Capacitors
Inductors (coils) store energy in a magnetic field when current is allowed to flow into them. Capacitors work really as voltage filters. Looking at the schematic below notice how the IC has an inductor in addition to the output capacitor.
Inductors don’t like it when their current changes, so they try to keep current the same. While Capacitors don’t like it when voltage changes, so they use their energy to keep voltage constant.
When the transistor turns on, it charges up the coil. When the coil has enough charge the transistor turns off. Then the coil dumps its energy, in the form of current, into the load. The output capacitor works with the inductor to keep the voltage constant. The transistor inside of the switching regulator IC will modify the rate it switches (or the duty cycle) to help manage the output voltage as well.
This relation is a very complex operation, but it comes with a huge benefit. Even though real-world parts cause some energy to be lost, a switching power supply is very efficient. The trade-offs are: 1) the components used are a little bigger, especially the coil. 2) The layout of the components is critical to minimize electrical noise. 3) Proper component selection is also essential If a design requires a certain amount of capacitance or coil size, those values must be selected carefully.
Buck and Boost
There are a couple of different types of switching supplies. The two most important to know are a “buck” supply and “boost” supply. A “buck” supply will take a larger voltage and “buck it down” to a lower output voltage. For example, it can take a 7V supply and create a 5V output. While a “boost” supply works in the opposite direction. For example, a 1.5V AA battery cell can be “boosted” to 5V.
Lastly, these can be combined into a “Boost-Buck” supply which does both. Take an example where you need 5 volts out while running off of a 6V battery (4 AAs in series). The buck portion will work until the batteries run down to about 5V and then the boost portion will run until the batteries are completely exhausted.
When considering alternatives to voltage regulators three common methods come up: 1) A Voltage Divider, 2) Zener Diode, and 3) Using no regulator. Let’s look at how each of these work.
Beginners in electronics will often ask if they can use a Voltage Divider to function as a regulator. The approach seems simple at first, calculate a resistor that provides the necessary Vout.
There are two problems with this overly simple understanding. First, it doesn’t take into account Vin changing. As Vin changes, so will Vout. More importantly, it makes the bad assumption that the load (or device connected to Vout) has a constant AND very low current draw. The load is in parallel with Z2, meaning, it is part of the overall divider.
It is nearly impossible to calculate a divider for an IC like a microprocessor because it is continuously changing its current usage which would continuously change Vout. So no regulation is happening.
There are never any situations where a voltage divider should be used in place of a regulator.
Check out this AddOhms Video Tutorial on Voltage Dividers for some additional information on how they work.
Zener diodes are unique diodes because they conduct current in both a forward and reverse direction. They conduct in reverse at a specific voltage.
If the source goes above the Zener’s reverse breakdown voltage, it conducts current keeping the voltage seen by the load “in regulation.” For this to work, a series resistor, shown as R1, is necessary. It keeps the Zener from burning itself up when it starts to conduct current. This also means R1 is burning power regardless if the Zener is conducting or not.
Zeners as regulators work okay when you have a very low power circuit powered by a battery. However, if you need more than a few 10s of mA of current, they probably aren’t a reasonable solution. Sometimes people will use these with sensors to protect against voltage spikes from damaging the sensor.
Sometimes the idea of using no regulator at all is discussed. Or only a capacitor is used to smooth out some noisy supply. One could argue that if the voltage stays above a chip’s minimum and below the max input, then it would not need to be regulated. In many cases, this might be true. However, if the chip has any analog functions, such as an analog to digital converter, then this method becomes very problematic.
A common example is Arduino projects powered by 4 AA rechargeable batteries. These cells have a nominal voltage of 1.2V, so 4 in series provides 4.8V. Since they cannot go above this value, it may not be necessary to use a regulator at all. However, if a boost supply was used, it may be possible to get more life out of those cells.
Voltage regulators keep the voltage at a stable level so that circuits can operate in a predictable manner. Choosing the type of regulator will come down to how the circuit is being used. For most hobby projects, I would recommend using a, relatively, simple linear regulator and only consider LDOs if necessary Options like a Zener diode as a regulator may only be good for the most minimal of designs, especially with how cheap the LM78xx series parts run. A voltage divider should never be used as a power source.
Questions on how the regulators differ or what you should choose for your application? Leave comments below.
I’m working with three arduino’s and three electromagnets. Now the arduino’s are 5Vin and the magnets require 12V. How can I still use the arduino’s to turn these magnets on/off in timed sequence (I got the coding worked out). If the arduino can only use 5v. There is an onboard regulator for 12V but the regulator on cloned arduino’s isn’t very reliable. Would I run my 5Vout from the arduino to a 5 to 12Vdc converter then to my magnet?
You would connect/power the magnets through a transistor.
Is the linear regulator pinout on the Typical Linear Circuit incorrect? Should it not be 1 for input and 3 for out? And that would make the Caps reverse also. Great read nevertheless!
Since the schematic doesn’t have a part number or package style, no, you cannot assume the pin out.
I have a very simple need but it is killing my project. I have model trains, old ones from the 50s and i am updating them with digital LEDs, Sounds and Smoke. I am doing great in LEDs and Sound but my smoke is killing me. I like to run real slow and puff out smoke in synch with a chuff sound. However, when in conventional mode we control speed by lowering track voltage. we idle so to speak at about 4 volts. Max speed is reached over 15V and some transformers can product 20 Volts. The problem is making smoke at 4 volts requires an 8 Ohm Heater Coil, but it burns up at 15 Volts. So if I use an 18 Ohm Heater it will not burn up, but it doesn’t produce enough heat until 8 to 10 volts. The means no low speed Puff and Chuff smoke effect. Note; track power is AC. 0-15 Volts sometimes 0-20.
So i need a regulator the size of a small walnut, that can provide 5-7 Volts out with 4 to 20 volts in. All AC or at least AC in. I can go to DC if that offers any advantage. these are nondigital controls systems here. Any ideas or health would be awesome. I can build stuff if i just knew what to get.
Thanks So Much, Retired Systems Engineer, trying to stay sharp
You could source a cheap light dimmer and set it to ~50%. Then your output will be 2V – 10V, moving with input. Once you have the variable resistor value you want, you could glue it in place or measure the resistance and replace it with a normal resistor of the same value.
Alternatively, if you want constant output based on any input (input must be greater than desired output for this to happen), easiest thing to do is rectify your AC so it becomes DC, then use a normal DC regulator. Both circuits are very common, cheap, and small. Don’t use a Zener diode circuit for regulation, your heat coils will pull way too much current.
Very good explanations. My challenge is to replace a electro mechanical 6 volt car regulator with an electronic unit to operate on a positive earth vehicle. I can understand the different components but fall short in understanding how they work together. In the project mentioned i know that the electronic unit has to control the generator current which is internally earthed in the generator but what components are required and how they combine to achieve a controlled field current at an open circuit supply voltage of 8.5 volts.
Thanks for any guidance.
Sorry, I can’t help much with automotive. You might want to try a broader forum like the EEVblog forums.
First of all….great website!
What happens when you need to regulate higher voltages? Is there information on your site for this or can you point me in a direction that does? I’m looking to regulate a varying voltage of 230vac to 400vac at 3 amps but can only find low voltage stuff so far on the web.
I’m nearing retirement age and have built stuff for designers all my life but now would like to learn more on how all this stuff I’ve made for others actually works!!
For AC there are two options. One is to use a transformer that steps up the voltage. The other option is more complicated and expensive. It would involve an inverter. It would take mains AC, convert it to (high voltage) DC, boost it up, and convert back to AC.
Pingback: baldengineer | The best 4 transistors to keep in your parts kit
Pingback: CMiYC Labs, Inc. | My first impressions of the Arduino Due
Pingback: CMiYC Labs, Inc. | Tutorial that goes over the basics of different regulators types