Badcaps.net Forum
Go Back   Badcaps Forums > Troubleshooting Hardware & Devices and Electronics Theory > General Electronics Technical Discussion
Register FAQ Calendar Search Today's Posts Mark Forums Read

 
Thread Tools Display Modes
Old 11-14-2018, 11:15 AM   #1
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 1,875
Lightbulb DIY Backup with sealed lead acid battery

Good day folks. Recently someone suggested that I'd install an alarm system in my apartment and my brain instantly sprung into action and began devising plans for making one rather than buying an off the shelf unit. It's a lot cheaper for one thing and secondly nothing beats a good DIY project The brains will be an Arduino of course and the system itself would be relatively easy to implement....DAMN easy in fact: just a couple of IFs to monitor some switches...that's not important.

What IS important is that we want this thing to run even when the power goes out so we need some sort of battery backup. Of course I could just plug the adapter that powers the whole system into an UPS, but it seems too "simple" for my taste I was thinking of making my own battery backup system with one (or more) UPS batteries. The operation would be fairly straightforward: run on battery when mains is not present, switch to mains and charge battery when it comes back...The switching can be something as simple as a relay (which I did in the past for a different project), it's the charging that's going to be the most challenging so as not to kill the battery.

I was thinking of something very basic like an adapter simply hooked up to the battery. The label says "charge at constant voltage" and there's some values on the battery usually 13-14v, so I was thinking what if I just apply 13v straight to the battery ? I've seen plenty of battery charging circuits online, most of them involving an LM317 in some fashion but to keep it as simple and dirty as possible, I thought of the above method....it would probably become an issue if the battery is drained and the charge current is too great. Seeing how I'll have an arduino as the brains, I can have it interact with the battery as well to start/stop charging when certain values are reached. Any ideas on this battery backup portion ? It could even be a generic application for other projects, not just an alarm system.
__________________
Wattevah...
Dannyx is offline   Reply With Quote
Old 11-14-2018, 11:33 AM   #2
sam_sam_sam
Badcaps Veteran
 
Join Date: Jul 2011
City & State: Sunny Jacksonville FL
My Country: USA
Line Voltage: 120 Volts 60 HZ
I'm a: Knowledge Seeker
Posts: 1,140
Default Re: DIY Backup with sealed lead acid battery

I have tried this with a Parallax Basic Stamp controller the results were so - so
Meaning that the repeatable was not as good as it should have been for my liking
I table the idea for a different way to keep track of the changing of the battery

If I were to this again here is how

I would approach this time around

I would find a charger that is made for the type of battery that you are going to use

and have your controller restart the battery charger if the battery is low and if did not do it for it self

I would have the controller setup in such a way that if your battery voltage stays to low is to high for how many hours that it shows up as an alarm
__________________
9 PC LCD Monitor
6 LCD Flat Screen TV
30 Desk Top Switching Power Supply
10 Desk Top Power Supply
10 Battery Charger Switching Power Supply for Power Tool
6 18v Lithium Battery Power Boards for Tool Battery Packs
1 XBox 360 Switching Power Supply and M Board
25 Servo Drives 220/460 3 Phase
6 De-soldering Station Switching Power Supply 1 Power Supply
1 Dell Mother Board
15 Computer Power Supply
1 HP Printer Supply & Control Board * lighting finished it *


These two repairs where found with a ESR meter...> Temp at 50*F then at 90*F the ESR reading more than 10%

1 Over Head Crane Current Sensing Board
2 Hem Saw Computer Stack Board

All of these had CAPs POOF
All of the mosfet that are taken out by bad caps

Last edited by sam_sam_sam; 11-14-2018 at 11:44 AM..
sam_sam_sam is offline   Reply With Quote
Old 11-14-2018, 11:37 AM   #3
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 1,875
Default Re: DIY Backup with sealed lead acid battery

What exactly did you try ? Measuring the charge current with the micro ? What were the limitations you noticed ?
Dannyx is offline   Reply With Quote
Old 11-14-2018, 11:51 AM   #4
sam_sam_sam
Badcaps Veteran
 
Join Date: Jul 2011
City & State: Sunny Jacksonville FL
My Country: USA
Line Voltage: 120 Volts 60 HZ
I'm a: Knowledge Seeker
Posts: 1,140
Default Re: DIY Backup with sealed lead acid battery

