You are on page 1of 7

cONSTRUCTION

REMOTE-CONTROLLED
6-CAMERA CCTV SWITCHER
 s. das Gupta auto (the switcher selects the cameras
one by one and holds videos of each

C
losed-circuit television (CCTV) camera till the preprogrammed time) RISH k.
S.V.N. HA
uses video cameras to transmit 5. Auto mode: You can change
signals to specific monitors. It ‘on’ time of each camera (hold time)
differs from broadcast television in that individually through the remote.
the signal is not openly transmitted, Time can be programmed from 0 to Parts List
though it may employ point-to-point 255 seconds. Semiconductors:
wireless links. CCTV is often used for 6. Camera bypass: You can set any IC1 - PIC16F72 microcontroller
IC2-IC4 - CD4066 quad bilateral CMOS
surveillance in areas that need security, camera in bypass mode by entering switch
0-second ‘on’ time for cameras IC5 - UTC820 power amplifier
T1-T6 - BC547
which you want to bypass or IC6 - 78S12 voltage regulator
don’t want to watch during IC7 - 7805 voltage regulator
XTAL1 - 4MHz crystal
auto mode. D1-D4 - 1N4007 diode
7. Audio: One-way audio. LED1-LED6 - LED, 5mm red
In this model, you can hear the LED7 - LED, 5mm green
IRx - TSOP1738 IR receiver
audio from the camera selected
Resistors (all ¼-watt, ±5% carbon unless stated
by the switcher. otherwise):
8. Video: Two video-out R1 - 10-kilo-ohm
R2, R13 - 2.2-kilo-ohm
RCA sockets with 75-ohm im- R3-R8 - 470-ohm
pedance 1Vp-p are available R9, R10 - 75-ohm
R15 - 47-ohm, 1-watt
at the rear panel of the master R11, R16 - 47-ohm
unit. You can connect two moni- R12 - 1-ohm
tors in these sockets. R14 - 1-kilo-ohm
R17-R22 - 1-kilo-ohm
9. Other features: Wide in- VR1 - 10-kilo-ohm
put voltage range, long-range VR2 - 10-kilo-ohm, log,
potmeter
infrared remote commander,
Fig. 1: Pin configuration of PIC16F72 microcontroller in Capacitors:
PDIP package microcontroller-based design C1 - 1000µF, 35V electrolytic
supported with CMOS digital C2 - 220µF, 40V electrolytic
C3, C10, C13,
such as banks, casinos, shops, depart- integrated circuits, liquid-crystal dis- C16 - 100µF, 25V electrolytic
mental stores and airports or military play to monitor the status and bilateral C4, C5 - 33pF ceramic
C6, C8, C14,
installations. digital MOS switches for switching the C18 - 0.1µF mylar
Here is a remote-controlled CCTV analogue video/audio signals from C7, C9 - 47µF, 16V electrolytic
switcher circuit to monitor six cameras cameras C11 - 680pF ceramic
C12 - 22µF, 25V electrolytic
on a single or dual monitor/TV. The At the heart of the circuit is Micro- C15 - 220µF, 25V electrolytic
salient features of this switcher are: chip’s PIC16F72 microcontroller, which C17 - 10µF, 25V electrolytic
1. Cameras: Six cameras with one- controls all the functions described Miscellaneous:
X1 - 0-15V, 2A secondary
way audio (audio incoming only) in the design. Its pin configuration is transformer
2. Operation: Fully remote-con- shown in Fig. 1. S1 - DPDT rocker switch
SK1-SK6 - 5-pin DIN socket
trolled (infrared commander) SK7, SK8 - RCA socket
3. Front display: LCD to display The circuit LCD - 16×2 LCD with backlight
Remote - No. 6710V00079B (type LG TV)
the camera selected and all other func- Fig. 2 shows the main control circuit
LS - 8-ohm, 6.4cm speaker
tions/parameters of the camera switcher. In this circuit, CON1 - 7-pin bergstrip connector
4. Camera selection: Manual (you PIC16F72 microcontroller controls (male/female)
CON2-CON7 - 2-pin SIP connector
can select any camera of your choice all the functions such as interfacing/ (male/female)
by pressing number keys or camera initialising the LCD to display all CON8 - 12-pin bergstrip connector
(male/female)
up/down keys on the remote) and the desired characters on the screen,

