Charging a battery from a custom circuit

Thread Starter

Imstevil

Joined Oct 23, 2020
3
Hi all,

I'm very new to electronics, please forgive me if what I'm asking is a silly question. I have tried searching for an answer but as I don't really know what I'm doing I could be searching for totally the wrong thing and not been able to find anything.

The people I work with have asked me to come up with a system that will run some motors off a battery if power is lost. An example might be a electric gate that automatically opens when the power goes out.

With my limited knowledge I was able to make this system fairly easy. My main background is as a programmer, so I used an atmega328p and had the power going directly to a input pin. I could do a check against that pin to see if the power went out, if it did I would use a hbridge to control the motor which would run of the battery. This all works fine, tested it and had no problems with it.

The problem I now I have though, is I need to keep the battery charged. The battery would be lucky to be used once every year or 2 (how ever often there is a blackout).

The system itself will be running off an 18v AC power, so using an if the shelf charger is not an option. They also want it to fit nicely inside a project box which would not be possible with off the shelf charging packs either.

I know you need to adjust voltage and current to ensure batteries don't over charge or get damaged. Making something like this is well beyond my knowledge, I searched for any ICs that can do it, but everything I found was for small batteries, to small for my usage anyways.

So I guess my long winded question is, does anyone know of an easy way to keep a battery charged long term for emergency back up use. If there is some sort of IC I could look into, or maybe if there is a way to pass in the minimal voltage / current to charge it over a long period of time that won't damage the battery.

I'm not really limited to the battery I use, I'm open to suggestions as to what would last the longest for this period of time and be the easiest to work with / charge. I'm currently using this

https://www.jaycar.com.au/12v-7-2ah-sla-battery-nbn-back-up-battery/p/SB2486

But can really get away with anything that will fit into a project box. The battery itself is used sparingly. When it used it's about 3amps being drawn for just under a minute.

Hope I've been able to explain things enough to make sense. An appreciate any help anyone may be able to offer me with this!
 

Dodgydave

Joined Jun 22, 2012
10,050
Yes those SLA batteries are kept charged at 13.8V DC, as used in most burglar alarms and fire alarms, you can use a simple LM317 chip with usual bridge rectifier and capacitor, or use a LM2596 ready made .
 
Last edited:

Tonyr1084

Joined Sep 24, 2015
6,267
I would imagine three 6V wet cell lead acid batteries in series to get the 18 volts desired. Their nominal voltage is 2.2 volts per cell, so 2.2(volts) x 9(cells) = 19.8 volts nominal. Float charge should be 2.3V per cell (2.3 x 9 = 20.7). The battery should be charged properly before being put on a float charge. The charge current shouldn't need to be very high because of seldom usage. Slowly charging them up to their float charge will keep them healthy. But don't let them fall below 2.0V per cell (18V) because battery sulfating can occur, leading do diminished current capabilities.

Another consideration is the duration of the power failure and the number of times the gate may be actuated. Heavy use will quickly deplete the batteries, so they must be large enough to withstand the usage. The LAST thing you need is a gate to stop half way open. Nobody can drive in and anyone can walk in.
 

LowQCab

Joined Nov 6, 2012
1,107
An Electric Gate that only draws 3 Amps ???, and for an entire Minute ???
How could the Gate be so slow ?
It must be for People, not Cars.
You neglected to say, whether or not, the Gate must Close after every Person, or Car.
How many times must the Gate open and close on Battery power ?
You say that you have 18vac to charge the Battery,
does this 18vac supply also operate the Gate Motor ?, or just the "Controls" for the Gate Motor ?
or is this a "Control Transformer" that runs on Mains Voltage, and you are just tapping in to it.
Does the Motor draw 3 Amps at 18vac, or 3 amps at Mains Voltage ?
Are you using a "Voltage Inverter" to create Mains Voltage for the Gate Motor ?
Within what Time Period must the Battery be Charged from Dead to Full ?
All of this information must be known to make a reasonable response.
The Battery that you have chosen, if it is completely adequate for the requirements,
requires roughly ~1 amp from the 18vac Supply for Charging,
is the 18vac Supply capable of operating the Gate Motor,
and providing an additional ~1amp for Charging the Battery at the same time ?
Is a ~14 hour Charge Time acceptable ?
If all you need is an Automatic Battery Charger, this will work perfectly ........
https://www.digikey.com/en/products...B97EAAhLA4OAn4ATwACAGEACyx+UVSMsAcAOlkANxYJIA
 

Thread Starter

Imstevil

