How does the LM317 regulate to a specific voltage regardless of its input?

ArakelTheDragon

Joined Nov 18, 2016
1,366
Lm317 is a good regulator. It doesnt work with batteries because of the big voltage drop, but you can implement a voltage charge pump and make up for that. There are other options also like connecting it in parrallel and cheating, but lets not give all the fun out at once :D.

There are "LDO" regulators, which are low voltage or "low dropout regulators", they have from "0.5" to "1V" drop on them.
However the best option is get a "9V" battery connect it to LM317 and until the battery gets discharged to "7.5V", you will get what you need on the output. Also implement 1 zener diode in order to make sure the battery is shut off completely when the voltage drops to "7.5V". I dont know how much it takes for a "9V" battery to be considered discharged, but I think that "2.5V" are more than enough!
 

MrAl

Joined Jun 17, 2014
13,726
Lm317 is a good regulator. It doesnt work with batteries because of the big voltage drop, but you can implement a voltage charge pump and make up for that. There are other options also like connecting it in parrallel and cheating, but lets not give all the fun out at once :D.

There are "LDO" regulators, which are low voltage or "low dropout regulators", they have from "0.5" to "1V" drop on them.
However the best option is get a "9V" battery connect it to LM317 and until the battery gets discharged to "7.5V", you will get what you need on the output. Also implement 1 zener diode in order to make sure the battery is shut off completely when the voltage drops to "7.5V". I dont know how much it takes for a "9V" battery to be considered discharged, but I think that "2.5V" are more than enough!
Hi again,

Yes good point about the battery operation.

Back when i was building a voltage meter to run constantly off of the car battery i was originally using an LM217 (better temperature range than LM317 but same device otherwise). I dropped that and went to a better three terminal regulator because the discharge current due to the LM317 was something aournd 5 to 10 milliamps, which i did not want to have to put up with because the battery was still discharging and i wanted to get rid of any possible discharge other than the display which was not on constantly so used very little power.
The problem with the LM317 regulating 12v down to 5v was even when the microcontroller was put to sleep for long periods and used nano watts, the dang LM317 kept drawing that 5 to 10ma, which was more than the whole thing took on average without that LM317.
The regulator i changed to was a three terminal regulator with fixed output but i forgot the number now. It used much much less current even when running 24/7 so that worked out pretty good.
Yes i know i could have shut the LM317 down (transistor), but that requires a timing circuit so it can turn back on some time later and provide a quick readout, then shut back down, so it wasnt really simple to do that.

Yes a lot of tricks for the LM317. I used one as a Li-ion charger too some years back before i built a high efficiency charger. The charger with the LM317 took about an hour to solder up that's how easy they are to use.
 

ArakelTheDragon

Joined Nov 18, 2016
1,366
Hi again,

Yes good point about the battery operation.

Back when i was building a voltage meter to run constantly off of the car battery i was originally using an LM217 (better temperature range than LM317 but same device otherwise). I dropped that and went to a better three terminal regulator because the discharge current due to the LM317 was something aournd 5 to 10 milliamps, which i did not want to have to put up with because the battery was still discharging and i wanted to get rid of any possible discharge other than the display which was not on constantly so used very little power.
The problem with the LM317 regulating 12v down to 5v was even when the microcontroller was put to sleep for long periods and used nano watts, the dang LM317 kept drawing that 5 to 10ma, which was more than the whole thing took on average without that LM317.
The regulator i changed to was a three terminal regulator with fixed output but i forgot the number now. It used much much less current even when running 24/7 so that worked out pretty good.
Yes i know i could have shut the LM317 down (transistor), but that requires a timing circuit so it can turn back on some time later and provide a quick readout, then shut back down, so it wasnt really simple to do that.

Yes a lot of tricks for the LM317. I used one as a Li-ion charger too some years back before i built a high efficiency charger. The charger with the LM317 took about an hour to solder up that's how easy they are to use.
For a long term device, your battery must be a properly picked one, because otherwise it will get discharged even with time. The standard for car batteries is less than "1%" per day discharge. So its about "0.9, 0.95%".
 

MrAl

Joined Jun 17, 2014
13,726
For a long term device, your battery must be a properly picked one, because otherwise it will get discharged even with time. The standard for car batteries is less than "1%" per day discharge. So its about "0.9, 0.95%".

Hi,

Well i had a problem with the self discharge without any measuring equipment and was trying to make measurements for that over long periods of time, so i wanted almost no extra drain at all.
It was a fairly new battery too so i was especially concerned.
 

ArakelTheDragon

Joined Nov 18, 2016
1,366
No matter how new the battery is, the chemical processes inside will discharge it with about "1%" per day. This is why when your battery has been sitting for a long time, it might not work when you try it or it might be discharged. During the cold wheather that is even more.
 

MrAl

Joined Jun 17, 2014
13,726
No matter how new the battery is, the chemical processes inside will discharge it with about "1%" per day. This is why when your battery has been sitting for a long time, it might not work when you try it or it might be discharged. During the cold wheather that is even more.
Hi again,

Yeah i was having other problems with it where the self discharge was somehow accumulative so that it would sort of take off where it left off even after running the car for a while. I suspected the alternator had something to do with it. I had since gotten rid of the car though due to some other problems, but while i had it i had to periodically take the battery into the house to charge it with a good charger (power supply). That would get it back up to full charge again. The problem appeared to be higher than normal internal series resistance.
 