Quote:
Originally Posted by Dannyx View Post
What exactly did you try ? Measuring the charge current with the micro ? What were the limitations you noticed ?
I had the controller turn on and off a LM317 in the current mode and using a
Digital to analog convert chip to monitor the voltage on battery it would either over shoot or under shoot the voltage settings that I had in the program

This would happen over a period of time
The battery would not stay fully charged

Last edited by sam_sam_sam; 11-14-2018 at 11:53 AM..
sam_sam_sam is offline   Reply With Quote
Old 11-14-2018, 11:54 AM   #5
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 1,875
Default Re: DIY Backup with sealed lead acid battery

One problem I've always faced when dealing with batteries is how to check the voltage on it WHILE it's charging, because the meter, microcontroller, whatever it is, is always going to see the "adapter" voltage going into the battery and not the actual value of the battery itself, since they're in parallel.
Dannyx is offline   Reply With Quote
Old 11-14-2018, 12:06 PM   #6
sam_sam_sam
Badcaps Veteran
 
Join Date: Jul 2011
City & State: Sunny Jacksonville FL
My Country: USA
Line Voltage: 120 Volts 60 HZ
I'm a: Knowledge Seeker
Posts: 1,140
Default Re: DIY Backup with sealed lead acid battery

This is where you put your voltage sensor on the battery and have the controller turn on and off the charger and while the charger is off ( for set amount of time for the battery voltage to stabilize ) this is when you read the voltage if the voltages is low turn the charger back on until it reaches the voltage cut off in your program

Last edited by sam_sam_sam; 11-14-2018 at 12:11 PM..
sam_sam_sam is offline   Reply With Quote
Old 11-14-2018, 12:09 PM   #7
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 1,875
Default Re: DIY Backup with sealed lead acid battery

Oh so I WAS right in my assumption: there's no way around it but to somehow disconnect the incoming voltage. Good idea, but it would have to either sample at rather slow intervals or very very fast...don't know which approach is industry standard in stuff like cars, phones, laptops etc.
Dannyx is offline   Reply With Quote
Old 11-14-2018, 03:35 PM   #8
stj
Great Sage 齊天大聖
 
stj's Avatar
 
Join Date: Dec 2009
City & State: Europe
My Country: some shithole run by Israeli agents
I'm a: Professional Tech
Posts: 19,505
Default Re: DIY Backup with sealed lead acid battery

so what's wrong with a chair, a shotgun, a reel of tape, and some string??
stj is offline   Reply With Quote
Old 11-14-2018, 11:54 PM   #9
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 1,875
Default Re: DIY Backup with sealed lead acid battery

Too old school
Dannyx is offline   Reply With Quote
Old 11-15-2018, 03:36 AM   #10
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 1,875
Thumbs up Re: DIY Backup with sealed lead acid battery

Another interesting one here (the second version). I could replace that 555 with the arduino used to run the alarm module, so I don't use two separate ones. Put all of this into a box, mount it on the wall somewhere and we're good to go....running wires for the sensors would be a bit of a chore, but hey, whatcha gonna do...

EDIT: had another look at that schematic and may have spotted a problem, though it's not mentioned, so perhaps I don't fully comprehend how it operates: when the LM317 is active, wouldn't the resistor divider on the right immediately detect the battery as being charged causing it to oscillate ON-OFF-ON-OFF very fast ? My idea is that when the battery is discharged, the circuit will begin charging it and as such apply voltage to the output terminal. This is connected to the resistor divider which would make it read the charge voltage and not the actual voltage in the battery, thus the circuit would turn off. As it does so, the "real" voltage appears again, triggers the circuit to charge and so on...could be a bad analysis though.

