Introduction: Super Simple & Super Cheap DIY UPS/CCTV System From Recycled Batteries!
Where I live, short power cuts are fairly frequent and can be very irritating. I have also wanted to experiment with CCTV for some time. After experimenting with test UPS systems using cheap inverters and old car batteries I decided to scale it up.
When homes have an alarm system installed it usually contains a backup battery in case of power failure. These batteries need to be replaced every few years to ensure the system performs correctly.
The waste batteries are usually sold to scrap dealers for their lead content, but alarm installers are usually happy to give/sell them to you for an incredibly low price. We have picked up 7AH batteries for less than 50p each.
In this instructable I aim to show you how easy and cost effective it can be to "recycle" these for your own projects, such as a UPS/CCTV system.
The project was designed, tested and built by myself and Dom. We are fairly experienced with electronics and suggest that this project should only be undertaken if you have done all the appropriate research beforehand (also see safety disclaimer on step 2).
Step 1: Part 1 - Gather Parts
This instructible can be followed to the letter, or changed to suit your own needs if you wish to use other batteries etc.
8x 7AH Sealed Lead Acid batteries - £4 - Alarm installation company
700w modified sine wave inverter - £25 - Gumtree (classifed ads site)
Selection of wire, mostly mains flex - £0 - Had this laying about at home
2x 8 way earth block - £3.92 - Toolstation
3 pole double throw 240v relay - £4 - Ebay
2x 13A plugs - £0 - Had these laying about at home
Double gang socket - £0 - Had this laying about at home
Extras for CCTV:
Old computer (Prusabox) - £0 - Came from a family member, saved from the tip!
RCA cable - £2 - Ebay
EasyCap - £4 - Ebay
IR Night Vision CCTV Camera - £9 - Ebay
LAN Cable - £0 - Had this laying about at home
Optional: Instructables T-Shirt for optimum DIY-ness
Step 2: Wire Up Batteries
If using a 12v Inverter your batteries should all be wired in parallel, this will keep the voltage the same but increase the current output and life of the battery bank.
A spade connector should be crimped to the end of each wire to connect to a battery, this allows the battery to be swapped out if it becomes faulty (or vents because you managed to short it).
Now is probably a good time to mention that you will be working with a very high current supply which is not dangerous is treated properly. 12v is not enough to break down the internal resistance of your body so you will not be electrocuted by the supply. However if you short/drop/misuse the batteries you could well be burned, blinded, or poisoned by release of toxic gasses. Take the appropriate safety measures, do NOT breathe vented battery smoke :P. I am not to be held responsible for anything irresponsible you do!
I have attached the wiring diagram for the entire UPS but I strongly suggest you watch the video of our system HERE (along with all the other videos on our channel)
Step 3: Chosing Your Inverter
The inverter is one of the most cruital components of a UPS. Its function is to convert 12V DC voltage to 240V AC suitable for use with household appliances (Inverter voltages vairy from counrty to country but the princible is the same).
There are two main types of inverter:
True sine wave: The inverter is one of the most crucial components of a UPS. Its function is to convert 12V DC voltage to 240V AC suitable for use with household appliances (Inverter voltages vary from country to country but the principle is the same).
Modified sine wave: These produce a square wave style output. They still work fine for most appliances but often produce a buzzing sound, more heat, and are less efficient. The good news is they are pretty cheap and readily available (ours was £25 second hand, but they can be bought from stores like Halfords, B&Q and Maplin)
Take a look at the attatched image for a better idea of the difference in output waveform (not from the UK as the output is 115V source)
Our inverter is a 600W modified sine wave inverter, it comes with basic features such as under volt, over current, and high temperature cut-off protection. This prevents the inverter causing damage if it is overloaded. It also has a fan that kicks in when the inverter is under load to keep it cool. The alligator clips are handy as they fit over the earth block well, however these could have been cut off and the bare cable screwed into the earth block.
The power output of your inverter should be about 120% of the rated power of the devices you are running (200w computer + ~30w for hdd, wifi router and cameras). We went for the 600w for a bit of future-proofing.
It is important to consider the current draw your inverter will put on your batteries, here comes some maths.
Modern inverters have an efficiency rating of 70% up to about 90%, we aren’t going to consider that in our equation for the time being.
Power (watts) = Voltage (volts) X Current (amps)
Current draw = watts / volts
Our battery bank puts out 12 volts, and our inverter is 600w
Current draw = 600w / 12v
Current draw = 50 AMPS!!!!!
That’s a LOT of current, but remember that figure is only if the inverter is under full load, and the current is distributed evenly across all batteries in the bank. Meaning only 6.25 amps is being drawn from each battery in our 8 way bank (50/8).
That works out to 1.2 hours (~50 mins considering inefficiency’s and losses) under full (600w) load from our 7Ah battery’s (calculated here)
To increase this figure sustaining the same maximum power output, we need to add more batteries, which is pretty easy.
Step 4: Connecting Your Inverter
This is the easy part. Connect the Positive (+) input for your inverter to your positive earth block, and the negaive (-) to your negative earth block. I would reccomend testing the polarity with a multimeter before connecting, as this may be an expensive mistake!
You can connect your inverter by either stripping its cables and scewing them into the earth block, or clamping its alligator clips over the blocks (like we did). You should also take care to mount your inverter securely, you dont want it touching any of the battery terminals and shorting!
Step 5: Wiring in the Relay
This is the part that may become confusing, so I would REALY recommend watching the video as mis-wiring mains electricity would be dangerous.
A relay is an electrically operated switch. It uses an electromagnet to open/close its switching mechanism. We will be using a 3 pole, 2 throw relay for this project.
Relays are often marked SPST, SPDT, DPST, DPDT. This indicated the number of "poles" and "throws". A double "pole" relay has two switches inside it. In A single "throw" relay, each switch can either be open, or closed. In a double throw relay each switch has a "Common" which can be connected to one of two outputs, named NC (normally closed) and NO (normally open). Relays are spring loaded to the NC position. When the coil is energised, it creates a magnetic field, pulling the "common" to the NO position.
Take a look at the relay in the middle of the below diagram.
The output sockets live is connected to one pole of the relay, the neutral to another. This allows us to switch between the output sockets being connected to the mains, or the inverter.
Now obviously, when the mains is available, we want to use it. To accomplish this, we connect the mains input across the coil of the relay. In this setup, while the coil is energised, the sockets will be connected to the mains input.
When the mains fails, the coil loses energy and the switch returns to its spring loaded NC position, connecting the sockets to the inverter.
All of this happens in about 0.01 seconds.
Always make sure you use a circut breaker when testing your setup, just incase of any mistakes.
Step 6: Final Connections
Once you have checked, double checked, and triple checked all of your connections, you are now ready to wire your output to your socket. Sockets are labeled with live, neutral and.... earth?
We havent talked about earthing at all yet, so we will do that now.
It is essential to make sure that your output is always connected to earth, we are going to accomplish this by using an "earth loop". The alternative to doing this is switching your earth using the third pole of your relay. I belive this is wrong as all alaments of your circuity should be continuously earthed. We will use the earth pin from the UPS input plug to connect both the output earth and inverter earth to your household earth circuit.
Once again, this is explained in the diagram and video
Step 7: Time to Test!
You are now ready to test your UPS. So go ahead and connect your load (I usually test with a small desk lamp).
Turn your inverter on and watch your lamp spring to life!
If it didn’t, make some checks:
- Is the lamp broken? Test with a wall socket.
- Are you batteries flat or incorrectly wired? Test with volt meter.
- Is your inverter busted? Test it in the car.
- Did you wire your relay wrong? Go back and try again!
If it didn’t, make some more checks:
- Has the fuse blown in your plug? Test with multimeter.
- Is the lamp broken? Test with a wall socket.
- Did you wire your relay wrong? Go back and try again!
If your RCD of circuit breaker tripped then it is probably the same story. If you can't get to the bottom of the problem, disconnect your inverter and test again.
If all went well, then pat yourself on the back. You have made your own DIY UPS system. All you have to do now is charge your batteries with enough current to overcome the drain of the inverter in standby and keep them topped off. I find that 13.5v at 2 amps is the ideal supply. If you have a power cut and your inverter has to take over, you may want to connect a higher amp charger to top your battery bank up again. The bank can be charged by connecting your charge leads to each earth block.
If your not interested in the CCTV part of the build, then go and enjoy your peace of mind knowing power is available wherever, whenever. If you want to know how to connect your router and CCTV equipment to your supply, then stay tuned!
Step 8: Hooking Up Your Router
I use a BT HomeHub 2.0, as it came with my broadband package. My whole house is wired with 100mbs LAN and my broadband speed is only about 12mbs so it is pretty sufficiant. The homehub uses a 15v transformer, which is connected straight into one of the supplys sockets. I extended the length of the cord to reach from the garage loft into the house using some old telephone cable. This is fine as it is a pretty low power device.
Thats about all there is to it, just make sure you didnt mix up the polarity of the connector by testing it with a multimeter, for the homehup the inside of the connector should be positive.
Step 9: CCTV Setup
I am using a 30 LED Infra-Red night vision camera from E-Bay. It cost around £9 and seems to be worth every penny, the night vision is pretty acceptable for the price and i would recommend it for anyone on a tight budget!.
If your camera is being mounted outside, make sure it is waterproof!. Another thing to check is its connectors. RCA is the typical yellow, white and red connectors you see on the side of most TV's. BNC connectors are an alternative often used on higher end equipment. In the camera pictured it has a red DC jack for 12V power input.
The camera is connected to the PC via an "EasyCap" capture card. It allows you to connect a RCA A/V video source to a computer through USB. The device shows up just like a webcam in windows and will work with most software. A great tool to test your camera is "AmCap". I had difficulty connecting my easycap to the PC as it is quite bulky and dint fit into the USB port, this problem was overcome by using a short USB extender. I ran a phono extender cable from the camera to the EasyCap to carry audio and video data. Power is delivered to the camera over a length of telephone cable, as this is what i has laying around. Ideally you would use RCA cable that also carries power, cables like this (pictured below) are available on ebay pretty cheap. The 12V source is provided directly from the computer. Standard desktop computers use what is called an ATX power supply. This is designed to put out a range of voltages, one of which is 12V. A "molex" connector contains a yellow +12v and two black ground cables, these can be used to power your camera.
I would recommend to steer clear of wireless cameras. They seem to be an easy solution as you do not need to run cables, however they are a pain to tune and often cut out due to interference.
IP cameras are another alternative, they allow users to pan/tilt the camera via a web interface. They can be connected to the network over wifi or LAN but tend to be expensive.
Step 10: CCTV Software
I am having real trouble finding some decent free CCTV software so this page will be updated when I do!
At the moment i am running "iSpy Connect" as a free trial. It only allows you to view cameras over the same network via their quite poor website. On the other hand it does support continuous time lapse recording with i think is a must-have feature.
ManyCam is a great utility that lets you use one video capture device with many applications. This way you can install as many software packages as you require to fit your needs.
For basic camera streaming WebcamXP is pretty good but does not on its own support recording. So using ManyCam will allow you to stream through webcamxp and record through iSpy Connect. Best of both worlds!
Video Patrol 5.0 is a package I am currently looking at testing.
If anyone has any software they would like to reccomend or think i should try out, please leave a comment!