Surveillance Camera Pan/Tilt Decoder Electronics Project

Surveillance Camera Pan/Tilt Decoder Kit Description: Surveillance Camera Pan/Tilt Decoder Kit
Assembly Time: 1-2 Hours
Difficulty: Intermediate
Designer: shawshark

Would you like to do more with your security camera or DVR system? If your security camera system's Pan/Tilt/Zoom (PTZ) capability uses a RS485 and the Pelco-D or Pelco-P standard, this kit could help provide up to 6 relay outputs with your current system. This kit acts as an interface between your camera system and the other things you want to control, like playing a recorded message, turning on a light or controlling motors, you decide.

This unit can also be set to a possible 255 address combinations, so multiple units can be used together. Each relay output can switch a maximum 500mA load and provides a visible red LED indicator. The outputs can be configured to operate as momentary or latching outputs.

Build Your Own Surveillance Camera Pan/Tilt Decoder Kit

Required tools and components:

5 Capacitor 100pF 50 Volt Ceramic Disc
10 Silicon Rectifier Diode 400 Volt 1A DO-41
1 Standard Regulator 5 Volt 1A, 3-Pin (3+Tab) TO-220
1 Jack, DC Power, Male 2.1mm, Solder Terminal Signal
5 Capacitor, Ceramic, Disc, 0.1µF, 25V, 20%
10 Transistor, 2N3904, NPN
6 Relay, G5V-1-DC5
1 IC, LTC485CN8 (ADM485JN), DIP-8
5 Socket, IC, 18-Pin, 390261-5
5 Socket, IC, 8-Pin, 390261-2
1 Header, 0.1" Straight Male, 1 Row, 3-Pin
1 Tactile Switch, SPST, Off-(On)
1 Switch Slide, SPDT, On-On
10 Resistor, CF, 120Ω, 1/4 Watt, 5%
10 Resistor, CF, 330Ω, 1/4 Watt, 5%
10 Resistor, CF, 1KΩ, 1/4 Watt, 5%
10 Resistor, CF, 10KΩ, 1/4 Watt, 5%
10 Resistor, CF, 100KΩ, 1/4 Watt, 5%
10 LED, 5mm, Hi-Eff Red, Diffused
6 Header, 3.5mm, Terminal Block, 3 Positions
5 Capacitor, Radial, 4.7ΩF, 50V, 20%, 85°C

PICAXE 18M2 Microcontroller (Needs a PIC programmer AND to be programmed with a Pelco-P or Pelco-D decoder software)
Soldering iron and solder
Masking tape (optional)
Wire cutters
Digital Multimeter (optional)
Needle nose pliers

Step 1 - Setting Up

Make sure you always have a clean working surface and that all your tools are handy. You should work on a surface where you don't mind if solder drops or scratches are made with tools and component leads.

Step 2 - Organizing Your Components

If you have an ESD strap, put it on. Unpack your kit and make sure all of the components are included. Start by separating them by category, for example passives would be resistors and capacitors. Ideally we'll start soldering these first and then move onto diodes, transistors (if any) and ICs, in this case our dual op-amp.

Step 3 - Soldering the Passives Components

Start by soldering the resistors to the board and make sure you solder the right one at the right place! – Double check with your multimeter against the schematic before you solder each resistor. Remember not to touch the leads with your fingers while probing them because you will alter the reading by adding parallel resistance (and other parasitic components).

You can bend their leads outwards or inwards to make sure the resistors don't fall off. When you are done soldering go ahead and clip them. The ideal soldering technique involves touching the pad and the lead at the same time with the tip of your iron and promptly feeding solder to the tip and then onto the pad, once the solder has flowed you can remove the tip of your iron to obtain a perfect joint.

Next, solder the pin headers. You can snap them easily with your hands but you can use some pliers to get a clean separation. The easiest way to get them to solder nice and even is to add a bit of solder to one of the pads, tinting it (that is, covering it slightly with solder) then we push the pin header in while heating this pad. The solder will quickly melt and once the header is in, will solidify leaving the header in place.

Next we proceed by soldering the opposite pin, then we go back to the first pin and resolder it (the first joint was temporary). By going back and forth you spread the heat evenly and thus diminish the stress on the parts.

Pin Headers:
JP1 - (3-pin) Input Select
JP2 - (3-pin) 10K Pot - Optional, you can either solder wires directly or use a proper connector with the pinheader
JP3 - (2-pin) External Input (Switch or Jumper)
JP4 - (5-pin) Breakout for the remaining OpAmp, Optional
JP5 - (2-pin) DUT (Device Under Test) - One side is grounded
JP6 - (2-pin) Power - Optional, wires could be soldered directly instead
TP1 - (1-pin) Test Point, Input level at OpAmp - Optional
TP2 - (1-pin) Test Point, Shunt level - Optional
TP3 - (1-pin) Test Point, Input level at Potentiometer - Optional
TP4 - (1-pin) Test Point, External Input level - Optional