Second possible analysis of the issue: the LM317 is used as a constant current source and not a constant voltage source (it's more of a combination of both in fact), so it slowly ramps up its output based on the current drawn by the battery (due to that sense resistor on its OUT pin), which would make more sense in conjunction with that voltage divider because it doesn't always output 14v or whatever, but slowly "gets there" when the battery no longer draws current through the current sense resistor.

Last edited by Dannyx; 11-15-2018 at 04:37 AM..
Dannyx is offline   Reply With Quote
Old 11-15-2018, 06:30 AM   #11
stj
Great Sage 齊天大聖
 
stj's Avatar
 
Join Date: Dec 2009
City & State: Europe
My Country: some shithole run by Israeli agents
I'm a: Professional Tech
Posts: 19,505
Default Re: DIY Backup with sealed lead acid battery

a friend of mine used a car alarm for his place - the chinese 2way type with a pager!!
stj is offline   Reply With Quote
Old 11-15-2018, 07:18 AM   #12
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 1,875
Default Re: DIY Backup with sealed lead acid battery

Yeah, that's an off the shelf solution but that's not really relevant: the battery backup could be used for any system, not strictly an alarm system. That's just the system which comes to mind as needing backup more than anything else.
Dannyx is offline   Reply With Quote
Old 11-15-2018, 03:29 PM   #13
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 1,875
Thumbs up Re: DIY Backup with sealed lead acid battery

Here's what I had in mind: I adapted the example diagram....I spent all 5 minutes doodling in MS Paint so it's going to be brilliant Didn't really think it through: just threw together some lines and replaced most of the passive components with the arduino.

The way I see it on paper: we need some sort of voltage reading, so the resistor divider on the right was given to us right off the bat and should stay in the circuit AFAIK. We can use that to "measure" the voltage with our arduino to cut off the charging when it's reached 13.5v or something, which is where the next part comes in: in "charge mode", 2n4401 is "open" and not acting on ADJ pin in any way, so the LM317 does its magic and charges in constant current in conjunction with the current sense resistor (typical application AFAIK). The arduino then turns on 2n4401 and pulls the ADJ pin to GND, bringing down the output to 1.25v or something like that. I threw an extra "Isense" line on there for no real reason...I just realised.

...as I'm writing this, I'm starting to notice that the arduino is probably superfluous for this application, which could be pulled off with discrete components to measure a goddamn battery
Attached Images
File Type: jpg Battery_Charger_1.jpg (70.5 KB, 13 views)
Dannyx is offline   Reply With Quote
Old 11-15-2018, 03:57 PM   #14
budm
Badcaps Veteran
 
budm's Avatar
 
Join Date: Feb 2010
City & State: S.F. Bay area
My Country: USA
Line Voltage: 120V 60Hz
I'm a: Knowledge Seeker
Posts: 34,271
Default Re: DIY Backup with sealed lead acid battery

You will need more than 15V feeding the circuit.
http://www.ti.com/lit/an/snva581/snva581.pdf
What is the purpose of 15V Zener?
Attached Files
File Type: pdf LM317 battery charger snva581.pdf (104.5 KB, 3 views)
__________________
Never stop learning
Basic LCD TV and Monitor troubleshooting guides.
http://www.badcaps.net/forum/showthr...956#post305956

Voltage Regulator (LDO) testing:
http://www.badcaps.net/forum/showthr...999#post300999

Inverter testing using old CFL:
http://www.badcaps.net/forum/showthr...er+testing+cfl

Tear down pictures : Hit the ">" Show Albums and stories" on the left side
http://s807.photobucket.com/user/budm/library/

TV Factory reset codes listing:
http://www.badcaps.net/forum/showthread.php?t=24809

Last edited by budm; 11-15-2018 at 04:00 PM..
budm is offline   Reply With Quote
Old 11-16-2018, 12:34 AM   #15
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 1,875
Thumbs up Re: DIY Backup with sealed lead acid battery

Quote:
Originally Posted by budm View Post
What is the purpose of 15V Zener?
According to the original schematic (since I didn't alter that portion) it prevents the LM317 from exceeding 15v.
Dannyx is offline   Reply With Quote
Old 11-16-2018, 12:38 AM   #16
Curious.George
Badcaps Veteran
 
Join Date: Nov 2011
Posts: 895
Default Re: DIY Backup with sealed lead acid battery

Quote:
Originally Posted by Dannyx View Post
...as I'm writing this, I'm starting to notice that the arduino is probably superfluous for this application, which could be pulled off with discrete components to measure a goddamn battery
Discrete components don't have (significant) memory. You will find that your circuit "works" -- with a new battery; then fails miserably as the battery ages or develops faults.

Of course, if you don't really CARE about how well the backup is performing, then these won't be issues for you!
Curious.George is offline   Reply With Quote
Old 11-16-2018, 12:46 AM   #17
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 1,875
Default Re: DIY Backup with sealed lead acid battery

My building hasn't experienced a power outage in ages TBH, so the battery would spend most of its life "idling", which may or may not be detrimental to its health and it might fail just as I need it and SLAs are relatively expensive (by my standards at least), so maximum battery life would be important, that's why I thought I'd "smarten" the thing up a bit by including a uController of sorts.
Dannyx is offline   Reply With Quote
Old 11-16-2018, 05:05 AM   #18
stj
Great Sage 齊天大聖
 
stj's Avatar
 
Join Date: Dec 2009
City & State: Europe
My Country: some shithole run by Israeli agents
I'm a: Professional Tech
Posts: 19,505
Default Re: DIY Backup with sealed lead acid battery

why not use a car battery, and have a circuit that disconnects it with a relay for 99% of the time once it's charged.
no need to waste power with 24/7 charging of a cell that has no load.
stj is offline   Reply With Quote
Old 11-16-2018, 05:35 AM   #19
sam_sam_sam
Badcaps Veteran
 
Join Date: Jul 2011
City & State: Sunny Jacksonville FL
My Country: USA
Line Voltage: 120 Volts 60 HZ
I'm a: Knowledge Seeker
Posts: 1,140
Default Re: DIY Backup with sealed lead acid battery

Quote:
Originally Posted by Dannyx View Post
My building hasn't experienced a power outage in ages TBH, so the battery would spend most of its life "idling", which may or may not be detrimental to its health and it might fail just as I need it and SLAs are relatively expensive (by my standards at least), so maximum battery life would be important, that's why I thought I'd "smarten" the thing up a bit by including a uController of sorts.
You are making this more complicated than it needs to be why ?

Use a battery charger controller that is responsible for the charging of the battery use one that charges at a high rate then powers down as battery voltage hits 13.8 to 14.5 volts then goes to stand by


Have your controller take care of this part

All you need to do is once the battery is completely charged turn the charger of then once a day check the battery voltage and check it the stand still charge if it is below 12.5 then turn the charger back on for a certain amount of time and recheck the next day if no charge is needed then skip that day

Last edited by sam_sam_sam; 11-16-2018 at 05:40 AM..
sam_sam_sam is offline   Reply With Quote
Old 11-16-2018, 01:55 PM   #20
Dannyx
CertifiedAxhole
 
Dannyx's Avatar
 
Join Date: Aug 2016
City & State: Constanta
My Country: Romania
Line Voltage: 230VAC 50Hz
I'm a: Hardcore Geek
Posts: 1,875
Talking Re: DIY Backup with sealed lead acid battery

Quote:
Originally Posted by stj View Post
why not use a car battery, and have a circuit that disconnects it with a relay for 99% of the time once it's charged.
no need to waste power with 24/7 charging of a cell that has no load.
Exactly what I was planning on doing, but to do that we need SOME sort of monitoring and rather than messing with discrete stuff which is prone to large errors, I thought I'd use a micro.

Come to think of it, efficiency is another aspect I haven't taken into account: the alarm system (which let's face it is not even designed yet) would be a small consumer. I was also thinking of having it run a DVR and some cameras....straight off the battery Haven't tried it yet, but the "classic" approach in this industry is to have a proper stand-alone UPS plugged into the mains, the SMPS for the cameras and DVR plugged into that, so when power goes, it would essentially go

DC from battery>AC by inverter inside UPS>DC by adapter for DVR > DVR. I'm no expert but I'm wondering (outside of cost), is this more efficient than just going:

DC from battery> Dc input of DVR ? Just a thought.

Again: charge battery when mains is available to a certain level, disconnect it and forget about it, toggle battery over to the DVR when power goes out (simple relay job).

Last edited by Dannyx; 11-16-2018 at 02:50 PM..
Dannyx is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Badcaps.net Technical Forums 2003 - 2018
Powered by vBulletin ®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
All times are GMT -6. The time now is 09:23 PM.

Did you find this forum helpful?