Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Lm317 power supply question?

Status
Not open for further replies.

Dirk.S

New Member
Hello Everyone

I hope that you all are doing really well. The project that I'm busy with is a little battery charger that will disengage when a set voltage is reached and engage again when the battery is drained to a certain point. I'm basing my design on the circuit I've gotten from the following website:

https://electronics-diy.com/automatic-battery-charger-2.php

with a closeup of the circuit part which will disengage and engage the charging process over here:

https://electronics-diy.com/schematics/1155/akucharger_schematics.jpg

Now this circuit listed above needs a power supply to drive it so I've consulted the LM317 datasheet and came up to the point of the lab power supply circuit as can be seen from the attached picture below or if you have the datasheet on page 8 of the datasheet.

Labratory Power Supply Circuit Diagram with Voltage and Current limiting.png


The reason I thought that I would go with this specific arrangement is that I could limit the current the way that I would like to i.e. to charge the battery attached at a certain current (Lead acid battery). Now I've see in the picture and in the datasheet that I will need to supply a negative 10 V to the transistors that goes to the adjust leg of the LM317.

The datasheet states the following:
To provide current limiting of IO to the system ground, the source of the FET must be tied to a negative voltage below - 1.25 V.

So I thought that I would use a secondary 12V winding from the transformer I hope to use to power the another circuit which inverts the 12V to a negative 12V which I aim to feed into this point. The voltage inverting circuit I found over here:

**broken link removed**

I just wanted to find out if this would work or whether it would be a bust. I've put the circuit on eagle (also attached below) and want to continue with the PCB design but don't want to continue if I'm wrong here. Your inputs are greatly appreciated, thank you in advance.

Labratory Power Supply Circuit Diagram with Voltage and Current limiting - Eagle Screenshot.png
 
Hello there

Thanks for the info. I've got small 12V batteries that I've salvaged out of a UPS:
**broken link removed**

So I'll be charging at around 500mA I think.

FWIW: The FET and the -10 V source allow the voltage to go below 1.2 V.

So that means that I can remove the FETs with the diodes since I won't be dropping the voltage below 12 V. In the current limiting stage would this mean that I can remove the diodes going around the POT and take the both POTs directly to ground?
 
Q1 generates a constant current through the 1.0K current adjust pot so that the current adjust is essentially independent of the output voltage. If you remove Q1, then the current limit will depend upon the output voltage at the limit point.

Am alternate way to adjust the current is to make R2 a power rheostat and connect the output directly to the ADJ terminal. In that case the current limit equals 1.2V / R2(setting).
 
Last edited:
Basically yes.

If you can live with a fiex current limit, it would be getter to eliminate VR1. The ADJ terminal would go to the right side of R2. R2 has to be rated for the full current. I lim = 1.2/R2.

.Crutshow covered the variable current adjust. The FET is a constant current source.

I've used the LM317 in the 2-terminal current limit mode before, but never tried to make it variable.

There is an LM317 based lead acid charger in the "Help with water pump thread" that you may wan to take a look at.

22 VAC might be too high of a voltage. your looking at 1.414 * 22 - (2*3) - 2* 0.6) as the minimum unregulated voltage you need.
The 1.414 is the sqrt(2) which converts to peak. The caps charge at the peak V. You have 2 LM317's which need 3 V to work reliably and there is 2 0.6V drops in the bridge.

