Tutorial: LM317 Variable Voltage Regulator

I noticed a couple people landed on the blog because they were searching for information on the LM317 voltage regulator. I figured I should do a tutorial on it and hopefully they’ll come back to see it.

Here are some of the key features listed on the datasheet: Max output current is 1.5A; Adjustable output voltage between 1.2V and 37V; Current limiting and thermal shutdown protection.

When you’re connecting the circuit, take careful note of the pins on the regulator. From left to right: Pin 1 is Adjust, Pin 2 is Vout, and Pin 3 is Vin. This is important to remember as the circuit diagram has a different order when you read the diagram from left to right.

The circuit in the datasheet calls for capacitors but I didn’t include them for this basic demonstration. They’re used to smoothen out voltage spikes and improve the transient response. The datasheet calls for 0.1uF and 1uF at Vin and Vout, respectively. If you’re using electrolytic capacitors, make sure that the polarity is correct. The negative side is marked with a white stripe. That side of the capacitor should be grounded while the other side goes to Vin or Vout. I’ve read that ceramic capacitors have a better effect on the transient response so feel free to use them if you have them. They’re not polarized so you don’t have to worry about which way they’re connected.

I connected the circuit shown in the datasheet, minus the capacitors, and supplied it with my unregulated 9v DC power supply which actually supplies around 12v with no load.

IMG_0850The minimum output voltage checks out at 1.2v.IMG_0849This was the maximum voltage I could get out of the regulator’s output. As I said in the power supply tutorial, it’s never a good idea to ask more from your power supply than it’s rated for. When you’re using the LM317 regulator, chose a power supply that supplies a higher voltage than what you’ll actually need.IMG_0852Here’s the regulator circuit adjusted to drive a yellow LED. All you need to do is turn the potentiometer and read the output on a multimeter until you get your desired voltage.

If you don’t want to use a potentiometer, you can calculate your R2 once you have chosen an R1 and you know your desired output voltage, Vout. I thought it would be neater to take a picture of my notes rather than try to type out those equations…

IMG_0856So if we were to replace the potentiometer with 1.5kΩ, we should get 9v…

IMG_0854That’s so satisfying.

I hope this helps out those looking for information on the LM317 regulator.

Advertisements

One thought on “Tutorial: LM317 Variable Voltage Regulator

  1. Nice article, I have always used a large electrolytic capacitor on the “Vin” side of the capacitor. The larger capacitor is good for filtering as you mentioned but also helps your circuit stability if your load changes current draw quickly like a solenoid powered, etc.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s