QuckStart Powered CCTV Camera/Mux Power Switcher
kochevnik
Posts: 30
QuickStart Spin Code Attached : Alert-37.spin
WHAT THIS IS :
This is a 1U rackshelf power switching unit for switching the (12 VDC) power to CCTV cameras and muxes on and off. It is dual function in the sense that power can be turned on/off using the front panel toggle switches manually OR it can be switched using the NPN/Darlington PNP circuits triggered via a Powerbuilder (PB) program on a computer with Windows FLP (Fundamental for LegacyPC's) which sends serial signals to two QuickStarts which then send on/off signals to the transistor array. The dual function was important to me because if anything happens to the computer, I can still manually control both the cameras and the mux by pushing buttons if need be.
These switches also power the CCTV multiplexers (link to manual in my other prop forum posts below) and send serial signals (over USB/Cat5) to actually control the muxes - turn alarms on/off, change settings, camera arrangements etc.
The toggle switches on the front of the panel are on-off-on (except for the mux ones) and tied to bicolor LED's - up = the red zone cameras, down = yellow/orange zone cameras, middle = both cameras off - 32 cameras in all, 16 in each bank. Total of 4 muxes (or other 12 v devices) - altho in most cases only two will be used at a time.
WHY :
My family was home-invaded (of a sort) last year (post on that below). I screwed up. We have since tightened up our security/awareness, and this is the next step in that process. On a longer time frame, I think we are all in going to be deeper in trouble as the economy collapses - I won't go into that in any detail, lots of other places on the net - but I will say that reading 'The Fourth Turning' and Rifkin's 'Entropy' and 'End of Work' books changed my life. And on a related note, if there are any prepper engineers out there - especially on the west coast I would love to compare notes.
THE PROCESS
As you can see by my other Prop Forum posts below, this was a long process - like really really long for me. I'd guess at a minimum several hundred hours of work. A lot of this is simply learning process as I am a newbie when it comes to electronics of all kind - my world has been software and it is a much more pleasant one to work in LOL - things break in your code, they don't usually smoke and try to burn your house down, or fry your fingers haha.
Even before we were home invaded, I was working on some camera stuff - originally I was looking at various chinese-made DVR cards for processing CCTV camera input. I also looked into IP cameras. My first foray determined that most of the DVR cards wouldnt run in my system (most of them are based around 16-bit programs and WinFLP, despite it's name has no compatibility mode to run those. The other issue was that they were all browser based, and very badly designed. And they were slow - 30 fps which means it was not real-time motion and all the digital compression did not help either.
The issue I found with IP cams was the high price, and also the frame rate and bandwidth issues. The pictures were great, but in reality I just wanted to be able to determine if there was some idiot trying to break into my house, I didnt need to see the zits on his face. Great pic, but very expensive and also not real-time.
The I found GVI muxes on EBay sold by some guy (greenback logistics link below) who appeared to have hundreds of them pulled from old Walmarts. I bought two and checked them - very nice, very capable, very cheap (I got mine for about $15 in qty - shipped). I wrote some PB code to send serial signals to them to see if I could do that and when it worked the possibilities opened up.
My first attempt at using transistors to turn these on and off used a simple NPN circuit. The problem I had (detailed in post below) was that there was a ground loop - if I turned off the power ground, the camera was using the ground on the camera signal to keep the power on. I 'fixed' that by using the NPN to turn off both grounds. I also had another issue in that I was using cat5 wiring to run some of my circuits, most especially cat5/bnc adapters were used to run the signal to the back of the mux - and here I ran into my second major problem - strain relief. Once all done, and hooked up it was obvious that over time, the wiring would snap. Not reliable enough. So I shelved the whole thing for a couple of months. Then went back to the drawing board. This time I looked into mosfets and PNP circuits. MOSFETs looked like a good fit at first, but then a combo NPN/PNP circuit looked better. After some trials I changed the PNP to Darlingtons and off I went.
For my circuits, I have pretty much only used stripboard. Several reasons for this, one I'm new and I break a lot of stuff, and like my coding work, I redesign/refactor a LOT. The NPN/PNP units which I call CMP units (for cam mux power units) I re-did at least 20+ times before I was satisfied. Thats a lot of soldering and unsoldering (thank the gods for Hakko LOL). I also spent a lot of time trying different connection methods - I had to LEARN how to solder because I never did it before, not successfully. I tried wire wrap - the mux toggle switches are wire-wrapped in this - then I tried a lot of other wire connect methods, most of which were expensive and/or didnt work all that well. The Pololu spring terminal blocks were a great pleasant surprise - incredible value there for me. Stripboard also made a lot of logical sense, you could change things just by halfways drilling a hole to interrupt a circuit. And if something ever broke, fixing a stripboard is cake compared to learning circuit design software - and in view of my prognosis for the future, being able to fix things with the parts I have on hand is an important consideration.
So in the end I drilled a lot of holes, hooked up 500+ wires (1000+ connection points - and before you say something, as convoluted as the wiring looks now, the first 3 or 4 iterations were a lot worse LOL) and got it all to work. Along the way I learned a lot. The PB front end coding I actually have left for last, I did enough to ensure that the concept was valid, but I have a bunch more coding to do to manipulate the cameras and muxes in the way I want them to work. For now though, from the one rackshelf I can control two banks of 16 CCTV cameras (32 camera total) and up to 4 muxes (or other low amp 12v devices). All fits into an SKB musicians rack (see links) that I can button up in a couple of minutes and load up for moving (which we do pretty much yearly now).
I'm very happy this is done and that it worked out so well. I think it is pretty robust and relatively easy to fix (I've had to pull the individual units many times during the build process). Now I just have to build a few more of them LOL.
ALL of this is always a work in progress - I actually still have one more day of work to button this one up (knock on wood). Spin code for the serial stuff is at the top of the post, lots of links below. Any questions about the constuction process, I'm happy to answer them.
k
Links
PNP circuit
http://www.w9xt.com/page_microdesign_pt12_hv_pnp_switching.html
Components
http://www.pololu.com/catalog/category/117
http://www.monoprice.com/products/search.asp?keyword=pigtail
Rack & Workbench
http://tinyurl.com/8vw9p2u
http://www.instructables.com/id/SuperMatts-SuperBench-Bench-Workbench-Desk-/
Mux
http://www.ebay.com/itm/GVI-16-Channel-Color-Multiplexer-GV-CMP163R-/130533702233?pt=US_Surveillance_Security_Systems&hash=item1e646a3a59#ht_76wt_1165
Books
http://www.amazon.com/The-Fourth-Turning-American-Rendezvous/dp/0767900464
http://www.amazon.com/The-End-Work-Jeremy-Rifkin/dp/1585423130
http://www.amazon.com/Entropy-A-New-World-View/dp/0670297178
Propeller links
http://forums.parallax.com/showthread.php?136172-Home-Invasion-Perimeter-Intrusion-Help
http://forums.parallax.com/showthread.php?134510-Help-with-Prop-video-switcher
http://forums.parallax.com/showthread.php?133891-Control-16-channel-CCTV-Mux-using-Quickstart-board-amp-RS-232
http://forums.parallax.com/showthread.php?133233-What-are-you-using-for-connector(s)-to-the-QuickStart-board
Colored Boxes
http://www.reallyusefulproducts.co.uk/usa/
Comments
I can see why you avoided the DVR cards, but why not use a cheap standalone DVR like q-see. I've purchased several Q-see DVRs from costco. They've generally been reliable, record multiple cameras at once, can be viewed on TV, or accessed over the internet. They're cheap enough you could probably even parallel them for redundancy.
Why do you need to switch camera power on/off? Why not leave cameras powered all the time? perhaps some of them are indoors and you want them shut off while you're occupying the home?
I've been quite interested in security cameras. I have a mix of expensive IP cameras and inexpensive Q-see DVR / wired cameras.
I guess your definition of cheap and mine are a little different LOL - I didnt see any Q-see DVR's for under 100 bucks even on ebay and it would be interesting to see if they can be controlled automagically from your PC ? Otherwise you are going to have to be pretty good at punching buttons in the dark when some guy tries to break in at 3 am.
The off/on issue comes into play for several reasons - these will eventually be used in an alt-energy type system and 3 to 6 watts x 16 cams over a 24 hour period adds up. But most importantly, I wanted the ability to have lots of different viewing options - in my case, 8 to 16 cams that are on all the time with motion detection on, and then when the motion alarm gets triggered, with one button push on my PC I can turn on any and all combos of other cameras when I need them. So you watch 8 cams on a continual basis, and then turn on 3 or 4 other PC's with 32 cams each on them to cover anything you could possibly want to see - then when the alert period is over, you push a button and you're back on watch status. I have also been thinking about adding touch screen and / or voice to the Powrbuilder PC control program (which I have euphemistically named Melvin - as in you mess with my family and you're going to get the world's worst Melvin you have ever seen LOL - apologies to anyone named Melvin). Wake up in the middle of the night, alarms going off and tell melvin to change / track camera combos as someone tries to enter your property but for now the mouse keyboard control is good enough - probably with big buttons for at night / stressful situations where your fine motor control goes to Smile.
Using the PC/QuickStart combo also allows me to do one button changes in any configuration to the mux - turn on/off motion alarms and or video loss alarms on some cameras (don't want them continually alarming once they've already gone off). Just a tremendous amount of flexibility to set up your system. And aside from all the work and the long learning curve I went thru, pretty cheap to setup.
Backups and alternatives really important to me in this system as well. 4 to 8 pc's each controlling one primary and one secondary mux, with in rack backups for each. All power to cams can be controlled thru the PC or thru manual toggle switches. My personal motto, backups of backups of backups. Anything dies in this system can be brought back online in multiple ways within a few seconds or minutes at worst.
Again - any engineer type preppers ever drop thru this thread, please contact me.
I plugged in all of the above and got the magic smoke. Things I didn't plan for / recognize / like -
1) The wiring sucked
2) Stripboard traces have a current limit of about 1 to 1.5 amps depending on who you ask
3) By soldering all the transistors to the CMP units I was having to undo all that wiring to pull them to fix problems
4) Did I mention the wiring sucked
So for the latest (3rd) major revision I went to US plastics and bought 20 feet of UMHW bar stock in 1/2 x 3/4 ",
I bought a cross slide vice to go with my cheap drill press, shorting blocks from this guy :
http://www.led-switch.com/terminal_blocks.htm
great supplier BTW - and then tore everything apart.
The new design uses what I call TPlugs (transistor plugs) which are small daughterboards which fit
into 2x5 sockets. For the wiring - to fix the amperage problems, I used shorting blocks for all my grounds and
terminals rated at 3+ amps for my positive - then I added automotive style fuse blocks - ATM mini type into the power
circuit with 1 amp fuses on them. They actually now make an indicator type fuse for these where it lights
up if the fuse blows, but the cheapest I could find these is $1 each from crutchfield so I will try those later
if I have many fuse problems.
So now everything is a lot more modular - if a transistor blows for some reason, I just pull the TPlug and
pop a new one in. If too much power is drawn, short in a camera or something, a fuse will blow - and I
will know which circuit it is on because there are 4 different fuses for different circuits. Wiring is much nicer
and easier to follow, I did this by cutting up little plastic blocks, drilling hundreds of holes and using them
as wire looms - maybe 25 cents a piece to make these.
I did have to pull the mux power circuits so this is only powering the cams right now, but it seems to work
pretty well thus far. I also got a new batch of cams - 600 and 700 tvl and the 700 tvl cameras have much nicer
pics than anything I have tried thus far - and about $60 a piece delivered. For backups, I have found that the
keyhole / door cams work pretty well as well - like $10 a piece for those.
Anyways - a big improvement in a lot of areas - as always a big learning curve but I am glad I stuck with it.
If this continues to work I will be moving on to some wireless serial stuff I found from ciseko in the uk and will
report on that next.
Control of the zoom focus and auto-iris to work on the Raymax cameras I bought - the zoom and focus were pretty easy to d, the auto-iris that was another story. But once I figured that all out, it turned out the lenses (like most) are not true zoom, they were varifocal and not very good ones at that. I will still probably use them, but having to adjust both zoom and focus everytime you change their point of view makes them not as useful as they need to be. A true zoom camera is supposed to keep focus throughout the range of views so somewhere down the road I hope I can find some at a decent price and get them integrated as well. For now, that's not really a priority as fixed lenses work well enough for what I want.
Just curious, do you work with CCTV for a living or just a hobby?
Thanks for sharing , always had a system like that in mind , allot of cams and full controll. and a nice controll panel.
I would do it completly different I think , Allot less wires. but never started doing something like your project yet ,so time will tell .
2 Tips I think
#1 i would make a PCB . so not all those loose boards. only 1 , order an extra for backup , or 2
drawing in a pcb program is not that difficult , programs like diptrace , or Kicad (opensource ) are pretty easy to understand , and there is allot to read about them on the net.
#2 use a male-female socket combination instead of those wire to boad connectors
Either Way great work