The (Vin-Vout)/*Iout has to be dissipated as heat.

The rule of thumb for power supply caps is 1000 uF/Amp.

I'd allso take a look at www.batteryuniversity.com and learn about charging techniques.
 
Hello Gentlemen

Thank you for the response and the feedback. I've went ahead and revised the circuit as suggested by Crutschow. Now I've done the calculations as suggested and found that if I have a resistance of 12 Ohms then I will have the current limited at around 100mA. Alternatively if I want to go and limit the current around 1 A then the resister will have to have a value of 1.25 Ohm. So this means that I can place a variable resistor with a value of 12 ohms or 10 ohms (will get a minimum current of 125.1 mA when resistor is set to 10 Ohms)

But then it comes to cost, the variable resistor will have to dissipate a power of 1.25 W which means I will have to use a 2 W potentiometer which is expensive. So I've revised the circuit again to implement dip switches as can be seen from the original link that I've posted. This will allow me to use fixed resistors and then I can toggle one of them into action to get the desired current that I want, which will be fixed according to the selected resistor. Revised circuit below, let me know what your thoughts are.

Revised PSU 2.png
 
Regarding the second picture in the first post, 21Vac will not give you 21Vdc after being rectified, more like 29.7Vdc. The same goes for the 12V.
 
in the circuit providing -12V, why didn't you just turn the rectifier around? you would get a negative output voltage without the inverting circuit.
 
Here is an alternative that gives the adjustable current limit. None of these will be superfast charging the battery because they need to be set to 13.6 volts so the battery can stay connected all the time.
I used a 16 volt (RMS) transformer so the 317 won't get quite so hot.
 

Attachments

  • chgr.png
    chgr.png
    148.9 KB · Views: 396
Here is an alternative that gives the adjustable current limit. None of these will be superfast charging the battery because they need to be set to 13.6 volts so the battery can stay connected all the time.
I used a 16 volt (RMS) transformer so the 317 won't get quite so hot.
Looks like a good circuit. The only minor concern is that, for a short circuit, the output current limit will be 1.2V / R12, independent of the U5 current limit setting, since the minimum output voltage is 1.2V. But that's probably not a problem for most applications, particularly battery charging.
 
Here is an alternative that gives the adjustable current limit. None of these will be superfast charging the battery because they need to be set to 13.6 volts so the battery can stay connected all the time.
I used a 16 volt (RMS) transformer so the 317 won't get quite so hot.

hi Ron,
Attached my LTSpice files for SLA batteries, 12V and 6v versions, batt_sla and batt_6sla, together with a couple of asc test circuits. [also a few odds and ends.;)]
Sorry, had to zip it in order to upload.
Eric
btw: these may help.
https://www.electro-tech-online.com/tools/LM317V2.php

https://www.electro-tech-online.com/tools/PSUCapV1.php
 

Attachments

  • ron_sla1.zip
    10 KB · Views: 262
Last edited by a moderator:
Hello Everyone

Thank you for all the input so far, I really appreciate it. I think that I'm going to stick to the last revision of the circuit that I've done and play around from there.

DIP switches usually can't handle 1A.
Found one that will be able to handle it.

Regarding the second picture in the first post, 21Vac will not give you 21Vdc after being rectified, more like 29.7Vdc. The same goes for the 12V.
I'm sorry it's been a while since I've worked at component level so now I've rediscovered it I don't remember a lot anymore, thanks pointing that out. The unit will still be able to operate although the heat dissipation will be considerably more. Maybe I will switch over to the 12V winding which will yield around 17V after rectification.

in the circuit providing -12V, why didn't you just turn the rectifier around? you would get a negative output voltage without the inverting circuit.
I'm not sure how to accomplish that, will I have to add an additional rectifier to be able to get the negative part?
 
Note that you can turn more than one of the switches on at a time to get a greater adjustment range of the current. That would reduce the number of needed resistors. For example, a resistor binary sequence ratio of 1, 2, 4, 8 will allow 15 steps of current to be selected. The maximum resistor sequence value would be 8 and the minimum would be all switches ON in parallel for a minimum value of 0.533.
 
Eric,
Thanks for the models. I have been looking for something like that. The problem is that the 12 volt one clamps the charge voltage at 12.8 volts so a trickle charger like this one that runs at 13.6 volts never tapers off. I looked at the subcircuit, but I don't know enough about how to write them to try to modify it. So I just added a little voltage source in series with the charge side and made an output side - not very elegant.:oops:, but maybe I can make a subcircuit out of it so its cleaner?
The other thing that would be nice would be if you could make 1 second = 1 hour. Then when running with something like a transformer at 50Hz. it wouldn't be quite so slow. I didn't mean to hijack this thread please feel free to move this to the sim page,:)
Thanks, again!
PS. posted the asc.
 

Attachments

  • sla mod.png
    sla mod.png
    149.8 KB · Views: 346
  • sla mod.asc
    3.8 KB · Views: 335
hi Ron,
In the original bty sub VCELL = 2.133,,, so 6 * 2.133 = ~12.8Vmax
So change the VCELL to 13.8/6 = 2.3V,, for a 13.8Vmax

.SUBCKT Batt_SLA Ext+ Ext-
* Soc Rate_d Cells
*
.PARAM CELLS=6
.PARAM VCELL=2.3
.PARAM CAPAH=7.2
.PARAM R_SER=20m
.PARAM SOC=1
.PARAM CHEFF=0.75
.PARAM SELFDC=0.000042
.PARAM TEMPC=25

Also you should measure the voltage directly across the battery as per this image.

Eric
 

Attachments

  • AAesp02.gif
    AAesp02.gif
    39.8 KB · Views: 347
Thanks Eric. Bailed me out again. :D In hindsight I should have been able to figure that out. I got hung up on the statement in the sub about overcharge and discharge clamped with diodes. :banghead:
Thanks again!
 
hi Ron,
In the original bty sub VCELL = 2.133,,, so 6 * 2.133 = ~12.8Vmax
So change the VCELL to 13.8/6 = 2.3V,, for a 13.8Vmax

.SUBCKT Batt_SLA Ext+ Ext-
* Soc Rate_d Cells
*
.PARAM CELLS=6
.PARAM VCELL=2.3
.PARAM CAPAH=7.2
.PARAM R_SER=20m
.PARAM SOC=1
.PARAM CHEFF=0.75
.PARAM SELFDC=0.000042
.PARAM TEMPC=25

Also you should measure the voltage directly across the battery as per this image.

Eric
Hi Eric;
can this simulate battery capacitance/inductance eg. about 1F per 40 Ah capacity and inductance @ 1 uH per 30Ah?
 
Status
Not open for further replies.

Latest threads

Back
Top