Shop OBEX P1 Docs P2 Docs Learn Events
Problems with a super simple lm317 charger circuit — Parallax Forums

Problems with a super simple lm317 charger circuit

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2013-01-02 05:19 in General Discussion
So im trying to charge my 19.2v battery pack and I decided I would just do a simple 220mA for 12 hour type charge since 16 cells is alot im trying to play it safe. Well i bread boarded up this circuit I found

CircuitB.gif


Right now im using a 12v 1.2amp wal wart and a 9.6v NiCad battery for testing. I plan to bump up to a 30v wal wart when I charge the 19.2v battery. Anyways I built this circuit and put my meter in series with the battery and im only reading .86mA and 10.88 volts, the idea of this circuit is to get a constant 12v 220mA output its the second example on this page http://www.talkingelectronics.com/projects/ChargingNiMH/ChargingNiMH.html the only thing i did differently was use a 2n222 transistor. Im kind of in a jam my 19.2v nimh pack is dead and I just need to get something simple to do a .10c charge on it for now
420 x 200 - 4K

Comments

  • RDL2004RDL2004 Posts: 2,554
    edited 2012-12-31 00:59
    The output voltage is going to vary depending on the charge on the battery. Just try using a single resistor and see if you can get it working that way. The formula is I = 1.25/R, so you need about a 5.7 ohm resistor. The LM317 is probably going to need a decent sized heat sink.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-12-31 02:31
    So I fed 12v in the regulator the connected the adj pin to the batterys positive terminal, this made the regulators output 1.2v higher than the battery, on the output I added a 5 ohm resistor(well two 10 ohm in parallel}, I then connected the resistors to the batterys terminal also, Im now reading 38 ma and 10.5v at the battery's terminal, instead of 11.7v and 220ma
  • RDL2004RDL2004 Posts: 2,554
    edited 2012-12-31 05:31
    The way you have it set up, with the 5 ohm resistor and the battery in the circuit and 1.25 volts across the resistor, what is the voltage going into the LM317?
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-12-31 05:44
    Mi guess is the wall wort is either defective or is not filtered.

    The LM317 with the 5 ohm resister is bullet proof. It has to work.

    Make sure:
    1. It has filter capacitors so the voltage is a constant DC, or add capacitors until it's reasonably constant.
    2. The LM317 is over heating and cutting back the 1.25V output to save itself.
    3. Get another wall wort.

    Duane J
  • RDL2004RDL2004 Posts: 2,554
    edited 2012-12-31 07:33
    or if it's a regulated 12 volt adapter, won't that be a problem also? I've never made an LM317 charger, but it seems like the input voltage needs to be higher than the battery voltage by1.25 volts + the dropout voltage. That's why I asked what the input voltage was to the LM317.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-12-31 08:04
    Yes, the dropout voltage for the LM317 at 200mA is about 1.7V for a total of 2.95V. So the wall wort has to output a steady voltage of at least 3V higher than the maximum voltage on the battery.

    Duane J
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-12-31 10:37
    Ok so I think alot of the problem was noise on the wal wart, its a pretty bad adjustable switching supply, its got almost .5v of ripple with no filtering. I also switched down to a 2.4v cell for testing and everything works fine, but im a bit confused here, when I connected everything it worked, when I uped the lm317 input to 12v it fried my two resistors, these were two 1/4 watts in parrallel, making 1/2 watt right? 1.2 x 250mA is 300mA which is under half a watt, and it only fried when I boosted the input voltage from 6v, any reason for this? All I have for bigger 10ohm is huge 10watt sandbars, and using two of those is a bit overkill
  • RDL2004RDL2004 Posts: 2,554
    edited 2012-12-31 11:20
    It doesn't seem like it should have been a problem. The LM317 will get hotter, but the voltage across the resistors should have stayed at 1.25v and the current shouldn't change. Maybe the resistors were borderline and also they may not share the load exactly equally. I would just use the sand bars or more small resistors, like 3x 15 ohm or 8x 47 ohm or something.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-12-31 12:08
    The weird thing is the resistors puffed in smoke, then turned black, but still read 10.5 ohm lol. I have some higher wattage 1% metal films I got in surplus junk maybe ill just throw a bunch of those in parallel. What is bothering me is the circuit worked just fine and as soon as I switched the input voltage to 12v on the lm317 from 6v (mostly to test the heat) the resistors just failed, like you said nothing should have changed across the resistors.

    BTW since ive gotten a scope and checked out my switching regulators ripple voltage ive found something out. The 15 dollar adjustable wal warts at wal mart are horrible, these things put out .5v or ripple under load, thats insanely awfull, my hand built switchers only put out about 20mV of ripple. This was my original problem I wasnt filtering the WalWart, I had to stick a 2200uF cap across its output to get anything with a reasonable and sane amount of ripple/noise. Just a tip for anyone else using these adjustable wal-warts from wal mart as there main little power supply.
  • RDL2004RDL2004 Posts: 2,554
    edited 2012-12-31 12:30
    Here are some measurements I made experimenting with an LM317, just to give you an idea of how hot it will get.
    I wasn't charging a battery or anything, just had a 4 ohm resistor on the output and a bench type variable power supply.
    I had a pretty hefty heatsink on the LM317. Without the heatsink it was easy to drive it into thermal shutdown.
    V in     V out     I out     Temp     Power Dissipation
    ____     _____     _____     _____    _________________
    
    20       1.25      0.30      125 F    5.6 watts
    15       1.25      0.30      105 F    4.1 watts
    12       1.25      0.30       95 F    3.2 watts
     6       1.25      0.30       80 F    1.4 watts 
     3       0.938     0.22       75 F    0.4 watts
    
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-12-31 12:36
    I plan to use a 30v Wal Wart, i need it to charge up to about 20v. What if I use a switcher to bring the wall wart supply down to 23/24v from 30v, this should save me alot on heat right, since im not burning off that extra 6v? Or is just running the 30v to the lm317 directly and putting a heatsink on it the way to go? Will the switcher before the lm317 really make a big difference?
  • RDL2004RDL2004 Posts: 2,554
    edited 2012-12-31 13:17
    What will the voltage of the battery be when the charging cycle starts? That's when the LM317 will be running the hottest. As the battery charges and its voltage goes up, the LM317 Vin/Vout difference will go down. I think you should be fine as long as you use a good heat sink, not one of those thin stamped things from Radio Shack. As you can see, at 20v in and 1.25 out, it only hit 125 degrees at 300 mA.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2012-12-31 14:33
    The weird thing is the resistors puffed in smoke, then turned black, but still read 10.5 ohm lol. I have some higher wattage 1% metal films I got in surplus junk maybe ill just throw a bunch of those in parallel. What is bothering me is the circuit worked just fine and as soon as I switched the input voltage to 12v on the lm317 from 6v (mostly to test the heat) the resistors just failed, like you said nothing should have changed across the resistors. .

    If you have the ADJ pin and the OUT pin mix up as far as the output power it will fry the resistors this has happen to me before just make sure you are doing it on the right pin

    The way I check to see if I have it the right way is short the the (+) to the (-) on the output side of the LM317 to my meter to see if I am getting the millamp that I should with the resistor I used

    Do this very quickly just long enough to get a reading on your meter

    NOTE only do this on a one amp power supply or less for safety reasons
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-12-31 15:32
    f Well i got this working with my 16cell pack and the 30v wal supply. I pulled a massive to220 sink off a mobo, its one of those extruded aluminium syncs kind of oval shaped works well even on a 9.6v nicad. CHarged the pack for about 30mins and it jumped from 15 to 22v. Turned it off when i left though didnt think it was wise to leave a bread board charger running at those voltages.

    I was using The two 10watt 10ohm sandbars, so thats 5ohms rated for 20watts and they were outputting the correct 240ma but they acually rose to room tempature from a cold touch with in a few minutes, so there is definately something wrong there.. i need to test the current flowing in to the resistors when i get back. Im sure my pins are connected right i got the regulators from ti and there data sheet shows pin 2 as out and 1 as adjust the resistors are connected on pin 2 and read 1.25v across them!
  • RDL2004RDL2004 Posts: 2,554
    edited 2013-01-01 00:45
    they acually rose to room tempature from a cold touch with in a few minutes, so there is definately something wrong there..

    The resistors are dissipating close to 1/4 watt each, I'd expect them to warm up a bit. If the measured current is correct I wouldn't worry about it. If this is going to be some kind of semi-permanent project I'd put an ammeter on the output just to make it easy to keep an eye on what's actually happening. You can find cheap ones on eBay for under $10. I prefer analog meters for current measuring.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2013-01-01 01:24
    The resistors are drawing .24 amps like the should. Am i doing something wrong, you said there drawing a quarter watt each, by my math in this circuit there drawing 15mW each, since im using two 10ohm in parallel

    .24*1.25=30mW/2=15mW

    Ive had my pack charging for about 4 hours with no problems, but i really need to get this on protoboard and in an enclosure. Space is tight theres already 16 batterys, the switching regulators, and i need to fit this circuit with and an atmega168 with ds1620, and a display for amps and volts. So you can see why i want to dith two huge sand bars

    heres the space i have to work with, sry cant embed images on my phone

    http://db.tt/aT8NpR2X
  • RDL2004RDL2004 Posts: 2,554
    edited 2013-01-01 03:18
    I tend to round things up and I was using .300 amps. I think it's actually .24 A * 1.25 V = .3 W , or 300 mW, 150 mW per resistor. I had some 1/2 watt 10 ohm 1% Vishay/Dale resistors in my last Mouser order. I only need 10 (makes a cheap 1% 1 ohm in parallel), so I have a few extra. If you'd like a couple, I can drop them in the mail tomorrow. If the Post Office sorting machines don't chew them up, you could maybe get them by the week-end or at least early next week. Just PM me a street address address if you want.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-01-01 04:03
    .24*1.25=30mW/2=15mW
    .24*1.25= 30mW/2= 15mW not correct.
    .24*1.25=300mW/2=150mW

    Duane J
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2013-01-01 12:01
    @Duane it was late when I posted, I meant 150 mW :)

    @RDL thank you for the offer, like I said I have a bunch of 1% metal films around I just tested 4 20ohms in parallel and its working fine :). I have no idea why the first resistors I used blew out like that. Im thinking about implementing a digital pot so I can change the current output.

    I woke up this morning after a 12 hour charge or so and my batterys were about 100 degrees to the touch, and the pack read 23v, so I took them off the charger. When I built the pack I used thermal compound and jbweld to hold 16 cells togather. I was looking to get about 19.2v, so I would supply 18v to my motors after the hbridge voltage drop. The cells say there 1.2v so 16 would be 19.2. I know a fully charged battery usually has a bit of a higher capacity than whats its labeled as but is there a way to charge the packs capacity fully but only to 19.2v or so? Fresh out of the package these things made a 19.6v cell which is good but 22v is a bit to much on my motors, 18v is pretty much maxing them out so I dont want to run them at 22v, but I dont want to short change my packs capacity either
  • kwinnkwinn Posts: 8,697
    edited 2013-01-01 23:58
    23V is the no load voltage, and once you start to draw current it will drop some so I would not worry about that.

    Attached is a simpler version of the constant current supply you are using. It needs an input voltage about 5V higher than the voltage of the battery you are charging and Ri should be about 2.2 to 2.7 ohms for the current you want. The power dissipation of the resistors will be around 0.15W so a 1/4 watt resistor should work. I have used the same circuit with a 0.1 ohm resistor and 2N3055 transistor to provide a 6 amp charging current.
    315 x 320 - 5K
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2013-01-02 01:50
    So what is the advantage of this circuit over just using the 1/2watt 5ohm resistor? So what is the advantage of this circuit over just using the 1/2watt 5ohm resistor?
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-01-02 05:19
    So what is the advantage of this circuit over just using the 1/2watt 5ohm resistor? So what is the advantage of this circuit over just using the 1/2watt 5ohm resistor?
    Most of the power dissipation is in the power transistor so the current is fairly stable.

    Duane J
Sign In or Register to comment.