Joined Oct 23, 2020
3
Yes those SLA batteries are kept charged at 13.8V DC, as used in most burglar alarms and fire alarms, you can use a simple LM317 chip with usual bridge rectifier and capacitor, or use a LM2596 ready made .
Thanks, I think this is what I was looking for! I picked up a couple of LM317s to play with and see how I go. If all else fails I'll give the LM2596 a go.

For anyone else who happens to come across this while searching for something similar, I found this link:-

https://www.eleccircuit.com/the-most-lead-acid-battery-charger-circuit-by-lm317/

Once I knew to look for LM317 to use to charge there is plenty of info out there including a few YouTube videos explaining it. I haven't been able to watch any of them to say how good they are, but are plenty on there.

Thanks again Dodgydave!
 

MisterBill2

Joined Jan 23, 2018
9,293
The process for keeping a battery charged is commonly called a "float charge" arrangement. The concept being that the charge circuit provides a small current to just overcome the effective self -discharge current plus a small bit more. Once you determine the specific battery size and model you can contact the manufacturer and ask for their recommended float charge voltage and current.
The one thing to beware of is that some times somebody wants a system to quickly recharge the battery after it is used a bit. The unfortunate result is that the much higher charge current setting replaces the float charge setting and the battery only lasts a few short months.
 

Thread Starter

Imstevil

Joined Oct 23, 2020
3
An Electric Gate that only draws 3 Amps ???, and for an entire Minute ???
How could the Gate be so slow ?
It must be for People, not Cars.
Sorry, I didn't want to go to far into the system and hold people up to much with things I thought would be pointless to the read. I know to include more next time =)

The system is actually for rural usage, so if power cuts out they may want to open a gate between paddocks if one of the water pumps might stop working, or open the door on a shed to let animals out if food / ventilation is cut due to no power.

The motors operate slowly so as to not scare animals. If you are trying to encourage chickens to leave their coop for example, you don't want any harsh movements as they'll run away from where they should be going towards.

Once the power is out, it only needs to open once off the battery, so the charge time on the battery is not really that important. As things stand they've only had this happen maybe 2 or 3 times in a matter of 10 years. So the life time of the battery is probably more important than the charging speed. They will do tests periodically to ensure the batteries are working though.

The 18V AC is the power supply they've asked me to use as they have lots of those left over from an old project and they are great for outdoor usage. So I'm using a rectifier to go from AC to DC, then a regulator to 5v to power the atmega. If there is a reason to use a different supply I probably could get away with it.

I think what dodgydave has told me should do the trick though. From what I've read so far there are several people using this to charge batteries for backup systems. I'm on the road a bit today so will do a bit more research into it when I can, but I think that should suit exactly what I'm looking for.

Appreciate your reply and help =) next time I'll be sure to give more info!
 

MisterBill2

Joined Jan 23, 2018
9,293
Good news about the gates and doors needing to be slow, and a very good reason to have them be slow. It is people who get impatient, not farm animals. And the system could have a momentary switch for fast charging, so that a person could put charge back into a battery faster if there ever was a need, but never leave it in a fast charge mode.

It happens that I am in the middle of a battery backup system for a powered chair used to help a friend stand up, when he needs to. If the power fails ay his house, which happens several times a year, twice in the past month, he is stuck in that chair. Last time he wound up having to call the 911 squad. Next time he will have battery power.
 
It was odd that a Drive Hospital bed that was delivered had the ability to use two 9V batteries for backup. The backup only works for the head and middle of the bed, not the height. Height has a crank. I probably should see how that works when power and lights are working. There is a "remote possibility" that mom could be caught in a wheelchair and not in the bed.

I think the instructions say it could move the head and middle about 8x. At the very least mom could get the bed into a sleeping position. She currently can't get in the wheelchair or into the bed herself.

The ersatz "Nurse call" has been the "Intercom mode" of a cordless phone. The charging base is nearby.

I set up a LED that's mounted on the top and in the middle of the TV, in part, using a commercial product from Viking Electronics.
It will blink if the phone is ringing and will be steady if the phone is "off hook". The phone ended up being "off hook" occaisionally. I really wanted a light that illuminated when the phone was "Off hook and not talking for say 20 minutes" as well as ringing.

The cordless base station has a UPS backup and the phone has a few hours of talk time with no power.
A real landline phone is close by for emergencies. It can be pulled up from the floor with a string.

I can barely hear my cell phone ring.

Recently, I added a Bellman % Symphon Visit alarm clock system to the mix of "stuff". I'm using a wireless transmitter which can activate the LED strobes, buzzer and bed vibrator. (the bed vibrator needs to be under the pillow).

