19V PSU charging 12V lead acid battery - Page 1
Forum section: electronics / beginners

author: nuclearcat
author_rank: Unknown
timestamp: September 16, 2019, 04:20:09 pm
content: Is it ok to charge lead acid battery by PWM controlled circuit powered by 19V PSU? (no typical step-down circuitry, such as inductor/capacitor, just MOSFET switching voltage on/off).I plan to measure the voltage on the battery using the ADC + resistor divider, and increase the duty cycle until the voltage does not exceed the allowable for this type of battery.Of course I will use PSU with soft overcurrent protection, such way i wont exceed allowed charging current.

author: Zero999
author_rank: Super Contributor
timestamp: September 16, 2019, 05:22:54 pm
content: Just one question: why?A power supply with overcurrent protection, will likely not be designed to operate in constant current mode. The actual current limit could be higher than the rating and it much simply shut down, when it's exceeded, rather than regulating the current.You need a constant current power supply for this to work properly, but it also needs to safely work open circuit. An LED driver might be more suitable, but why not simply buy a lead acid battery charger in the first place?

author: nuclearcat
author_rank: Unknown
timestamp: September 16, 2019, 05:39:08 pm
content: You're right, I'd rather make an additional discrete circuit to limit the charging current pulse. I just fear that even in a PWM mode, in a short pulse (the average current will not exceed the maximum) high momentary current will cause some harm to the battery...Reason of such strange solution - 3rd world country problems, mostly.I'm not looking for a way to make an efficient charger, but i hoped PWM will be a little better than a heater in the form of a linear adjustable regulator (like it is done in cheap APC UPS).The end device is customizable DC UPS + load control, it is based on ESP8266, so most of parameters will be adjusted in software.Since probably underqualified electricians will install it, i am trying to make the device as simple as possible. Unfortunately LEGO from different modules will not work in such case.A maximum of three connectors, a battery (protection against reverse polarity), a power supply (barrel jack wont allow such mistake), and load (barrel plug, no mistake possible as well).One of the requirements to the device - inexpensive. Existing devices are excellent electronic waste generators, with lithium batteries that sometimes explode, and often just die very early, additionally there is no supply of good quality lithium batteries in this country.I want to make a device that will work with an available common power supplies and an affordable, replaceable lead-acid battery (lead-acid batteries are recycled here). Maybe it will be some 9V supply + 6V battery. Or laptop power supply (19V mostly) and 12V battery.

author: AVGresponding
author_rank: Super Contributor
timestamp: September 16, 2019, 06:13:02 pm
content: Perhaps a small automotive lamp in series with the PSU output?More information would be helpful, like the output current of the PSU, the type of lead acid battery (wet, gel etc) and its capacity

author: KL27x
author_rank: Super Contributor
timestamp: September 16, 2019, 06:18:45 pm
content: I say why not?With the battery on there, you have a buck converter, essentially. Car battery is not picky. As long as the PSU handles it, I don't see any problem.

author: nuclearcat
author_rank: Unknown
timestamp: September 16, 2019, 06:26:30 pm
content: Quote from: ThickPhilM on September 16, 2019, 06:13:02 pmLamp is worse than adjustable linear regulatorLet's assume PSU current is sufficient in any case, i dropped idea relying on PSU current limit.Most likely not smaller than 12V 2.6Ah gel, this means with max 0.1C it should be 0.26A. As i charge by PWM, probably in pulse i can use 0.2C (if i wont exceed 50% duty cycle). I plan to implement it by using typical 2 NPN transistor circuit.But thats the question, if battery chemistry is ok with fact, that on 10-20khz PWM pulse current is 0.2C, but average current is 0.1C.

author: nuclearcat
author_rank: Unknown
timestamp: September 16, 2019, 06:27:24 pm
content: Quote from: KL27x on September 16, 2019, 06:18:45 pmIt's not car battery, small UPS gel battery, they look awful if they start gassing

author: magic
author_rank: Super Contributor
timestamp: September 16, 2019, 07:04:23 pm
content: Quote from: KL27x on September 16, 2019, 06:18:45 pmCertainly not a buck. As far as a 19V PSU is concerned, the battery across its output is a dead short. It will dump its maximum output current into it. The output capacitors will rapidly discharge when the switched is turned on, possibly shortening their life after many such cycles.If the PSU is crap, it may even overheat if it permits more than its maximum allowable current to be drawn in peaks. 2A at 50% duty cycle is more heat than constant 1A.Quote from: nuclearcat on September 16, 2019, 06:26:30 pmNo such thingThe PSU will output the maximum current it can, unless battery ESR limits it (probably not).Don't like that? Add a choke in series with the battery. And a diode, like in buck converters. If inductance and PWM frequency are high enough, current will be smoothed into almost DC.

