Tom Herring

Help with a simple lm317 circuit

Recommended Posts

I have lots of interests, and play around with many different things.  Mechanics, sewing, art, music, plumbing, you name it.  I have long had an interest in electronics, and have fiddled about some.  I have a basic understanding of what I am doing, but it is indeed basic.

I have a Christmas display which includes a number of pieces that are illuminated by LED's, and each piece has a pair of AA batteries, which means there is an attached battery box, and switch.  The display sits on a shelf above a window in my home, so getting up there to turn all those switches on and off is a pain.  I figured I would make a simple little power supply to run all of the LED's.  My idea was to use a wal wart which I already owned.  It supplies 12V at 500 ma.  Since the LED's are powered by 2 AA batteries, I expect that they are getting just a bit over 3 volts, so I figured I would use an LM317 voltage regulator to set my voltage at 3 volts, and life would be good.

As is often the case, I apparently know just enough to get myself into trouble lol.  So, I used an online calculator to get my resistor values, and set up my circuit on a breadboard to test.  I started by powering it with a 9V battery, and got 3.1 volts, which I figured would be fine.  I then hooked up the 12V wal wart, expecting to see that same 3.1 volts, but that was not the case.  When I power the circuit from the wal wart, I am getting 2.69 volts from the LM317.

Can anyone explain to me why I am seeing the difference in voltage between the battery power, and the wall adapter?  Thanks in advance!

Share this post


Link to post
Share on other sites

You forgot to attach your schematic so we can see the resistor values and important input and output capacitor values.

Maybe the wallwart has very poor or no filtering then its "12V" is fluttering, averaging a voltage much less than the minimum of 5V that the LM317 needs.

Maybe the wallwart is overloaded since you did not say how many LEDs or how much current they need. The original AA cells are pretty big and can produce a lot of current.

Share this post


Link to post
Share on other sites

Hmmm . . . capacitors, well, there could be my problem.  I'll draw a schematic and scan it in the morning, but the way it is assembled is simply the 12v into the LM317, and then the two resistors.  One from Vout to ADJ, and the other from ADJ to ground. R1 (Vout to ADJ)  is 236 Ohms.  R2 (ADJ to ground) is 360 Ohms.  Measured voltage from the Wal Wart with no load is just over 13V and drops to 11.15 when connected to the circuit.  At present, the circuit is powering a simple street lamp which has 4 led lamps in it.  The LED's do light with the wal wart, so to that end, the circuit works, I'm just curious about why the voltage difference.

Obviously, your use of the word Important with the input and output capacitors is a clue that I've left something out which I shouldn't have.  Time for me to dig a bit deeper, and see what I should have done there.

Share this post


Link to post
Share on other sites

You should always read the datasheet for an electronic part to see what is needed and why.

The datasheet for an LM317 shows an input to ground disc capacitor of 0.1uF and an output to ground electrolytic capacitor of 25uF or more.

The datasheet shows the more expensive LM117 that can use a resistor as high as 240 ohms from ADJ to OUT pins, a cheaper LM317 needs 120 ohms max. Then your 360 resistor should be 180 ohms.

Solderless breadboards cause many connection problems. Solder all the connections together on a pcb or stripboard to eliminate the connection problems.

Share this post


Link to post
Share on other sites

Thank you very much.  Like I said, I know just enough to get myself into trouble :)  Will take your advice, and set it up with the appropriate resistors, and capacitors.  I'm sure that will make a significant difference.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now