7 0 • J u ly 2 0 1 0 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction

Fig. 2: CCTV switcher circuit

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • J u ly 2 0 1 0 • 7 1
cONSTRUCTION
decoding the RC-5 command on remote control and providing high A remote sensor is connected to
pressing the required keys of the logic to enable corresponding bilateral port RB0 (pin 21), called interrupt
CMOS analogue port, of the controller and the software
Table I switches to con- initialises interrupt routines along with
Pin Details of CCTV Camera DIN Socket nect the video sig- timer-0 interrupt to decode the RC-5
Socket Camera Signal Switch (IC) Enable pins to
nal from cameras command. The RC-5 protocol was de-
microcontroller to the video-out- scribed in March 2007 issue of EFY, so
put socket and au- it is not discussed here.
SK1 Camera-1 Video S2a (IC4) Port (RC7)-pin 18
dio signals to the Any transmission from the remote
SK1 Camera-1 Audio S2b (IC4) Port (RC7)-pin 18
power amplifier of consists of two start bits, one toggle bit,
SK2 Camera-2 Video S3a (IC4) Port (RC6)-pin 17
the corresponding 5-bit address and 6-bit command. Here
SK2 Camera-2 Audio S3b (IC4) Port (RC6)-pin 17
camera selected we have not used the 5-bit address. A
SK3 Camera-3 Video S4a (IC3) Port (RC5)-pin 16
from the remote. biphase-modulated bit can be thought
SK3 Camera-3 Audio S4b (IC3) Port (RC5)-pin 16
Here we have used of as two separate bits that are always
SK4 Camera-4 Video S5a (IC3) Port (RC4)-pin 15
the remote con- the inverse of each other. A logical
SK4 Camera-4 Audio S5b (IC3) Port (RC4)-pin 15
trol of an LG TV zero is represented by a ‘10’ pattern
SK5 Camera-5 Video S6a (IC2) Port (RC1)-pin 12
(remote code No. on the IR input, while a logical one is
SK5 Camera-5 Audio S6b (IC2) Port (RC1)-pin 12
6710V00079B). It is represented by a ‘01’ pattern. That is
SK6 Camera-6 Video S7a (IC2) Port (RC0)-pin 11 readily available in basically used to decode the received
SK6 Camera-6 Audio S7b (IC2) Port (RC0)-pin 11 the market. message.
Toggle bit is a particular property
Table II of the RC-5 protocol. This bit changes
Truth Table for Port C polarity every time you press a key
and will remain unchanged as long
PORT RC7 RC6 RC5 RC4 RC1 RC0 Camera-ON
as you hold the key. That enables
Port C 1 0 0 0 0 0 Camera-1 the receiver to detect released keys,
Port C 0 1 0 0 0 0 Camera-2 which helps to eliminate key bounces.
Port C 0 0 1 0 0 0 Camera-3 We have also used this bit to detect
Port C 0 0 0 1 0 0 Camera-4 so that if any key is kept pressed for
Port C 0 0 0 0 1 0 Camera-5 a long time, the routine detects the
Port C 0 0 0 0 0 1 Camera-6 command once, keeps the value in a
general-purpose register called ‘pass-
dummy’ (refer to ‘.asm’ file), and does
not process and store any further com-
mand till the remote key is released.
The stored RC-5 command value in
register ‘passdummy’ is used to per-
form the necessary function given in
the source code.
The LCD shows the camera num-
ber selected from the remote and mode
of operation (auto/manual).
For camera-hold time set for auto
mode and other display text informa-
tion, please see the LCD screenshot
in Fig. 3. Use of the LCD makes the
project more user-friendly.
All the cameras are to be con-
nected to SK1 through SK6 (5-pin
DIN connector) as shown in the circuit
diagram. The extreme right and left
pins are for 12V positive and negative
supply (to be fed from the regulated
Fig. 3: Screenshots of LCD power supply of the main switcher)