author: Zero999
author_rank: Super Contributor
timestamp: September 16, 2019, 07:07:37 pm
content: Quote from: KL27x on September 16, 2019, 06:18:45 pmBut it isn't a buck converter, until you at least add an inductor, which is a very important part of a buck converter.An inductor limits the current, when the transistor is on and keeps the current flowing, when it's off. Without it, the current will only be limited by the power supply and no current will flow, when the transistor turns off. He wants to use a current limited power supply, presumably one with a constant current mode, which will definitely work, but a generic off the shelf power supply won't be guaranteed to behave in this manner.https://en.wikipedia.org/wiki/Buck_converterhttp://rohmfs.rohm.com/en/products/databook/applinote/ic/power/switching_regulator/inductor_calculation_appli-e.pdfhttp://www.ti.com/lit/an/slva477b/slva477b.pdfAn inductor and a diode is all that's required to turn this circuit into a buck converter. There doesn't need to be a capacitor, because the battery will act as one, although a small capacitor would be a good idea.

author: magic
author_rank: Super Contributor
timestamp: September 16, 2019, 07:19:52 pm
content: I have a PFC choke harvested from an ATX power supply which is about 1mH and capable of a few amps. Hopefully that's typical for similar chokes.19V-12V is 7V across the choke and therefore 7A/ms rise of current during on time, 12A/ms fall during off time. With 100kHz PWM that seems like it ought to be less than 100mA ripple (too lazy to do exact math).editOr, dunno, just get a PSU which current-limits at about 0.5A into 12V (to be determined empirically) and you will get the kind of pulsed waveform you initially wanted, averaging to 0.25A. I don't know how it affects battery chemistry, though.

author: nuclearcat
author_rank: Unknown
timestamp: September 16, 2019, 08:03:03 pm
content: Quote from: magic on September 16, 2019, 07:19:52 pmIt seems i will buy some small batteries, lock them in explosive-proof container with ventilation, and will do tests in extreme modes. I think its best way to know.

author: wraper
author_rank: Unknown
timestamp: September 16, 2019, 08:09:55 pm
content: Quote from: KL27x on September 16, 2019, 06:18:45 pmIt's as far as you can get from buck converter. You are shorting charged capacitor into battery with very low internal resistance. If this somehow works and pass element for PWM won't fail due to very high peak current, then output capacitor of PSU will certainly fail after some time due to extreme ripple current.

author: magic
author_rank: Super Contributor
timestamp: September 16, 2019, 08:46:18 pm
content: Another option: just screw PWM altogether.Low power 12V PSU bricks are common everywhere. Find one with 250mA max current, then it's a matter of changing or adding one resistor to increase its target output voltage to 14V. Then as long as battery voltage is less than the target, the PSU will just keep charging with its maximum current.

author: nuclearcat
author_rank: Unknown
timestamp: September 16, 2019, 08:48:08 pm
content: Quote from: magic on September 16, 2019, 08:46:18 pmGood option as well, thanks for idea.

author: KL27x
author_rank: Super Contributor
timestamp: September 16, 2019, 08:50:26 pm
content: QuoteOk, geniuses.You've gone this far. Add the frigging inductor. In this case you don't even need an inductor. Just a power resistor in series. Done.Battery is your Q. Add resistor. You have a low pass filter and the power resistor drops most all the excess voltage. As I said, as long as the PSU is happy to provide the juice, you're good.Is there another way to do it? Yeah. Is it better? No. This is a perfectly adequate and perfectly sensible way to charge a lead acid battery, if you desire to have voltage sensing/cutoff and adjustable control over max current and you already have a 19V PSU on your hands. (IMO). If efficiency is important, you could build or buy a proper buck converter with inductor.

author: nuclearcat
author_rank: Unknown
timestamp: September 16, 2019, 08:52:32 pm
content: Quote from: KL27x on September 16, 2019, 08:50:26 pmProbably this circuit will generate less heat:

author: mikerj
author_rank: Super Contributor
timestamp: September 16, 2019, 10:13:43 pm
content: Quote from: KL27x on September 16, 2019, 08:50:26 pmThe point being made was that a buck converter requires an inductor. Adding a resistor to limit current defeats the point of using PWM in the first place.What do you mean by "Battery is your Q"? Lead acid batteries are not particularly inductive, what am I overlooking?

author: magic
author_rank: Super Contributor
timestamp: September 17, 2019, 06:24:53 am
content: Quote from: nuclearcat on September 16, 2019, 08:52:32 pmThat's a constant current source? Nope, it's a linear regulator which will generate exactly as much heat as any other linear regulator: 7V times charging current.