It doesn't have a low battery monitor, but has a LED that illuminates when you press the button.

This is to "wake me" because I'm really hard to wake up. The usefullness isn't fully known yet. The OEM system has batteries at both ends. The receiver is normally AC powered.

I might connect a "nurse call cord" to their transmitter which is 9V battery powered. A external "contact closure" input is designed into the OEM system.

I think the "best" long term solution is to get a pendant DXS transmitter from Linear which is used in their alarm and PERS (Personal Emergency Response) systems which I have used in the past. It has low battery and presence alarms. I can have that activate the Bellman Transmitter, hopefully. That would work if she is in the wheelchair. A UPS is planned for my network stuff anyway.

I use a baby monitor to re-locate the rings of a seldom used cordless phone to two other rooms and I sometimes take a parental unit outside with me and hang it on my belt. The parent units are battery backed up/powered and are portable. The "baby unit" isn't. It could be connected to a planned location of a UPS.
 

MisterBill2

Joined Jan 23, 2018
9,293
I am aware that a "backup" consisting of two of those SMALL 9 volt batteries is offered, but it does not seem that it would be anywhere close to reliable, given that running a motor is a a much higher current load than what they are intended for, and also that I don't think there is any recharging scheme included to keep them up.
 

Tonyr1084

Joined Sep 24, 2015
6,267
I had gotten my hands on dozens of Ni-Cad wet cell batteries. Each cell was rated at 50 Ah. They were pretty big as memory serves. Their terminals were bolts and they could be configured in series or in parallel - or even series/parallel. At 9V, eight cells in series would deliver 9.6V. Now, those batteries are way too large and require way too much maintenance to be operating a hospital bed, but the point is that 9V can be achieved in numerous ways without the use of a 9V transistor battery (as I've known them for all my life) commonly known as PP3. I doubt those little PP3 batteries can lift a person in a hospital bed along with all the weight of the framing and mechanical components. I suspect (don't know this) that the 9V is something larger than a 9V transistor (PP3) battery.

I googled 9 volt transistor battery and looked at the Wikipedia description. That's where I got the PP3 from. Otherwise I wouldn't have known that part. But the description covers many other types of batteries.
 

MisterBill2

Joined Jan 23, 2018
9,293
I had gotten my hands on dozens of Ni-Cad wet cell batteries. Each cell was rated at 50 Ah. They were pretty big as memory serves. Their terminals were bolts and they could be configured in series or in parallel - or even series/parallel. At 9V, eight cells in series would deliver 9.6V. Now, those batteries are way too large and require way too much maintenance to be operating a hospital bed, but the point is that 9V can be achieved in numerous ways without the use of a 9V transistor battery (as I've known them for all my life) commonly known as PP3. I doubt those little PP3 batteries can lift a person in a hospital bed along with all the weight of the framing and mechanical components. I suspect (don't know this) that the 9V is something larger than a 9V transistor (PP3) battery.

I googled 9 volt transistor battery and looked at the Wikipedia description. That's where I got the PP3 from. Otherwise I wouldn't have known that part. But the description covers many other types of batteries.
The 9 volt batteries for the backup were indeed those 9 volt ones with the snap terminals. I observed that first hand, but we never did try to use it. The power supply for the chair was a 24 volt switcher module, quite common for that type of product at the time. Clearly the addition of a battery backup was a marketing thing, and the additional cost of adding it was certainly very minimal.
 

Tonyr1084

Joined Sep 24, 2015
6,267
Thank you @MisterBill2. Always good to hear from someone who has hands on experience. It's just that those PP3 batteries don't instill in me the thought of being able to lift a bed. Even with gear reduction, it seems to me like a tall order. But you've seen it - so I accept it.
 

Tonyr1084

Joined Sep 24, 2015
6,267
Back in 2002 I bought a new Chevy S10 pickup. It was four cylinder with manual transmission AND cruise control. I drove that thing for 12 years before trading it in.

Being that it was a manual transmission with cruise control I grew concerned when driving long drives up slowly increasing grades and not knowing how much power was being demanded of the engine. Not until I noticed a reduction in speed, which often meant the throttle was full open and I was just simply in too high a gear for the grade. So I added a vacuum gauge, which would tell me when I was using too much pedal. The gauge I bought was a mechanical vacuum gauge with a lighted dial. The light could be programmed to match the color of the vehicle dash color. That was via a push button. I installed the gauge on the A-Pillar (driver side). But the A-Pillar kit did not come with a single gauge mounting position. It came with 2 or 3 gauges possible. Chose the 2 gauge kit and added a volt meter made by the same manufacture and the same color arrangement.

