# Versatile Voltage Regulator With LM317

90,403

195

20

This guide is intended to aggregate a great tool to your electronics workbench that will save your life many times :

Imagine that you have a single DC power supply that gives you 12v, and you need to supply 3.3v to your circuit, or 5V, or any other voltage between 1.2v and 10v.

Now, you can do it with just 3 components - LM317 IC, 100-400 ohms resistor , and a 10K or 5K potentiometer.

Cost:

LM317 - 0.5 USD
180 ohms resistor - 0.05 USD
10K ohms Potentiometer - 1.5 USD

Total - 2.05 USD

I live in Brazil, and here electronic components are more expensive than other countries like US, so if you live in another country probably your cost will be lower, but still, I'm very happy.

That's right! I will teach you how to assemble this very simple circuit, that makes life way easier for you, that want different voltages on every project, for a very low cost.

You are not limited to 12V as input voltage by the way, is said on the LM317 datasheet that it supports "any output voltage" as long as ( Vin - Vout ) < 40v - I have not tested with high voltages, but I imagine you won't need them eighter.

You can use it on a breadboard or assemble a PCI and mount it on a box, so it will look nice and will be always at your side in the needed moments. The tutorial covers only the circuitry needed and I stopped it on the breadboard.

Let's proceed and see what's needed

### Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

## Step 1: Looking at the Datasheet

This tutorial is very short (as the task itself), but I think that looking at the datasheet of what we are messing with, is a very good idea, so you can know all the power and limitations of your application.

The link for the datasheet is this :

http://www.alldatasheet.com/datasheet-pdf/pdf/8619/NSC/LM317.html

Here are my personnal notes about interesting stuff:

* it won't work on a load that causes a current below 10 mA - watch out.

* It seems very good that it doesn't set a max output voltage, it just specifies that the difference (Vin - Vout) has to be less than 40V.

* You won't go under 1.25V

* Current limitation on the used package - 1.5A

## Step 2: Assemble the Circuit!

As you looked through the datasheet, the simplest circuit we can have to make this guy work, the circuit picture is atacched, We will use :

R1 = 180 ohms resistor

R2 = 10 K ohms potentiometer

That's it!

Connect the power supply on input and ground, your multimeter in Vout and ground then let's see how it goes!

## Step 3: Test It

The actual test is just about connecting any DC power supply that does not exceed 18v ~ 20V  you can use some of these that can be nearby :

* Cell phone charger

* ATX supply from your PC or workbench

* 9V battery

Any of these should work

Just connect the power source in Vin and your multimeter in Vout, it should look like the presentation video, where I can go from 1.25V to a value nearby Vin - 2V

If you have issues, please comment that I will try to help.

## Recommendations

• ### Internet of Things Class

22,137 Enrolled

## 20 Discussions

I try to make a voltage regulator with lm317, but when i set the volt to 5v and put load it will drop 0v

Valeu cara, também sou brasileiro! Deu tudo certinho, só coloquei um display de LED que funciona como um voltímetro, aí não preciso da protoboard.

I have a problem. i have an RC car that requires only 9.6V. the included battery has only 900mah, my RC i quite big and it only runs for 20 minutes then my batt runs out. i tried using my 12v scooter battery but im afraid the RC motor won't last due higher voltage. i know it because my RC runs faster. Now, using this circuit, i achieved my desired output but the voltage out suddenly drops when i try to run my RC. it drops to about 3v... can you help me? Please?

LM317 projects are fun.

I am trying to make power supply as you mentioned and its showing fixed voltage until no load is connected but when i connect a battery with it, then output of the regulator varies with input, how to fix this problem.

2 replies

Hard to debug it without actually ooking at what you assembled and the tests you did. If a battery worked it shows that in a give situation it works fine (right?). Now, if using another power source it doesn't, the only thing I can think without seeing the actual circuit and checking many things is that you might have forgotten to connect the 2 references? (ground). Then what you observe would make sense to me.

In my use cases with an ATX supply it worked fine, with only a small voltage drop when load is connected, which is expected.

Dunno if you still need info on this or not, but here it is if you do!
This [voltage regulator] will defiantly do the trick to drop the voltage from the 9.6 it spits out down to the 5 the RPi uses. The only issue I can see is that the battery also spits out 1800mA, and the FAQ for the RPi states it uses 1500mA. I'm still learning a bit myself, so I can't say with a 100% certainty on this. But I think the RPi can handle the 1800mA. I can't find info one way or the other to say this is true or false, though. You may want to just look into bleeding off the 300mA access. You can do this with some resistors I found this which may help you understand decreasing amps, if you need it.

DoctorWoo - I'm not sure that we could interpret that as a current source.

1800 mAh (the _h_ is importat - hours) is a charge capacity unit. It basically says that if you draw 1.8 A from the battery, it will last for an hour. It actually doesn't say what is the maximum current, but I'm sure that for a Pi it will be perfectly fine. RC cars could draw 10~40 A for few seconds.

Well, if you have a specific, fixed application, you could go even with a more specific IC - LM7805 and use even less and cheaper parts than a potentiometer. Take a look here :
https://www.sparkfun.com/datasheets/Components/LM7...

It's been a long time since I don't look at this but be careful with the power dissipation in the IC, 9.6 to 5V @ ~1A is not a tinyamount of power. Not sure how the IC handles that but probably dissipates as heat.

As far as I can tell, don't worry about the current. The battery specification is the maximum current. So if the Pi draws less than that, you should be fine (if you check what I said above).

Just to complement - this is useful in environments when you need different voltages for different occasions/uses -- that's why the potentiometer, otherwise you just replace it by a resistor with the value you want and get your project cheaper.

I had picked up a LM317 to use as a voltage regulator for my breadboard but never got around to set it up. Thanks for the tutorial. I tweaked it a bit for my power source with the parts I have on hand and threw on a 2.2 uF electrolytic capacitor to smooth out the current. It works great!

Means that the IC does it's job as long as the load requires more than 10 mA, otherwise I'm not sure of what could happen, or not, likely it won't turn on.

It's written in the IC datasheet. I just warned =P

It could, but you should do the math, Vin-Vout * Current it needs : will tell you how much heating power will be dissipated into the IC. Then you should provide physical means for it to not fry.

Ah, you should look at the IC's max current in the datasheet, but usually is higher than 1A, so you should be fine.

for long term use you might want a heat sync or a fan so it dosent overheat

It could be done easily enough. Simply add a 0.1uf capacitor between the ground and output voltage, but you probably knew that! : )