RichardO

Joined May 4, 2013
2,270
@MrAl and @AlbertHall:
I have here a simulation using the LM7805 circuit as an adjustable regulator. (Thanks to @Bordodynov for the LTspice 7805 circuit.)
You will see that the output voltage is somewhat over 15 volts. This is exactly what I would expect for the resistor values chosen. R101 has 5 volts across it as set by the regulator. The current through R101 is 5 volts/R101. That current flows through both R101 and R102. This gives a total of 15 volts on the output.

It is more than 15 volts because the operationg current of the LM7805 flows through R102 increasing its voltage drop a bit. (I chose the values of R101 and R102 to minimize this effect).

LM7805_Adj.png
 

Attachments

ArakelTheDragon

Joined Nov 18, 2016
1,366
Perhaps, but practice shows 7805 is better for a stable voltage regulator. If you want to adjust the voltagenits better to use LM317 or a similar one.
 

RichardO

Joined May 4, 2013
2,270
7805 is not recommended for an adjustable regulator.
True, but sometimes you use what parts you have or what are readily available.

I have a bunch of MC7902 regulators in the TO-3 package. (These are -2 volt regulators.) Not a common part but they have value. They can, for instance, even be used as a positive voltage regulator in a pinch.
 

MrAl

Joined Jun 17, 2014
13,726
Hello there,

There has been some talk of using an 7805 (or similar) as a three terminal regulator in a way similar to the LM317 so i thought i would mention a few things here.

First, "A voltage regulator by any other name would [still] smell as sweet".

Just to be a little sarcastic here if i may, i can use a somewhat conductive rock as a voltage regulator by connecting three or more wires to it and connecting it into a circuit. It would probably smell the same as any other voltage regulator but it's regulation performance would suffer greatly :)

I bring this up because although we call various circuits "voltage regulators", there are good and bad ones and some are much better than others.

Enter the 7805 regulator. Yes, we can use one, and i know i have in the past and i bet others here have too. The question is, do we want to use one, and if we do what kind of circuits do we want to use one in.

There are pro's and con's of each regulator and for each one we have to look at the regulation with line and load and with temperature variations, and we might also look at output ripple when applicable.

When it comes to the LM317 and 7805, the LM317 has a little bias variation with temperature so that affects the regulation, but i think the7805 has more variation so those two would have to be compared as well as the normal variation and the set point variation.

There are other things that come up also. One advantage the 7805 has over the LM317 is there are no resistors assuming you can get the right voltage output for your application. This has an advantage because there is one less connection point and no resistors to crack in half with hard impact.

To do the comparison we'd have to look at the data sheets, but i am pretty sure (going from memory though) that the LM317 beats the 7805 in regulation performance after all things are considered.
There is also a note somewhere that mentions the change in the output of the 7805 when there is a resistor between the 'ground' terminal and actual ground and that is due to bias current.

If anyone cares to do an item by item comparison that would be great.
 

RichardO

Joined May 4, 2013
2,270
There has been some talk of using an 7805 (or similar) as a three terminal regulator in a way similar to the LM317 so i thought i would mention a few things here.
I agree with all of what you said adding only a repeat of what I said earlier... If all you have is a 7805 and you don't need great performance then it may be good enough.

For instance, if the circuit will mostly work on an unregulated battery then the 7805 is going to improve the operation with discharging batteries, even with the resistors to set a voltage other than 5 volts. (This ignores the dropout voltage of the 7805, of course).

I have had an occasion where I needed just a bit more than 5 volts from the regulator. A signal diode in the "ground" connection raised the voltage to about 5.7 volts. This worked good enough for what I was doing without a complete re-wire of the regulator circuit.
 

MrAl

Joined Jun 17, 2014
13,726
I agree with all of what you said adding only a repeat of what I said earlier... If all you have is a 7805 and you don't need great performance then it may be good enough.

For instance, if the circuit will mostly work on an unregulated battery then the 7805 is going to improve the operation with discharging batteries, even with the resistors to set a voltage other than 5 volts. (This ignores the dropout voltage of the 7805, of course).

I have had an occasion where I needed just a bit more than 5 volts from the regulator. A signal diode in the "ground" connection raised the voltage to about 5.7 volts. This worked good enough for what I was doing without a complete re-wire of the regulator circuit.
Hi,

Oh yes i agree that sometimes the 7805 is just good enough and it's a proven part that has been in use for as long as i can remember. I also read about the trick of using something in the ground lead to boost output voltage slightly, i think it was on some data sheet where they might have been paralleling two or more devices and wanted to use an output series resistor, which of course drops some voltage at full load so they put a resistor in series with the ground lead just to boost a little. Long time since i read that though.

The thing to watch out for is the voltage tolerance. I think they can go down as low as 4.75 volts or maybe even 4.5 volts i'd have to look that up, but sometimes in modern circuits of today that's not going to be good enough.
The LM317 data sheet is a little misleading too though, in that at full load the device gets hot, heatsink or no heatsink, and that leads to more output voltage deviation than we see on the data sheet because they dont consider that situation.

They are both certainly usable though. In the old days i've used the 7805 for various TTL circuits. I've also used the 78L05 which is the lower power version and smaller package. i only went to a better 5v regulator when i needed very low quiescent current running a microcontroller from a car battery for extended periods.
 
Top