Thursday, September 10, 2015

LM 317: How to make any voltage you need

In a previous blog entry I showed you how I found several power supplies at a flea market for unbelievable low prices. These power supplies vary in voltages. However in our projects we will mainly use 3.3 volts, 5 volt and 12 volt.

There are off course dedicated voltage regulators available like the famous 7805 which takes an imput voltage and makes 5 volts from that.

But I did not wated to be limited to only 5 volts. So that is why I ordered several of the LM317 regulator. This is an adjustable voltage regulator. I ordered 10 pieces as they just cost a few dimes a piece. Here is a picture of one of them.



It is about the same size as a 7805 voltage regulator but the specifications are impressive. The LMT317 is capable of outputting and 1.5 amps load in a voltage range of 1.25 to 37 volts. Next to that is has a thermal overload protection and a current limiting protection. This makes it ideal for a lot of projects.

Let's first look at the pin layout.


At the V-in pin you put a power supply up to 40 volts. On the Adj (adjust) pin you put a resistor divider which detremines how much voltage will come out of the V-out pin and that is it.

So the official schematis look like this (made with Fritzing).



For testing purposes I put it on a breadboard and made a drawing of that in Fritzing to:


As you can see Frizing put the potentiometer adjuster directly on the ground rail of the breadboard. In reality I wired the leads from the potmeter to the breadboard as my potmeters are not suitable for breadboard use.

So for starters I attached a 12 volt power supply and started fiddling with the potentiometer. Here are the results:



Next step was to test it with a battery pack. The battery holder was designed by myself and 3D printed. If you want to print some yourself for your projects click here.



There is some voltage loss. My batterly pack normally supplies 4.76 volts with 3 AAA batteries. The max I got now was 3.9 volts. This is about 20% voltage loss and must be taken into consideration. However this voltage regulator will normally not be used in a battery operated environment.

Outstanding !!!

So if I designed a battery pack for 4 AAA batteries (or AA for more longlasting power) I gan get my voltage starting at 1.35 volts and up to 5 volts.

One last step.

You do not want to have a potmeter in all your designs. they will make your projects more expensive and certainly more voluminous, and they are more difficult to obtain. So we need to find a solution for that.

On the internet (off course) I found a LM317 calculator. You can find it and download it by clicking on this linkLook under the download tab and then under calculators it is the fourth calculator called Regulator Design.



On the left side of the screen you can fill in your desired voltage (Uout[V]) and the value of the first resistor (which is the fixed one in the schematics above) If you then click on the R2 ? button the program wil calculate the value of the second resistor (which is the potmeter value in the above schematics). Neat huh ???




But it gets better.
I did not have a resistor of 660 ohm at hand. I did though have a resistor of 620 ohm at hand. So what will happen if we put that in. Well the program calculates that in the right part of the screen. So I put in 220 at the first value and 620 at the second value and hit the Uout ? button.



So according to the calculations the output value with these two resistor values would be 4.77 volts. If this is correct I can live with that. So let's test it.


Ok that is a bit more as expected. But hey that will be due to the resistor deviation. It is however well within a usable range.

Definitely usable.

Till next time.
Have fun.
Luc Volders