author: KL27x
author_rank: Super Contributor
timestamp: September 17, 2019, 06:28:09 am
content: QuoteNo it doesn't defeat the purpose; the purpose being to safely charge a lead acid battery. It means you can adjust/limit the current, and without needing a full voltage regulator. I somehow doubt he is concerned with efficiency. The resistor is not there to limit the current to the battery. The resistor is there to drop the excess voltage that someone correctly complained is going to wreck the PSU. It's there to limit the current to the max of the PSU, say (19V-10V)/(MAX PSU Amps) =R. The PWM is to adjust the current to the battery.You got your power source sorted out with a single power resistor, and now you can get on with charging your battery using your ADC/comparator and micro/logic circuitry and output FET. You can tweak the max current settings for any size lead acid battery you want. You can set it to automatically throttle back to keep the voltage of the battery at 13.8V once it reaches that mark.QuoteYeah, you're right. I mean to say "C" not "Q." Brain fart.If adding a resistor defeats the purpose of PWM, then every LED that is PWM'd is "defeating the purpose," since it also needs current limiting or some sort to avoid shorting the power supply. The PWM gives the ability to turn down the current.

author: magic
author_rank: Super Contributor
timestamp: September 17, 2019, 06:33:38 am
content: Quote from: KL27x on September 17, 2019, 06:28:09 amIt doesIt's the first time I see anybody call resistive dropper a "buck converter".Buck converter is that thingy with a coil, a power switch and a rectifier.

author: Zero999
author_rank: Super Contributor
timestamp: September 17, 2019, 07:59:32 am
content: Quote from: nuclearcat on September 16, 2019, 08:52:32 pmIf you don't mind a linear regulator, then how about the LM317?

author: nuclearcat
author_rank: Unknown
timestamp: September 17, 2019, 08:58:25 am
content: Quote from: Zero999 on September 17, 2019, 07:59:32 amIt will work too, but probably i will check if feasible to use regulator to charge in CV mode, a bit different circuit, and i have to check if i can offset Vadj from MCU, as its better to charge a bit faster empty battery (maybe PWM + RC + opamp?).

author: Zero999
author_rank: Super Contributor
timestamp: September 17, 2019, 09:10:10 am
content: Quote from: nuclearcat on September 17, 2019, 08:58:25 amThe idea is to keep the current constant and turn it off, when the battery voltage rises too high.

author: nuclearcat
author_rank: Unknown
timestamp: September 17, 2019, 11:47:51 am
content: Quote from: Zero999 on September 17, 2019, 09:10:10 amI am planning to measure battery idle voltage and probably apply higher current if state of charge is low. Also it will be nice if i can adjust offset, according to temperature and battery capacity (including approximating capacity loss with age). Its cheap to do, make charging faster (outages too frequency in my country to charge slowest way), and will increase lifespan of battery.

author: AVGresponding
author_rank: Super Contributor
timestamp: September 17, 2019, 05:26:43 pm
content: Quote from: nuclearcat on September 16, 2019, 06:26:30 pmWell, I was making a couple of guesses based on your previous posts, ie that you were looking for lowest complexity due to 'third world issues', and that you were using small car or motorbike wet lead acid batteries.Now that I know you're using very small gel types, that changes things significantly.Gel aka AGM type lead acid batteries really don't like over-voltage situations, especially very small ones, and doubly especially the likely low quality ones you'll be using, which will have a lot of very impure recycled lead in the plates. Do not use a pwm regulated 19v supply, you will kill the battery in a year or so, depending on a couple of other things (ambient temperature, depth of cycling).Cyclic charging of these batteries requires a constant current for the bulk charge, and a constant voltage for equalisation. PWM charging from a 19v source is not a good idea, a simple linear regulator and current limiting resistor are the best bet for such small batteries. A laptop charger is massive overkill.C/2 is more than adequate for the bulk charge in this case, exceed C and youwillcook it. Float current shouldn't be more than a few tens of milliamps at most, if it draws more, it's on its way out.Do not believe the manufacturers datasheets on charge voltages; they want to sell you more batteries.If you want a good lifespan, a float charge voltage 13.6v really is the highest you should go, cyclic use, 13.8v, but don't let it sit at that voltage for more than a couple of hours.The quality of these batteries varies considerably. Cheap Chinese ones are not very different from cheap Chinese NiMH in their capacity claims in my experience; adjust your bulk charge rates accordingly.With reasonable ambient temperatures, and sympathetic charge/discharge profiles, I've had good quality batteries last 20 years.I've also seen good quality batteries cooked in months, by crappy quality/badly adjusted chargers. Some of the bigger ones can be quite exciting when they fail