7 2 • J u ly 2 0 1 0 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction
Enable pins of switch pairs S2a-S2b,
S3a-S3b, S4a-S4b, S5a-S5b, S6a-S6b and
S7a-S7b of IC2 through IC4 are shorted
to each other and fed to the corre-
sponding port of Port C as shown in
Table I. The microcontroller provides
high logic at Port-C pins to switch on
a particular camera. The truth table for
Port C is shown in Table II.
Immediately after switching on
the mains, the standby LED (LED7)
connected to Port-C pin RC3 glows
Fig. 4: Circuit for regulated power supply and the LCD shows the welcome page
(refer to the LCD screenshot).
On pressing the power key on the
remote, the standby LED turns off and
the LCD shows which camera is ‘on,’
in which mode it is now and default
hold time for the corresponding cam-
era in ‘Auto’ mode.
As described above, pins of Port C
(RC0, RC1, RC4-RC7) are connected to
IC2 through IC4 for selecting the cam-
era to be switched on. LED1 through
LED6 are used to check the logic status
of Port C. Pressing keys ‘1’ through ‘6’
on the remote makes the correspond-
ing LEDs (LED1 through LED6) glow,
indicating ‘on’ condition of the cam-
eras (CAM-1 through CAM-6).
Here a 16-character, 2-line LCD
is used in 4-bit mode. Data lines D4
Fig. 5: Circuit diagram of power amplifier through D7 of the LCD are connected
to Port-B pins RB4 through RB7. En-
through IC4) and fed to the audio able (EN) and reset (RS) pins are con-
power amplifier and video output nected to RB2 and RB3 pins, respec-
sockets, respectively. tively, and the read/write (R/W) pin is
Each IC has four CMOS bilateral connected to ground as we have used
switches for transmission or multiplex- the LCD in writing mode only. Preset
ing of analogue or digital signals. It is VR1 (10-kilo-ohm) is used for setting
pin-to-pin compatible with IC CD4016, the LCD character contrast.
but has much lower ‘on’ resistance,
which is relatively constant over the Power supply
input signal range. A simple circuit for regulated supply
Video and audio signals from SK1 (shown in Fig. 4) is used here. The
Fig. 6: Pin diagram of UTC820 audio power
(camera 1) are connected to S2a and +12V regulated output is used to pow-
amplifier S2b, respectively, and both the enable er all the six cameras, IC2 through IC4
pins (to switch on both the switches) and IC5 and fed to another 7805 volt-
for the built-in camera module. The are shorted out and connected to port age regulator (IC7) to get the regulated
12V power supply is permanently RC7 (pin 18) of the microcontroller. +5V output for the microcontroller
connected to all the cameras. Audio Similarly, audio and video signals (IC1) and the LCD.
and video signals from the cameras from SK2 through SK6 are connected The current rating of the trans-
are selected using switch pairs S2a- to IC2 through IC4 and then to Port C former should be around 2A, depend-
S2b through S7a-S7b (built inside IC2 of IC1 as shown in Table I. ing on the current consumption of the

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • J u ly 2 0 1 0 • 7 3
cONSTRUCTION
supply voltage range of 3V to to select the cameras by pressing the
14V and minimum external number keys or the camera up/down
components. keys.) To change to automatic selec-
The pin configuration of tion (auto) mode, press ‘mute’ key
IC UTC820 is shown in Fig. and the switcher selects the cameras
6. Components at pin 2 of the one by one automatically. Pressing
IC5 decide closed-loop volt- this key again will return the mode of
age gain (dB) of the ampli- selection to manual, and vice versa.
fier. Here a 47-ohm resistor Camera up key (PR∆ key). By
(R11) and a 22µF capacitor pressing the camera-up key, the
(C12) are used and, with switcher selects the next camera. For
these values, about 45dB example, if the LCD is showing cam-
closed-loop voltage gain is era-2, pressing this key once makes
achieved. You can reduce the the switcher jump to camera-3. Each
component values for more successive pressing of this key will
gain but it’s not required make the switcher jump to the next
here as maximum gain of 75 camera.
dB is possible. Capacitor C10 Camera down key (PR∇ key). By
(100µF) connected between pressing the camera-down key, the
pins 5 and 7 of IC5 is used for switcher selects the preceding camera.
bootstrap and improving the For example, if the LCD is showing
low-frequency signal. The camera-4, pressing this key once makes
amplifier output at pin 5 is the switcher jump back to camera-3.
connected to the speaker via On each successive pressing of this
C13. The audio signal from key, the switcher jumps back to the
the cameras is fed to input previous camera.
pin 3 of the IC via volume Time set up/down key (Vol+/
control VR2 (10-kilo-ohm), Vol– key). In auto mode, the switcher
capacitor C17 and resistor selects the cameras one by one and the
R13. Here the output power picture of the selected camera is held
is limited to about 500 mW at up for a certain time. By default, the
8-ohm load approximately, so microcontroller sets this hold time as
use of a good-quality 6.4cm 5 seconds. You can change this time
speaker is recommended. for each camera individually from 0
to 255 seconds.
Fig. 7: Remote control of LG TV
Functions of To change this time, press the edit
remote control keys key (TV/AV) once. The switcher goes
cameras. Use a good-quality heat-sink The functions of various remote keys to the edit mode. Select the camera (for
for both the regulators. are shown in Fig. 7. which you want to change the time) by
Power on/off key. Press it once pressing the camera up/down key. On
Power amplifier to switch on the switcher and press each successive pressing of the time set
A simple power amplifier (see Fig. 5) again to turn off or keep the switcher up key, the time increments up to 255
is used to amplify the sound signal in standby mode and vice versa. (AC seconds maximum.
from the cameras and hear it on a small mains should be ‘on’ in both the cases.) On each successive pressing of the
speaker. Camera selection key. Select any time set-down key, the time decre-
The audio power amplifier is built of the six cameras manually by press- ments up to zero. If you set 0-second
around IC UTC820 (IC5). UTC820 is ing any of the numerical keys ‘1’ time for any camera, the switcher by-
a monolithic integrated circuit audio through ‘6’ once. For example, to se- passes this camera during selection in
amplifier delivering an output of 1.2 lect camera-3 press ‘3’ on the remote, auto mode. For example, if you set the
watts at 9V on an 8-ohm speaker load and to select camera-5 press ‘5’ on the time as 0-second for camera-3, in auto
with 10 per cent total harmonic distor- remote. mode, the switcher selects camera-1,
tion (THD) and good ripple rejection. Auto/manual. By default, the mi- camera-2, camera-4, camera-5 and
It is designed for audio-frequency crocontroller sets the mode of selec- camera-6. Here the switcher bypasses
class-B amplifier with a wide operating tion to manual. (In that case, you have camera-3. This function is useful if you

7 4 • J u ly 2 0 1 0 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m
Construction
want to skip certain cameras.
Edit key (TV/AV). To change the
camera hold-up time for ‘auto mode,’
enter ‘edit’ mode first by pressing this
key once and then set the desired time
by pressing the time up/down key as
described above. To exit edit mode af-
ter setting the time, press the same key
on the remote once again. The control-
ler goes back to manual mode.

Testing and
troubleshooting
After assembling the circuit without
microcontroller, apply the power using
‘on’/’off’ switch S1. Check the DC volt-
age at pin 3 of regulator IC7. It should
be +5V. Check the same voltage at pins
1 and 20 of the base of IC1.
Now, switch off the power, insert
the microcontroller in its base and re-
check all the connections from the PCB
to the LCD and IR sensor TSOP1738. Fig. 8: Actual-size, single-side PCB for the remote-controlled 6-camera CCTV switcher
On applying the power, page-1 and
page-2 text should display on the LCD
screen. Using the remote, switch on the
switcher and change the functional sta-
tus on the LCD by referring to CCTV
switcher remote commander (shown
in Fig. 7) and LCD screenshots (shown
in Fig. 3).
Adjust VR1 for maximum con-
trast on the LCD. If you don’t get any
output on the LCD, troubleshoot as
follows:
1. No output on the LCD. Switch
off the power and check continuity
between the LCD and various pins of
IC1 and regulator IC as shown in the
schematic diagram. If the connections
are Ok, switch on the power, vary VR1
and check the voltage at pin 3 of the
LCD (0V to 5V).
2. No backlight on the LCD. Check
the voltage at pin 15 (+5V) and pin 16
(0V) of the LCD.
3. Page 1/page 2 is shown on the Fig. 9: Component layout for the PCB
screen but the remote commander
doesn’t work (nothing happens on at pin 3, replace the IR sensor or check using S1. Now the LCD should show
pressing functional keys of the remote). the PCB, etc for shorting. page-1 and page-2 as shown in Fig. 3.
Check the supply at pin 2 of the IR sen- Once the LCD shows page-1 and At the same time, pin 14 of the MCU
sor. It should be +5V. If +5V is avail- page-2 text properly and the remote should go high (+5V) and the power
able at pin 2, check the voltage at pin 3 commander is working, switch off standby LED should glow. Now press
of the IR sensor. If there is no voltage the power and then switch it on again ‘Power’ key on the remote. Pin 14

w w w. e f y m ag . co m e l e c t ro n i c s f o r yo u • J u ly 2 0 1 0 • 7 5
cONSTRUCTION
of the MCU should go low and the accordingly. If the LEDs don’t glow in this month’s EFY-CD.
standby LED should turn off, and vice according to the truth table, replace
versa, on pressing the same key again. the microcontroller. Construction
If this doesn’t happen, replace the mi- When camera-1 is selected, the A single-side, solder-side PCB layout
crocontroller. LCD should show camera-1 and LED1 for the microcontroller-based remote-
Connect LED1 through LED6 should glow. If the monitor does not controlled six-camera CCTV switcher
to connector CON1. Press ‘Power’ show the video of camera-1, or you is shown in Fig. 8 and its component
key on the remote to switch on the hear no audio from the power ampli- layout in Fig. 9.
switcher. Page-3 text should appear fier, check 5V logic at pins 5 and 6 of Connect CCTV cameras in the
on the LCD, showing camera-1 is ‘on,’ IC4. If there is no voltage at these pins, sockets provided (SK1 through
the switcher is in manual mode and check the availability of 0.6V at the SK6). Also connect the LCD and
the default time of camera hold for base of transistor T5, +5V at its emitter remaining components (as shown
auto mode. At the same time, Port-C and +12V at its collector. Follow the in Fig. 2) and +5V and +12V from
pin RC7 should go high and LED1 same procedure for all other cameras the power supply circuit. Now a
should glow. Select other cameras and their corresponding switching cir- welcome message will appear. Press
either by pressing keys 1 through 6 or cuits. ‘Power’ key on the remote to start
camera up/down keys of the remote the switcher.
and check whether the correspond- Software EFY note. The complete project
ing LEDs (LED1 through LED6) are The source program is written in As- folder containing the source code and
glowing (refer to Port-C truth table). sembly language and compiled using other related files is included in this
Simultaneously, page-3 should show MPASM tool suite. The explanation of month’s EFY-CD and is also available
the corresponding camera number the Assembly source code is included on www.efymag.com. 

7 6 • J u ly 2 0 1 0 • e l e c t ro n i c s f o r yo u w w w. e f y m ag . co m

You might also like