The problem I had with that was that when I turned the key to the on position the gauges would momentarily light. During starting the engine the gauges would shut off. Once the engine started the gauges would come back on. The issue was that the volt meter would default to the factory set color, and somewhat annoyed, I'd have to push the button eight times to get the desired color. The way I overcame that issue was to delay the time before the gauges would become energized. Below is the way I accomplished it.

I used a 24VDC relay (that was what was on hand) and it would definitely click in at 13V. A simple RC time delay and a transistor to activate the relay. In the drawing the relay is active. Obviously, the yellow wire is for memory and the orange wire is to dim the gauges when the dash lights were on.
1605108354853.png
It seems to me that the screen lighting up then blanking out is somewhat annoying to you and you want to get around that. Well, above is how I got around my gauge lighting color problem. Everything I built this with was scrapped parts; and it worked well for a good number of years. I don't see why you can't do the same thing and forget about trying to power the screen through the startup cycle. Just have the screen come on about 4 or 5 seconds after the engine is started. No more annoying flashing of the screen. This will get around any issues that could arise from transient spikes during starting.

That's my 2¢.
 
Last edited:

LowQCab

Joined Nov 6, 2012
1,107
The Devil is in the Details ......
A simple Battery Charger is not necessarily as simple, or as cheap, as you might imagine.
If you really want to build one yourself, be very careful that it NEVER exceeds 13.8 Volts under any circumstances.
Excessive "Float-Voltage" will "Dry-Out" the Battery, and destroy it permanently.
Other things to consider,
Protection against Voltage Spikes from the Mains, and Heat Sinks for the Regulators.
This Circuit is so simple that it may be constructed with "Point-to-Point" wiring, with no Circuit Board,
but it MUST be built inside of a protective Box, which can also serve as your Heat-Sink.
The Regulators, and the Bridge Rectifier, can be mounted with screws to the inside of a small Aluminum Box.
This Regulator will slowly dis-charge the battery if Mains-Power is lost for any reason,
over an extended period of time, ( this will take in excess of a week),
and if the Battery is left in a fully dis-charged condition for more than a couple of days,
it will destroy the Battery permanently.
This Circuit "can be" constructed using only one LM317,
if you really want to punish yourself with verifying its performance,
building the Charger in "blocks" makes designing it, and trouble-shooting it, very easy.
.
.Precision 1.25A Battery Charger Flattened .png
 

MisterBill2

Joined Jan 23, 2018
9,293
Thank you @MisterBill2. Always good to hear from someone who has hands on experience. It's just that those PP3 batteries don't instill in me the thought of being able to lift a bed. Even with gear reduction, it seems to me like a tall order. But you've seen it - so I accept it.
I did not claim that the batteries would do the job, only that such was the option provided. My guess is that they might be good for one move, if they were fairly fresh. The two that I got from Home Depot, cheaper to buy the two-pack, are rated 5.5 amp hours. That translates to quite a few 30 second moves at 2 amps. And because the change over is automatic, nobody needs to figure out what switch to switch or wire to plug in.
 

djsfantasi

Joined Apr 11, 2010
7,833
I did not claim that the batteries would do the job, only that such was the option provided. My guess is that they might be good for one move, if they were fairly fresh. The two that I got from Home Depot, cheaper to buy the two-pack, are rated 5.5 amp hours. That translates to quite a few 30 second moves at 2 amps. And because the change over is automatic, nobody needs to figure out what switch to switch or wire to plug in.
PP3 9V batteries are typically rated at 0.55 AH. Lithium PP3 batteries can be had at 1.2AH. No where near 5.5AH. Unless Home Depot was selling advanced technology batteries, the 5.5AH rating might be an error.

Several searches on the Home Depot site didn’t turn up such a battery. Can you post a close-up picture of the package or battery?
 

MisterBill2

Joined Jan 23, 2018
9,293
PP3 9V batteries are typically rated at 0.55 AH. Lithium PP3 batteries can be had at 1.2AH. No where near 5.5AH. Unless Home Depot was selling advanced technology batteries, the 5.5AH rating might be an error.

Several searches on the Home Depot site didn’t turn up such a battery. Can you post a close-up picture of the package or battery?
The batteries that I purchased were 12 volt gell type rechargables, far bigger that the tiny 9 volters being discussed. Completely different part of the conversation. I did not intend to confuse anybody.
 
Top