author: nuclearcat
author_rank: Unknown
timestamp: September 17, 2019, 05:45:13 pm
content: Quote from: ThickPhilM on September 17, 2019, 05:26:43 pmThank you very much for the detailed advice!!!Most likely I will go this way, bulk charge stage C/2 (max) or even less current, depending on the remaining battery capacity and temperature, and static CV, 13.6V for equalizing charge.Probably i will not do it simplest way, as little bit more components will increase a lot efficiency and reliability of solution.I will use ADC from ESP8266 to measure battery voltage, one pin to enable topping charge, and1) I2S/PWM for current offset over RC, to LM317.or2) I2S/PWM driving crude step-down buck converter (which is more preferable, as more efficient, but probably more tricky to implement)I am considering also to shift measurement range from 0-14V to 12-14V by using inverting opamp with virtual ground at 12V, but probably better to open separate topic for that.

author: iMo
author_rank: Super Contributor
timestamp: September 17, 2019, 07:33:16 pm
content: I would go with RPi 4 (4GB ram), LTZ1000 as the Vref, double ovenized OCXO for precise PWM, LTC2500-32 ADC, 0.001% 0.1ppm/C shunt. Your lead acid battery will be pretty happy then

author: floobydust
author_rank: Super Contributor
timestamp: September 17, 2019, 08:22:41 pm
content: But the lead acid battery tempco is -3.3mV to -6.7mV/°C/cell ... it goes in the oven too?I think a car battery charger with Wi-Fi is useful, you can remotely check up on it instead of walking back and forth to the garage. Lowest cost would be to mod the 19V laptop adapter to put out less, say 14V or whatever an MCU commands with PWM, but that is beyond a beginner's project. A PWM controller buck-converter or linear regulator might be something basic to add after the 19V PSU.ESP8266 has a crappy A/D, not good enough here. Noisy, non-linear 10-bit 0-1V input range, poor accuracy you need to calibrate it and have to shut off the RF TX circuit to get a reasonable reading. I thought the internal 1V reference does poor over temperature too but can't find that correction graph.https://www.espressif.com/en/support/download/documents

author: iMo
author_rank: Super Contributor
timestamp: September 17, 2019, 09:30:37 pm
content: Here is the simplest CC CV charger I saw somewhere in past.And it works, I've been using it from time to time (nimh, lion).Use it at your own riskPS:I_charging = 1.25V / R1 [A, ohm] max 1A, LM317 likes a small heatsink, R1 2-3WVbat = (R2+R3)/R3 * 2.5V TL431 trips at aprox 2.500V

author: nuclearcat
author_rank: Unknown
timestamp: September 17, 2019, 11:26:38 pm
content: Quote from: floobydust on September 17, 2019, 08:22:41 pmPurpose of device is a bit different. I am living in country where government supplied electricity lasts max 12-18hours per day, when it go off, in some households private generator supply kicks in (still, it takes 30-60 seconds, enough to reboot router or DSL modem), or if it is less fortunate people - they stay in dark. Sometimes electricity supply is very unstable and might go on/off tens of times per day. Regular offline UPS doesn't last long, too much conversion losses, and need some hacking (hacking away buzzer, hehe).This device will be connected in the middle, between AC/DC SMPS and wifi router, to provide continuous supply, so at least people can stay online from their mobiles. Most of routers is OK with 14V (step-down buck inside, only problem sometimes caps max voltage on DC IN), but on some old routers i seen LDO, there i i can use cheap LM2596 step-down brick.ESP8266 will keep an eye on battery voltage, and if it is too low, send data to cloud/owner mobile, cut off router, lower power usage as much as possible (disable RF) until mains appears, and then if still no supply, next level go to deep sleep and wake each 5 minute, to check if power appeared. It will be easy to implement additional functions, battery health monitoring, remaining runtime, programming some router cut-off for night time and etc.I am considering to make it OSHW, if it will work fine.

author: MarkF
author_rank: Super Contributor
timestamp: September 17, 2019, 11:49:31 pm
content: Also see:https://www.eevblog.com/forum/beginners/bench-power-supply-battery-charging-circuit/

author: nuclearcat
author_rank: Unknown
timestamp: September 18, 2019, 05:30:26 am
content: Quote from: floobydust on September 17, 2019, 08:22:41 pmThat make me wonder if it is better to add some $1 STM32F0/F1, simplify some circuits and have more measurement points (current + voltage, proper PWM, sleep modes, etc).Seems ESP8266 is not great for anything than very generic MCU jobs and as wifi bridge.