Once you are done with the headers, move on to the capacitors. Proceed with the capacitors in the same way you soldered your resistors. Remember that most electrolytic capacitors are polarized, so you have to orient them properly. Luckily we only have one electrolytic and the silkscreen will guide you through.

Step 4 - Adding the active components

There are 4 diodes. One is a rectifier (1N4007) used as an input protection diode for the power section, the other two (1N5225) are 3.0V zeners and we are using them to protect our device by limiting the maximum amount of current we may pass through the MOSFET and shunts. After all we're basically "translating" input voltage to output current, and we don't want to ruin our precious work by mistakenly supplying 12V to the input line, right? The last diode (1N5817) is a Schottky and it's used to protect the MOSFET from voltage transients.

Before soldering the diodes, make sure they are properly oriented. The big black diode is the 1N4007 that goes to the power input, the cathode (where the line is) has to point toward the big capacitor. But just to make sure you're soldering the right part in the right place, read its markings first.

The other two (1N5225) are used slightly different, because their function differs as well. D1 and D2 will have their anodes to ground, in this configuration the zeners will shunt excess voltage to ground. The last one (1N5817) goes near the MOSFET, again, make sure the orientation is correct; the silkscreen on the PCB will guide you.

Solder your active components quickly; excess heat can damage silicon junctions.

Step 5 - Adding the Last of the Components

Solder the IC socket, making sure that the notch is pointing toward the heatsink area. We're using a socket for it's flexibility, you may choose to upgrade the op-amp or, in case of an unfortunate accident – replace it in the future without having to re-solder.

Continue with the MOSFET. Remember that MOSFETs are sensitive to ESD (Electro-Static Discharge) sohandle them with care. Make sure you get the MOSFET the right way around! – Consult the datasheet, but usually you can just look at it and know that the first lead is Gate followed by Drain and Source (1, 2, 3 = GDS) - Follow the silkscreen! Solder the MOSFET only after fitting it against the heatsink, this will allow you to get the height just right. It's a good time to prepare the insulation kit now. Install the heatsink and mount the MOSFET to the heatsink.

Solder the leads to your potentiometer and rotary switch, then solder accordingly to the pin headers (or you can use connectors, it's up to you. Another alternative is to avoid the pin headers and simply solder the wires directly to the board, then stress-relief them with hot-glue) Now, don't insert the op-amp just yet. Let's go to the next step where I'll explain why.

Step 6 - Testing and Troubleshooting

With the op-amp out of the socket, power up the board and probe the power pins on the socket to make sure you are getting the right supply voltages. If you have a scope, probe and see if there's any ripple that shouldn't be there (if there is, inspect your external power supply).

With the input mode set to "internal" measure TP1, or PIN 3 of the socket. You should see a voltage from 0 to 3v, based on the position of the potentiometer. If you don't, you may have the zener the wrong way around or there could be another problem, troubleshoot it.

Step 7 - Testing and troubleshooting (Part 2)

We may test the "external" mode at this point, it's merely a bypass but we have to test to see if the lower zener diode is functioning properly. We will input a voltage from 0 to 5V, slowly sweeping up while probing TP1, or PIN 3, of the socket. The voltage should not go much higher than 3V, if it does, there's something wrong with D1.

At this point we may place the op-amp, make sure your potentiometer is set to 0 output (probe TP1 and expect near 0V) – Connect your test supply (capable of at least half an amp) and slowly turn the potentiometer up until TP1 reads 100mV. At this point we should be drawing roughly 100mA from the supply, you can check with your meter in mA / A range, connected in series with the supply.

If all goes well, we just need to add the finishing touches such as cable ties and an enclosure if need be. Some extra protection such as a fast blow fuse can be added as well as indicator LEDs for each mode would be a welcome addition.

Advanced: The unused op-amp (TL072 contains two op-amps) has a break-out with VCC, GND and the two inputs and the output, this allows you to use the op-amp for future expansion. Having the inputs floating shouldn't cause any trouble in this particular application, however if you feel the need to "terminate" the inputs, connect them to a voltage divider set to half the supply voltage, instead of grounding them.

SchematicSchematic (Click for larger image)

Step 8 - Finishing notes

Feel free to improve on the design and report your findings! – Remember that this is not meant to replace or mimic any lab-grade test equipment, its mere purpose is to provide us with a rough dummy load. With almost no modifications we can actually use this circuit as a constant current source as well by placing our DUT (Device Under Test) across the supply, in series. I hope you find this device useful, Have fun and enjoy!