You are on page 1of 75

CCTV SECURITY SYSTEM

CHAPTER 1 INTRODUCTION

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

INTRODUCTION
Now a days most of the fields depend on less manual operations and due to this demand every one is interested in automated systems. To face new challenges in the present day situation automated systems are more accurate, flexible and reliable. Due to these reasons every field prefers automated control systems. Especially in electronics automated systems are doing better job. This system consists of sensors, stepper motors, TV, camera, micro controller, and Buzzer alarm. Sensors are connecting to the gates. Buzzer alarm, TV, and stepper motor these all are connecting to the micro controller. The alarm is ON if any one enters through the gate. Stepper motor is used for rotate the camera. If any one enters through gate the sensors sense the signal then automatically the alarm ON through micro controller operations. Camera observes the every thing at the gate. Camera rotates according to the micro controller instructions. With closed circuit TV we know who enters in to the gate. With this system we can provide security. Micro controller controls these all operations through assembly language instruction The project is mainly based on the assembly language program to run the Micro controller.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

1.1 OBJECTIVE OF THE PROJECT


Now a days most of the fields depend on less manual operations and due to this Demand every one is interested in automated systems. To face new challenges in the present day situation automated systems are more accurate, flexible and reliable. Due to these reasons every field prefers automated control systems. Especially in electronics automated systems are doing better job. The ideal system to protect your property is CCTV (Closed Circuit Television) Not only does it act a visual deterrent but the video or digital recording provides an invaluable method of recording crime, violence or anti-social behavior. CCTV systems offer such a wide area of applications and benefits 24-hours a day. Systems can aid the monitoring of stock, personnel, visitors, access control and prevent health and safety incidences.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

1.2 BLOCK DIAGRAM


Rx IR Rx IR Rx IR Rx
IR TX with 555 Timer IR TX with 555 Timer

IR Tx with 555 TIMER

CAMERA

MICRO CONTROLLER

DRIVER CIRCUIT

STEPPER

BUZZER CIRCUIT

5V POWER SUPPLY 12V

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

1.3 BLOCK DIAGRAM DESCRPTION

MICROCONTROLLER UNIT (89C51): The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer, which provides a highly flexible and cost-effective solution to many embedded control applications. CCTV The ideal system to protect your property is CCTV (Closed Circuit Television). Not only does it act a visual deterrent but the video or digital recording provides an invaluable method of recording crime, violence or anti-social behavior. These days, there is a huge range of CCTV product to choose from, with a wealth of features. Systems range from a simple analogue or digital package to highly advanced digital systems which can be integrated into our other security systems such as intruder alarm or access control. CCTV verification of intruder alarm activation makes for the ultimate security system. CCTV can be used to monitor virtually anything: town centers, public transport, Domestic and commercial premises as well as stock, machinery, personnel, visitors, access control and Health & Safety requirements - the list is endless.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM IR SENSOR The infrared band can be divided into Near Infrared (NIR) and Far Infrared (IR). Far infrared is the thermal infrared used to detect hot objects or see heat leaks in buildings, and is way beyond the range of LEDs. NIR can be further divided into two bands, long wave and short-wave NIR, based on how film and CCD cameras react, which I'll get into elsewhere, else when, and else why. POWER SUPPLY Power supply unit provides 5V regulated power supply to the systems. It consists of two parts namely, Rectifier and Monolithic voltage regulator.

1.4 SCHEMATIC DIAGRAM

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM


D 1 1 T 1 1 5 6 4 8 D 2 1N 4 007 C 1 10 00u f c 2 ,4 7 0 u f D 3 L E D 78 05 3 V IN V O U T R 1 1k

V C C

12 v 1N 4 007

DR I V ER
V C C

C IR C U IT
COIL

1.2k
TS O P 17 3 8
39 38 P 0 .0 /A D 0 P 0 .1 /A D 1 P 0 .2 /A D 2 P 0 .3 /A D 3 P 0 .4 /A D 4 P 0 .5 /A D 5 21 P 2 .0 /A 8 22 P 2 .1 /A 9 23 P 2 .2 /A 1 0 24 P 2 .3 /A 1 1 25 P 2 .4 /A 1 2 26 P 2 .5 /A 1 3 27 P 2 .6 /A 1 4 1 2v M O TO R S T E P P E R 1 2 3 COIL

10 0 0 .1 u f IR L E D

P 1 .0

10K
2

I RF 5 4 0

37 10k 7 3 1 k 1 V C C1 0 k 10u f 2 3 B C 548 A 36 35 34

D S C H GO U T

D R IV E R C I RC U I T

1 0 k 0 .0 1 u f

5 4 C V 6 R S T 2 TH R TR G 8 V C C N E 555

33 3 2 P 0 .6 /A D 6 P 0 .7 /A D 7 1 2 3 4 5 6 P 1 .0 P 1 .1 P 1 .2 P 1 .3 P 1 .4 P 1 .5 P 1 .6 P 1 .7 X T A L1 X T A L2 E A /V P P R S T

1.2k

10K

BC 5 4 8

A T 89 C 5 1

28 P 2 .7 /A 1 5

10 P 3 .0 /R X D 11 P 3 .1 /T X D

P 1 .1

10K
2

I R F5 4 0

12 P 3 .2 /IN T 0 13 P 3 .3 /IN T 1 14 P 3 .4 / T 0 15 P 3 .5 / T 1 16 P 3 .6 /W R 17 P 3 .7 / R D 30 A L E /P R O G 29 P S E N 1 2v

30PF 30PF

11.0592MHz

D R IV E R C I RC U I T
COIL

8 19 18

1.2k

10K

B C5 4 8

V C C

V C C

31 9

P 1 .2

10K
2

I R F5 4 0

IN 4007

1 00 K
3

10 K
A T8 9C 5 1

10K

B C5 4 8

1 2v 2

B C 5 4 8
1

D R IV E R C I RC U I T
COIL

10uf
2 0K

1.2k

P 1 .3
V C C

10K
2

I R F5 4 0

100 0 .1 u f

T S O P1 7 3 8
LS 1 V C C V C C 1 10 0 10k 10k 2 B C 54 8A 2 B U ZZE R 1 V C C 3

IR L E D

1 0k 3 1 7 3 1k 1 2 V C C1 0 k 1 0uf 3 2 B C 548A 4

D S C H GO U T

10 k 0 .01uf

5 4 C V 6 R S T 2 TH R TR G 8 V C C N E 5 55

V C C

100 0.1uf IR L E D 10 0

V C C

T S O P1 7 3 8

1 0k 7 3 1 k 1 V C C1 0 k 10uf 2 3 B C 548 A

0 .1 u f 10 k

D S C H GO U T

IR L E D 10 k 0.01u f 3

5 4 C V 6 R S T 2 TH R TR G 8 V C C N E 5 55

D S C H GO U T

3 1k

B C 5 48A 10u f10k 1

1 0k

5 4 C V 0 .0 1 u f 6 R S T 2 T H R T R G 8 V C C N E 55 5

V C C

www.final-yearproject.com | www.finalyearthesis.com

10K

B C5 4 8

TS O P 17 3 8

4 5 6

CCTV SECURITY SYSTEM

CHAPTER 2 WORKING PRINCIPLE

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

WORKING PRINCIPLE

Each IR is connected with an I/O line of the controller. In the initial condition the IR Sensor OUT PUT is in ZERO. I/O line value is compared. When Intruder enters IR receiver gives High value. With this the stepper motor rotates in particular angle. The angle of rotations given by the shaft angle of stepper motor. The pulses are given from the I/O lines of stepper motor. The pulses are fed to the driver circuit through which MOSFET drives the ground corresponds to the coil connected. This magnetizes the internal coil and shaft is attracted or rippled by the coil, by this it rotates depend on the shaft rotation angle.

The rotation of angle given by the step sequence. The supply for stepper motor that is 12V DC is taken from the rectifier circuit and 5v for driver circuit and Micro Controller. The alarm is ON if any one enters through the gate. Stepper motor is used for rotate the camera. If any one enters through gate the sensors sense the signal then automatically the alarm ON through micro controller operations. Camera observes the every thing at the gate. Camera rotates according to the micro controller instructions. With closed circuit TV we know who enters in to the gate. With this system we can provide security. Micro controller controls these all operations through assembly language instructions.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

CHAPTER 3 DESIGN PROCEDURE

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

INTRODUCTION TO EMBEDDED SYSTEMS


DEFINITION A combination of hardware and software, which together form a component of a larger machine. An example of an embedded system is a microprocessor that controls a cctv security system. An embedded system is designed to run its own without human intervention, and may be required to respond to events in real time. A specialized computer system that is part of a large system or machines typically, an embedded system is housed on a single microprocessor board with the program stored in ROM. Virtually all appliances that have a digital interface watches, microwaves and VCRs utilize embedded systems. Some embedded systems include an operating system, but many are so specialized that the entire logic can be implemented as a single program. Each day, our lives become more dependent on EMBEDDED SYSTEMS, digital information technology that is embedded in our environment. IMPORTANAT FEATURES OF EMBEDDED SYSTEMS Embedded systems perform a very specific task and they cant be programmed to Embedded systems have very limited resources, particularly the memory. Generally they do not have secondary devices such as CD-ROM, Floppy Disk. Embedded systems have to operate in extreme environmental conditions such as very

different things.

high temperatures and humidity. APPLICATION AREAS OF EMBEDDED SYSTEMS Consumer Appliances Office Automation Medical Electronics Advertisement

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

MICRO CONTROLLER
3.1 8-BIT MICROCONTROLLERS 3.1.1 INTRODUCTION Looking back into the history of microcomputers, one would at first come across the development of microprocessor i.e. the processing element, and later on the peripheral devices. The three basic elements-the CPU, I/O devices and memory-have developed in distinct directions. While the CPU has been the proprietary item, the memory devices fall into general-purpose category and the I/O devices may be grouped somewhere in-between. The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer, which provides a highly flexible and cost-effective solution to many embedded control applications. The AT89C51 provides for 4k EPROM/ROM, 128 byte RAM and 32 I/O lines. It also includes a universal asynchronous receive-transmit (UART) device, two 16-bit timer/counters and elaborate interrupt logic. Lack of multiply and divide instructions which had been always felt in 8-bit microprocessors/micro controllers, has also been taken care of in the 89C51- Thus the 89C51 may be called nearly equivalent of the following devices on a single chip: 8085 + 8255 + 8251 + 8253 + 2764 + 6116. In short, the AT89C51 has the following on-chip facilities: ROM (EPROM on 8751) 128 byte RAM UART

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM 32 input-output port lines Two, 16-bit timer/counters Six interrupt sources and On-chip clock oscillator and power on reset circuitry PINDIAGRAM

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

3.1.2 INTERNAL BLOCK DIAGRAM

Fig 3.1 AT89C51 internal block diagram

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

3.1.3 SALIENT FEATURES The 89C51 can be configured to bypass the internal 4 k ROM and run solely with external program memory. For this its external access (EA) pin has to be grounded, which makes it equivalent to 8031. The program store enable (PSEN) signal acts as read pulse for program memory. The data memory is external only and a separate RD* signal is available for reading its contents. Use of external memory requires that three of its 8-bit ports (out of four) are configured to provide data/address multiplexed bus. Hi address bus and control signals related to external memory use. The RXD and TXD ports of UART also appear on pins 10 and 11 of 8051 and 8031, respectively. One 8-bit port, which is bit addressable and, extremely useful for control applications. The UART utilizes one of the internal timers for generation of baud rate. The crystal used for generation of CPU clock has therefore to be chosen carefully. The 11.0596 MHz crystals; available abundantly, can provide a baud rate of 9600. The internal RAM utilizes the 256-byte address space and special function registers (SFRs) array, which is separate from external data RAM space of 64k. The 007F space is occupied by the RAM and the 80 - FF space by the SFRs. The 128 byte internal RAM has been utilized in the following fashion: 00-IF: Used for four banks of eight registers of 8-bit each. The four banks may be selected by software any time during the program. 20-2F: The 16 bytes may be used as 128 bits of individually addressable locations. These are extremely useful for bit-oriented programs. 30- 7F: This area is used for temporary storage, pointers and stack. On reset, the stack starts at 08 and gets incremented during use. The list of special function registers along with their hex addresses is given. www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

Table 4.1.1 AT89C51 Address register

Addr. 80 81 82 83 88 89 8A 8B 8C 8D 90 98 99 A0 A8 B0 B8 D0 E0 F0

Port/Register P0 (Port 0) SP (stack pointer) DPH (data pointer High) DPL (data pointer Low) TCON (timer control) TMOD (timer mode) TLO (timer 0 low byte) TL1 (timer 1 low byte) TH0 (timer 0 high byte) TH1 (timer 1 high byte) P1 (port 1) SCON (serial control) SBUF (serial buffer) P2 (port 2) Interrupt enable (IE) P3 (port 3) Interrupt priority (IP) Processor status word (PSW) Accumulator (ACC) B register Table 3.1 AT89C51 SFR

3.1.4 HARDWARE DETAILS The on chip oscillator of 89C51 can be used to generate system clock. Depending upon version of the device, crystals from 3.5 to 12 MHz may be used for this purpose. The system clock is internally divided by 6 and the resultant time period becomes one processor cycle. The instructions take mostly one or two processor cycles to execute, and very occasionally three processor cycles. The ALE (address latch enable) pulse rate is

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM 16th of the system clock, except during access of internal program memory, and thus can be used for timing purposes. AT89C51 SERIAL PORT PINS PIN P3.ORXD P3.ITXD P3.2INTO P3.3INT1 P3.4TO P3.5T1 P3.6WR P3.7RD ALTERNATE USE Serial data input Serial data output External interrupt 0 External interrupt 1 External timer 0 input External timer 1 input External memory write pulse External memory read pulse Table 3.2 AT89C51 serial port pins The two internal timers are wired to the system clock and pre scaling factor is decided by the software, apart from the count stored in the two bytes of the timer control registers. One of the counters, as mentioned earlier, is used for Generation of baud rate clock for the UART. It would be of interest to know that the 8052 have a third timer, which is usually used for generation of baud rate. The reset input is normally low and taking it high resets the micro controller, In the present hardware, a separate CMOS circuit has been used for generation of reset signal so that it could be used to drive external devices as well. 3.1.5 WRITING THE SOFTWARE The 89C51 have been specifically developed for control applications. As mentioned earlier, out of the 128 bytes of internal RAM, 16 bytes have been organized in such a way that all the 128 bits associated with this group may be accessed bit wise to facilitate their use for bit set/reset/test applications. These are therefore extremely useful for programs involving individual logical operations. One can easily give example of lift SFR SBUF SBUF TCON-1 TCON- 2 TMOD TMOD ------------

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM for one such application where each one of the floors, door condition, etc may be depicted by a single hit. The 89C51 have instructions for bit manipulation and testing. Apart from these, it has 8-bit multiply and divides instructions, which may be used with advantage. The 89C51 has short branch instructions for 'within page' and conditional jumps, short jumps and calls within 2k memory space which are very convenient, and as such the controller seems to favor programs which are less than 2k byte long. Some versions of 8751 EPROM devices have a security bit which can be programmed to lock the device and then the contents of internal program EPROM cannot be read. The device has to be erased in full for further alteration, and thus it can only be reused but not copied. EEPROM and FLASH memory versions of the device are also available now. 3.1.6 MEMORY UNIT Memory is part of the micro controller whose function is to store data. The easiest way to explain it is to describe it as one big closet with lots of drawers. If we suppose that we marked the drawers in such a way that they cannot be confused, any of their contents will then be easily accessible. It is enough to know the designation of the drawer and so we will know its contents for sure. Memory components are exactly like that. For certain input we get the contents of a certain addressed memory location and thats all. Two new concepts are brought to us: addressing and memory location. Memory consists of all memory locations, and addressing is nothing but selecting one of them. This means that we need to select the desired memory location on one hand, and on the other hand we need to wait for the contents of that location. Besides reading from a memory location, memory must also provide for writing onto it. Supplying an additional line, called control line does this. We will designate this line as R/W (read/write). Control line is used in the following way: if r/w=1, reading is done, and if opposite is true then writing is done on the memory location. Memory is the first element, and we need a few operation of our micro controller. www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM 3.1.7 CENTRAL PROCESSING UNIT Let add 3 more memory locations to a specific block that will have a built in capability to multiply, divide, subtract, and move its contents from one memory location onto another. The part we just added in is called central processing unit (CPU). Its memory locations are called registers. Registers are therefore memory locations whose role is to help with performing various mathematical operations or any other operations with data wherever data can be found. Look at the current situation. We have two independent entities (memory and CPU), that are interconnected, and thus any exchange of data is hindered, as well as its functionality. If, for example, we wish to add the contents of two memory locations and return the result again back to memory, we would need a connection between memory and CPU. Simply stated, we must have some way through data goes from one block to another. 3.1.8 BUS That way is called bus. Physically, it represents a group of 8, 16, or more wires. There are two types of buses: address and data bus. The first one consists of as many lines as the amount of memory we wish to address and the other one is as wide as data, in our case 8 bits or the connection line. First one serves to transmit address from CPU memory, and the second to connect all blocks inside the micro controller. 3.1.9 INPUT OUTPUT UNIT VCC Supply voltage. GND Ground. Port 0

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory. In this mode P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification. External pull-ups are required during program verification. Port 1 Port 1 is an 8-bit bi-directional I/O port with internal pullups.The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 1 also receives the low-order address bytes during Flash programming and verification. Port 2 Port 2 is an 8-bit bi-directional I/O port with internal pullups.The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memories that use 16-bit addresses (MOVX @DPTR). In this application, it uses strong internal pull-ups when emitting 1s. During accesses to external data memories that use 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM Port 3 Port 3 is an 8-bit bi-directional I/O port with internal pullups.The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 also serves the functions of various special features of the AT89C51 as listed below:

Port 3 also receives some control signals for Flash programming and verification. RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. ALE/PROG Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation ALE is emitted at a constant rate

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALEdisable bit has no effect if the micro controller is in external execution mode. PSEN Program Store Enable is the read strobe to external program memory. When the AT89C51 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. EA/VPP External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming, for parts that require 12-volt VPP.

XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2
Output from the inverting oscillator amplifier.

Oscillator Characteristics
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which can be configured for use as an on-chip oscillator, as shown in www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM Figure 1. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 2.There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed. Idle Mode In idle mode, the CPU puts itself to sleep while all the on chip peripherals remain active. The mode is invoked by software. The content of the on-chip RAM and all the special functions registers remain unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a hardware reset. It should be noted that when idle is terminated by a hard ware reset, the device normally resumes program execution, from where it left off, up to two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits access to internal RAM in this event, but access to the port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset, the instruction following the one that invokes

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM IdleShould not be one that writes to a port pin or to external memory.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

Power-down Mode In the power-down mode, the oscillator is stopped, and the instruction that invokes power-down is the last instruction executed. The on-chip RAM and Special Function Registers retain their values until the power-down mode is terminated. The only exit from power-down is a hardware reset. Reset redefines the SFRs but does not change the on-chip RAM. The reset should not be activated before VCC is restored to its normal operating level and must be held active long enough to allow the oscillator to restart and stabilize. Programming the Flash The AT89C51 is normally shipped with the on-chip Flash memory array in the erased state (that is, contents = FFH) and ready to be programmed. The programming interface accepts either a high-voltage (12-volt) or a low-voltage (VCC) program enable signal. The low-voltage programming mode provides a convenient way to program the AT89C51 inside the users system, while the high-voltage programming mode is compatible with conventional third party Flash or EPROM programmers. The AT89C51 is shipped with either the high-voltage or low-voltage programming mode enabled. The respective top-side marking and device signature codes are listed in the following table.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

3.2 STEPPER MOTOR


3.2.1 INTRODUCTION Stepper Motors have several features which distinguish them from AC Motors, and DC Servo Motors. Brushless - Steppers are brush less Motors with contact brushes create sparks, undesirable in certain environments. (Space missions, for example.) Holding Torque - Steppers have very good low speed and holding torque. Steppers are usually rated in terms of their holding force (oz/in) and can even hold a position (to a lesser degree) without power applied, using magnetic 'detent' torque. Open loop positioning - Perhaps the most valuable and interesting feature of a stepper is the ability to position the shaft in fine predictable increments, without need to query the motor as to its position. Steppers can run 'open-loop' without the need for any kind of encoder to determine the shaft position. Closed loop systems- systems that feed back position information, are known as servo systems. Compared to servos, steppers are very easy to control; the position of the shaft is guaranteed as long as the torque of the motor is sufficient for the load, under all its operating conditions. Load Independent - The rotation speed of a stepper is independent of load, provided it has sufficient torque to overcome slipping. The higher rpm a stepper motor is driven, the more torque it needs, so all steppers eventually poop out at some rpm and start slipping. Slipping is usually a disaster for steppers, because the position of the shaft becomes unknown. For this reason, software usually keeps the stepping rate within a maximum top rate. In applications where a known RPM is needed under a varying load, steppers can be very handy.

3.2.2 Types of steppers: Stepper Motors come in a variety of sizes, and strengths, from tiny floppy disk motors, to huge machinery steppers rated over 1000 oz in. There are two basic types of

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM steppers-- bipolar and unipolar. The bipolar stepper has 4 wires. Unipolar steppers have 5, 6 or 8 wires. This document will discuss control of Unipolar Steppers. Motor Basics: The Unipolar Stepper motor has 2 coils, simple lengths of wound wire. The coils are identical and are not electrically connected. Each coil has a center tap - a wire coming out from the coil that is midway in length between its two terminals. You can identify the separate coils by touching the terminal wires together-- If the terminals of a coil are connected, the shaft becomes harder to turn. Because of the long length of the wound wire, it has a significant resistance (and inductance). You can identify the center tap by measuring resistance with a suitable ohm-meter (capable of measuring low resistance <10 ohm) the resistance from a terminal to the center tap is half the resistance from the two terminals of a coil. Coil resistance of half a coil is usually stamped on the motor; For example, '5 ohms/phase' indicates the resistance from center taps to either terminal of a coil. The resistance from terminal to terminal should be 10 ohms.

Fig stepper motor coil diagram

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM Motor Control Circuitry:

Fig magnetic field diagram Current flowing through a coil produces a magnet field which attracts a permanent magnet rotor which is connected to the shaft of the motor. The basic principle of stepper control is to reverse the direction of current through the 2 coils of a stepper motor, in sequence, in order to influence the rotor. Since there are 2 coils and 2 directions, that gives us a possible 4-phase sequence. All we need to do is get the sequencing right and the motor will turn continuously. You may wonder how the stepper can achieve such fine stepping increments with only a 4-phase sequence. The internal arrangement of the motor is quite complex- the winding and core repeating around the perimeter of the motor many times. The rotors are advanced only a small angle, either forward or reverse, and the 4-phase sequence is repeated many times before a complete revolution occurs.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

Fig stepper motor basic control diagram Let us return to the 4-phase sequence of reversing the current though the 2 coils. A Bipolar stepper controller achieves the current reversal by reversing the polarity at the two terminals of a coil. The Unipolar controller takes advantage of the center tap to achieve the current reversal with a clever trick -- The Center tap is tied to the positive supply, and one of the 2 terminals is grounded to get the current flowing one direction. The other terminal is grounded to reverse the current. Current can thus flow in both directions, but only half coils are energized at a time. Both terminals are never grounded at the same time, which would energize both coils, achieving nothing but a waste of power.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

Conceptual Model of Unipolar Stepper Motor:

Fig conceptual model of unipolar stepper motor With center taps of the windings wired to the positive supply, the terminals of each winding are grounded, in sequence, to attract the rotor, which is indicated by the arrow in the picture. (Remember that a current through a coil produces a magnetic field.) This conceptual diagram depicts a 90-degree step per phase. In a basic "Wave Drive" clockwise sequence, winding 1a is de-activated and winding 2a activated to advance to the next phase. The rotor is guided in this manner from one winding to the next, producing a continuous cycle. Note that if two adjacent windings are activated, the rotor is attracted mid-way between the two windings. The following table describes 3 useful stepping sequences and their relative merits. The sequence pattern is represented with 4 bits; a '1' indicates an energized winding. After the last step in each sequence the sequence repeats. Stepping backwards through the sequence reverses the direction of the motor.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

Table of Stepping Sequences Sequence 0001 0010 0100 1000 0011 0110 1100 1001 0001 0011 0010 0110 0100 1100 1000 1001 Name Wave Drive, OnePhase HiTorque, TwoPhase Half-Step Half Step - Effectively doubles the stepping resolution of the motor, but the torque is not uniform for each step. (Since we are effectively switching between Wave Drive and Hi-Torque with each step, torque alternates each step.) This sequence reduces motor resonance, which can sometimes cause a motor to stall at a particular resonant frequency. Note that this sequence is 8 steps. Hi Torque - This sequence energizes two adjacent phases, which offers an improved torque-speed product and greater holding torque. Description Consumes the least power. Only one phase is energized at a time. Assures positional accuracy regardless of any winding imbalance in the motor.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM Identifying Stepper Motors:

Fig stepper motor identification diagram Stepper motors have numerous wires, 4, 5, 6, or 8. When you turn the shaft you will usually feel a "notched" movement. Motors with 4 wires are probably bipolar motors and will not work with a unipolar control circuit. The most common configurations are pictured above. You can use an ohm-meter to find the center tap - the resistance between the center and a leg is 1/2 that from leg to leg. Measuring from one coil to the other will show an open circuit, since the 2 coils are not connected. (Notice that if you touch all the wires together, with power off, the shaft is difficult to turn!)

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM Shortcut for finding the proper wiring sequence: Connect the center tap(s) to the power source (or current-Limiting resistor.) Connect the remaining 4 wires in any pattern. If it doesn't work, you only need try these 2 swaps... 1 1 1 2 2 8 4 8 2 8 4 4 (Arbitrary first wiring order) (switch end pair) (switch middle pair)

You're finished when the motor turns smoothly in either direction. If the motor turns in the opposite direction from desired, reverse the wires so that ABCD would become DCBA. Heat Considerations: Over-heating can be an early indicator of a problem or need for additional heat sinking. This is true of both the controller and motors. Components can be warm to the touch, but not so hot that you can't leave your finger on them for a few seconds. Motors are designed to be mounted in such a way that, heat is drawn away from the motors. This is usually accomplished with a metal mounting bracket. Motors that are not yet mounted may require some type of temporary heat sinking. Motors heat more running at the LOW speeds or in Hold Mode. If a component or motor is running too hot, try using the Wave Drive stepping mode only, if it still runs too hot, try heat sinking, and/or a fan. If it still runs too hot, something is wrong.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

3.3 STEPPER MOTOR DRIVER


12v

DRIVER CIRCUIT
V C C

1.2k 10K
P 1 .0 2

IRF540

Fig - stepper motor drive circuit When the output of the controller is high, the base current I flows in to base of the transistor, thus providing voltage drop more then 0.7V across the Ve junction, thus the transistor goes in to saturation mode. So the IC is maximum and the voltage drop across the Vce junction is zero. I.e. the input to MOSFET is zero. So the MOSFET will not conduct and stepper motor coil will not energize. If the output of the controller is low, the base current I is zero, thus providing voltage drop less then 0.1V across the Ve junction, thus the transistor goes in to cut-off mode. So the IC is minimum and the voltage drop across the Vce junction is maximum. I.e. the input to MOSFET is almost Vcc. So the MOSFET will conduct and stepper motor coil get energized. For driving of motor coils, we used IRF540 MOSFET, which are having low onstate resistance so that the dissipation is less, fast switching and low thermal resistance. This MOSFET is driven by BC548 transistor. For each motor four MOSFET sections are required.

www.final-yearproject.com | www.finalyearthesis.com

10K

BC548

COIL

CCTV SECURITY SYSTEM

3.4 IR Tx and Rx
IR TRANSMITTER SECTION 3.4.1 555 Timer The 555 timer is one of the most remarkable integrated circuits ever developed. It comes in a single or dual package and even low power CMOS versions exist - ICM7555. Common part numbers are LM555, NE555, LM556, NE556. The 555 timer consists of two voltage comparators, a bi-stable flip flop, a discharge transistor, and a resistor divider network. The 555 monolithic timing circuits as a "highly stable controller capable of producing accurate time delays, or oscillation. In the time delay mode of operation, the time is precisely controlled by one external resistor and capacitor. For astable operation as an oscillator, the free running frequency and the duty cycle are both accurately controlled with two external resistors and one capacitor. The circuit may be triggered and reset on falling waveforms, and the output structure can source or sink up to 200mA." Infrared LEDs The infrared band can be divided into Near Infrared (NIR) and Far Infrared (IR). Far infrared is the thermal infrared used to detect hot objects or see heat leaks in buildings, and is way beyond the range of LEDs. (NIR can be further divided into two bands, long wave and short-wave NIR, based on how film and CCD cameras react, which I'll get into elsewhere, else when, and else why.) Infrared LEDs are sometimes called IR LEDs (Infra Red Emitting Diodes).

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

IR RECEIVER SECTION

3.4.2 TSOP1738 The TSOP1738 series are miniaturized receivers for infrared remote control systems. PIN diode and preamplifier are assembled on lead frame, the epoxy package is designed as IR filter. The demodulated output signal can directly be decoded by a microprocessor. TSOP1738 is the standard IR remote control receiver series, supporting all major transmission codes.

Many different receiver circuits exist on the market. The most important selection criteria are the modulation frequency used and the availability in you region.

In the picture above you can see a typical block diagram of such an IR receiver. Don't be alarmed if you don't understand this part of the description, for everything is built into one single electronic component. The received IR signal is picked up by the IR detection diode on the left side of the diagram. This signal is amplified and limited by the first 2 stages.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM The limiter acts as an AGC circuit to get a constant pulse level, regardless of the distance to the handset. As you can see only the AC signal is sent to the Band Pass Filter. The Band Pass Filter is tuned to the modulation frequency of the handset unit. Common frequencies range from 30 kHz to 60 kHz in consumer electronics. The next stages are a detector, integrator and comparator. The purpose of these three blocks is to detect the presence of the modulation frequency. If this modulation frequency is present the output of the comparator will be pulled low. All these blocks are integrated into a single electronic component. There are many different manufacturers of these components on the market. And most devices are available in several versions each of which are tuned to a particular modulation frequency. Please note that the amplifier is set to a very high gain. Therefore the system tends to start oscillating very easily. Placing a large capacitor of at least 22F close to the receiver's power connections is mandatory to decouple the power lines. Some data sheets recommend a resistor of 330 Ohms in series with the power supply to further decouple the power supply from the rest of the circuit. There are several manufacturers of IR receivers on the market. Siemens, Vishay and Telefunken are the main suppliers here in Europe. Siemens has its SFH506-xx series, where xx denotes the modulation frequency of 30, 33, 36, 38, 40 or 56 kHz. Telefunken had its TFMS5xx0 and TK18xx series, where xx again indicates the modulation frequency the device is tuned to. It appears that these parts have now become obsolete. They are replaced by the Vishay TSOP (Thin Small Outline Package) A very thin, plastic, rectangular surface mount chip package with gull-wing pins on its two short sides.12xx, TSOP48xx and TSOP62xx product series. Sharp, Xiamen Hualian and Japanese Electric are 3 Asian IR receiver producing companies. Sharp has devices with very cryptic ID names, like: GP1UD26xK, GP1UD27xK and GP1UD28xK, where x is related to the modulation frequency. Hualian

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM has its HRMxx00 series, like the HRM3700 and HRM3800. Japanese Electric has a series of devices that don't include the modulation frequency in the part's ID. The PIC12042LM is tuned to 36.7 kHz, and the PIC12043LM is tuned to 37.9 kHz. IR Receiver: The circuit of the TSOP 1738 is designed in that way that unexpected output pulses due to noise or disturbance signals are avoided. A band pass filter, an integrator stage and an automatic gain control are used to suppress such disturbances. The distinguishing mark between data signal and disturbance signal are carrier frequency, burst length and duty cycle. Some examples for such disturbance signals which are suppressed by the TSOP 17xx are: DC light (e.g. from tungsten bulb or sunlight) Continuous signal at 38 kHz or at any other frequency. Signals from fluorescent lamps with electronic ballast.

FEATURES: Photo detector and preamplifier in one package. Internal filter for PCM frequency. Improved shielding against electrical field disturbance. TTL and CMOS compatibility. Output active low. Low power consumption. High immunity against ambient light. Continuous data transmission possible (upto 2400 bps)

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM Available types for different carrier frequencies: Type TSOP1730 TSOP1736 TSOP1738 TSOP1756 DESCRIPTION: The TSOP1738 series are miniaturized receivers for infrared remote control systems. PIN diode and preamplifier are assembled on lead frame, the epoxy package is designed as IR filter. The demodulated output signal can directly be decoded by a microprocessor. TSOP1738 is the standard IR remote control receiver series, supporting all major transmission codes. fo 30KHz 36KHz 38KHz 56KHz Type TSOP1733 TSOP1737 TSOP1740 fo 33KHz 37KHz 40KHz

BLOCK DIAGRAM:

APPLICATION CIRCUIT:

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

SUITABLE DATA FORMAT: The circuit of the TSOP17.. Is designed in that way that unexpected output pulses due to noise or disturbance signals are avoided. A band pass filter, an integrator stage and an automatic gain control are used to suppress such disturbances. The distinguishing mark between data signal and disturbance signal are carrier frequency, burst length And duty cycle. The data signal should fulfill the following condition: Carrier frequency should be close to center frequency of the band pass. Burst length should be 10 cycles/burst or longer. After each burst which is between 10 cycles and 70 cycles a gap time of at least 14 cycles is necessary. For each burst which is longer than 1.8ms a corresponding gap time is necessary at some time in the data stream. This gap time should have at least same length as the burst. Up to 1400 short bursts per second can be received continuously. Some examples for suitable data format are: NEC Code, Toshiba Micom Format, Sharp Code, RC5 Code, RC6 Code, R2000 Code, Sony Format (SIRCS). www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

3.4.3 555 TIMER

The 555 timer is one of the most remarkable integrated circuits ever developed. It comes in a single or dual package and even low power CMOS versions exist - ICM7555. Common part numbers are LM555, NE555, LM556, NE556. The 555 timer consists of two voltage comparators, a bi-stable flip flop, a discharge transistor, and a resistor divider network. The 555 monolithic timing circuit as a "highly stable controller capable of producing accurate time delays, or oscillation. In the time delay mode of operation, the time is precisely controlled by one external resistor and capacitor. For a stable operation as an oscillator, the free running frequency and the duty cycle are both accurately controlled with two external resistors and one capacitor. The circuit may be triggered and reset on falling waveforms, and the output structure can source or sink up to 200mA." 1 Applications Applications include precision timing, pulse generation, sequential timing, time delay generation and pulse width modulation (PWM). 2 Pin Functions - 8 pin package Ground (Pin 1) - Not surprising this pin is connected directly to ground. Trigger (Pin 2) - This pin is the input to the lower comparator and is used to set the latch, which in turn causes the output to go high. Output (Pin 3) - Output high is about 1.7V less than supply. Output high is capable of I source up to 200mA while output low is capable of I sink up to 200mA. Reset (Pin 4) - This is used to reset the latch and return the output to a low state. The reset is an overriding function. When not used connect to V+.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM Control (Pin 5) - Allows access to the 2/3V+ voltage divider point when the 555 timer is used in voltage control mode. When not used connect to ground through a 0.01 uF capacitor. Threshold (Pin 6) - This is an input to the upper comparator. See data sheet for comprehensive explanation. Discharge (Pin 7) - This is the open collector to Q14 in figure 4 below. See data sheet for comprehensive explanation. V+ (Pin 8) - This connects to Vcc and the Philips data book states the ICM7555 cmos version operates 3V - 16V DC while the NE555 version is 3V - 16V DC. Note comments about effective supply filtering and bypassing this pin below under "General considerations with using a 555 timer"

3.4.4 555 timer in astable operation


When configured as an oscillator the 555 timer is configured as in figure 3.5 below. This is the free running mode and the trigger is tied to the threshold pin. At power-up, the capacitor is discharged, holding the trigger low. This triggers the timer, which establishes the capacitor charge path through Ra and Rb. When the capacitor reaches the threshold level of 2/3 Vcc, the output drops low and the discharge transistor turns on. The timing capacitor now discharges through Rb. When the capacitor voltage drops to 1/3 Vcc, the trigger comparator trips, automatically retriggering the timer, creating an oscillator whose frequency is determined by the formula in figure .

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

Figure - 555 timers in astable operation

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

3.5 TRANSISTOR
Transistors amplify current, for example they can be used to amplify the small output current from a logic chip so that it can operate a lamp, relay or other high current device. In many circuits a resistor is used to convert the changing current to a changing voltage, so the transistor is being used to amplify voltage. A transistor may be used as a switch (either fully on with maximum current, or fully off with no current) and as an amplifier (always partly on). The amount of current amplification is called the current gain, symbol hFE. Types of transistor There are two types of standard transistors, NPN and PNP, with different circuit symbols. The letters refer to the layers of semiconductor material used to make the transistor. Most transistors used today are NPN because this is the easiest type to make from silicon. If you are new to electronics it is best to start by learning how to use NPN transistors. The leads are labeled base (B), collector(C) and emitter (E). These terms refer to the internal operation of a transistor but they are not much help in understanding how a transistor is used, so just treat them as labels. Two transistors are connected together to give a very high current gain. In addition to standard (bipolar junction) transistors, there are field-effect transistors which are usually referred to as FETs. Heat sinks Waste heat is produced in transistors due to the current flowing through them. Heat sinks are needed for power transistors because they pass large currents. If you find that a transistor is becoming too hot to touch it certainly needs a heat sink! The heat sink helps to dissipate (remove) the heat by transferring it to the surrounding air.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM Testing a transistor Transistors can be damaged by heat when soldering or by misuse in a circuit. If you suspect that a transistor may be damaged there are two easy ways to test it: 1. Testing with a multimeter Use a battery, resistor and LED to check each pair of leads for conduction. Set a digital multimeter to diode test and an analogue multimeter to a low resistance range. Test each pair of leads both ways (six tests in total):

The base-emitter (BE) junction should behave like a diode and conduct one way only. The base-collector (BC) junction should behave like a diode and conduct one way only. The collector-emitter (CE) should not conduct either way.

2. Testing in a simple switching circuit Connect the transistor into the circuit shown on the right which uses the transistor as a switch. The supply voltage is not critical; anything between 5 and 12V is suitable. This circuit can be quickly built on for example. Take care to include the 10k resistor in the base connection or you will destroy the transistor as you test it. If the transistor is OK the LED should light when the switch is pressed and not light when the switch is released. To test a PNP transistor use the same circuit but reverse the LED and the supply voltage. Choosing a transistor Most projects will specify a particular transistor, but if necessary you can usually substitute an equivalent transistor from the wide range available. The most important properties to look for are the maximum collector current IC and the current gain hFE. To make selection easier most suppliers group their transistors in categories determined either by their typical use or maximum power rating.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM To make a final choice you will need to consult the tables of technical data which are normally provided in catalogues. They contain a great deal of useful information but they can be difficult to understand if you are not familiar with the abbreviations used. The table below shows the most important technical data for some popular transistors, tables in catalogues and reference books will usually show additional information but this is unlikely to be useful unless you are experienced. The quantities shown in the table are explained.

NPN transistors
Code BC107 Structure NPN Case style TO18 IC max. VCE hFE Ptot Category Possible max. min. max. (typical use) substitutes Audio, low 110 300mW BC182 BC547 power General BC108C 110 300mW purpose, low BC183 BC548 power General 420 600mW purpose, low power Audio BC109 NPN TO18 200mA 20V 200 300mW noise), power General BC182 NPN TO92C 100mA 50V 100 350mW purpose, low power General BC182L NPN TO92A 100mA 50V power Audio, (low low BC184 BC549

100mA 45V

BC108

NPN

TO18

100mA 20V

BC108C NPN

TO18

100mA 20V

BC107 BC182L

100 350mW purpose, low BC107 BC182 low

BC547B NPN BC548B NPN

TO92C 100mA 45V TO92C 100mA 30V

200 500mW

power 220 500mW General purpose, low

BC107B BC108B

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM power Audio BC549B NPN TO92C 100mA 30V 240 625mW noise), power General 2N3053 NPN TO39 700mA 40V 50 500mW purpose, low BFY51 power General BFY51 NPN TO39 1A 30V 40 800mW purpose, medium power General BC639 NPN TO92A 1A 80V 40 800mW purpose, medium power General TIP29A NPN TO220 1A 60V 40 30W purpose, high power General TIP31A NPN TO220 3A 60V 10 40W purpose, high power General TIP31C NPN TO220 3A 100V 10 40W purpose, high power General TIP41A NPN TO220 6A 60V 15 65W purpose, high power General 2N3055 NPN TO3 15A 60V 20 117W purpose, high power BFY51 BC639

(low low BC109

TIP31C TIP41A TIP31A TIP41A

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

Please note: the data in this table was compiled from several sources which are not entirely consistent! Most of the discrepancies are minor, but please consult information from your supplier if you require precise data. PNP transistors Code BC177 Structure PNP Case style TO18 IC max. VCE hFE Ptot Category Possible max. min. max. (typical use) substitutes Audio, low 125 300mW BC477 power General 120 600mW purpose, low BC478 power Audio BC179 PNP TO18 200mA 20V 180 600mW noise), power Audio, power General power General TIP32A PNP TO220 3A 60V 25 40W purpose, high TIP32C power General TIP32C PNP TO220 3A 100V 10 40W purpose, high TIP32A power (low low low

100mA 45V

BC178

PNP

TO18

200mA 25V

BC477

PNP

TO18

150mA 80V

125 360mW

BC177

BC478

PNP

TO18

150mA 40V

125 360mW purpose, low BC178

hfe

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM This is the current gain (strictly the DC current gain). The guaranteed minimum value is given because the actual value varies from transistor to transistor - even for those of the same type! Note that current gain is just a number so it has no units. The gain is often quoted at a particular collector current IC which is usually in the middle of the transistor's range, for example '100@20mA' means the gain is at least 100 at 20mA. Sometimes minimum and maximum values are given. Since the gain is roughly constant for various currents but it varies from transistor to transistor this detail is only really of interest to experts.

3.6 CAMERA & BUZZER


Camera
A camera is a device used to take pictures (usually photographs), either singly or in sequence, with or without sound recording, such as with video cameras. A camera that takes pictures singly is sometimes called a photo camera to distinguish it from a video camera. The name is derived from camera obscura, Latin for "dark chamber", an early www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM mechanism for projecting images in which an entire room functioned much as the internal workings of a modern photographic camera, except there was no way at this time to record the image short of manually tracing it. Cameras may work with the visual spectrum or other portions of the electromagnetic spectrum Every camera consists of some kind of enclosed chamber, with an opening or aperture at one end for light to enter, and a recording or viewing surface for capturing the light at the other end. Most cameras have a lens positioned in front of the camera's opening to gather the incoming light and to focus the image, or part of the image, on the recording surface. The diameter of the aperture is often controlled by a diaphragm mechanism, but some cameras have a fixed-size aperture. The size of the apperture and the brightness of the scene control the amount of light that enters the camera during a period of time, and the shutter controls the length of time that the light hits the recording surface. For example, in lower light situations, the shutter speed should be slower (longer time spent open) to allow the film to capture what little light is present. There are various ways of focusing a camera accurately. The simplest cameras have fixed focus and use a small aperture and wide-angle lens to ensure That everything within a certain range of distance from the lens (usually around 3 meters (10 feet) to infinity) is in reasonable focus. This is usually the kind found on oneuse cameras and other cheap cameras. The camera can also have a limited focusing range or scale-focus that is indicated on the camera body. The user will guess or calculate the distance to the subject and adjust the focus accordingly. On some cameras this is indicated by symbols (head-and-shoulders; two people standing upright; one tree; mountains). Rangefinder cameras focus by means of a coupled parallax unit on top of the camera. Single-lens reflex cameras allow the photographer to determine the focus and composition visually using the objective lens and a moving mirror to project the image onto a ground glass or plastic micro-prism screen. Twin-lens reflex cameras use an objective lens and a focusing lens unit (usually identical to the objective lens) in a parallel body for composition and focusing. View cameras use a ground glass screen

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM which is removed and replaced by either a photographic plate or a reusable holder containing sheet film before exposure. Traditional cameras capture light onto photographic film or photographic plate. Video and digital cameras use electronics, usually a charge coupled device (CCD) or sometimes a CMOS sensor to capture images which can be transferred or stored in tape or computer memory inside the camera for later playback or processing. Cameras that capture many images in sequence are known as movie cameras or as cin cameras in Europe; those designed for single images are still cameras. However these categories overlap, as still cameras are often used to capture moving images in special effects work and modern digital cameras are often able to trivially switch between still and motion recording modes. A video camera is a category of movie camera which stores images onto magnetic tape (either using analogue or digital technology). Stereo camera can take photographs that appear "three-dimensional" by taking two different photographs which are combined to create the illusion of Depth in the composite image. Stereo cameras for making 3D prints or slides have two lenses side by side. Stereo cameras for making lenticular prints have 3, 4, 5, or even more lenses. Micro Monochrome/color Camera has monochrome and color types. The lens of the Camera has two typical specifications: 3.6mm for monochrome type , 6mm for color type. All types of Cameras can be supplied with lens of the angle, focal length and specification to specific requirements of observers. This camera provides audio function, and can be equipped with infrared ray if observer requires. It can view the objects without outside light source; it is a full-function collector. This camera features complete functions, compact volume, low power consumption, high sensitivity and easy to operate. It also works together with other equipments including microcomputer to realize such capabilities as documents filming, photographing, complex video signal PAL(CCR) or NTS(ELA). This camera is equipped with clip type support, which can be detached at

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM our option, or be used to adjust the location to our desired level. We can choose a best location then clip the support and adjust the installation angle to ideal level. Beside this camera is connectable with other support to achieve higher flexibility. The working voltage of this camera is DC +6V-+12V. This camera can be powered on for a long time, but the input voltage can be not exceeded DC +12V, while current cannot be exceeded 250Mas. The connection mode of the power lead is + for internal terminal, - for external terminal. The yellow plug is video output cable, which can be connected with varieties of monitors and TV with video input jack to watch images.

Buzzer
The Buzzer signal from micro controller is a pulse output of 1sec. i.e. the output is high for 1sec. When the output of the controller is high, the base current I flows in to base of the transistor, thus providing voltage drop more then 0.7V across the Ve

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM junction, thus the transistor goes in to saturation mode. So the IC is maximum and the LED will glow and simultaneously, buzzer gives a beep sound. The buzzer is a sound-producing module it will generate continuous sound when the +5V is available. The transistor act as a switch and it follows the commands from MC. if the base of the transistor is low the buzzer in off condition due to transistor in cutoff state, and it will give sound when the base is in high logic due to transistor is in active state. Resistor act as a current limiter for transistor.

3.7 POWER SUPPLY

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

Fig 3.2 power supply

Power supply unit provides 5V regulates power supply to the systems. It consists of two parts namely, 1. Rectifier 2. Monolithic IC voltage regulator 3.7.1 Rectifier Here the step down transformer 230-0v/9-0-9 and gives the secondary current up to 500mA, to the Rectifier. The Transformer secondary is provided With a center tap. Hence the voltage V1 and V2 are equal and are having a phase difference of 1800. So it is anode of Diode D1 is positive with respect to the center tap, the anode of the other diode d2 will be negative with respect to the center tap. During the positive half cycle of the supply D1 conducts and current flows through the center tap D1 and load. During this period D2 will not conduct as its anode is at a negative potential. During the negative half cycle of the supply voltage, the voltage on the diode www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM D2 will be positive and hence D2 conducts. The current flows through the transformer winding, Diode D2 and load. It is to be noted that the current i1 and i2 are flowing in the same direction in load. The average of the two current i1 and i2 flows through the load producing a voltage drop, which is the D.C. output voltage of the rectifier. Using capacitor filters the ripple in the out waveform can be minimized. The voltage can be regulated by using monolithic IC voltage regulators.

3.7.2 Monolithic IC voltage regulator A voltage regulator is a circuit that supplies a constant voltage regardless of changes in load currents. Although voltage regulators can be designed using op-amps, it is quicker and easier to use IC voltage regulators. Furthermore, IC voltage regulators are versatile and relatively inexpensive and are available with features such as programmable output, current/voltage boosting, internal short-circuit current limiting, thermal shutdown and floating operation for high voltage applications Here we are using 7800 series voltage regulators. The 7800 series consists of 3terminal +ve voltage regulators with seven voltage options. These ICs are designed as fixed voltage regulators and with adequate heat sinking can deliver output currents in excess of 1A. Although these devices do not require external components, such components can be used to obtain adjustable voltages and currents. For proper operation a common ground between input and output voltages is required. In addition, the difference between input and output voltages (VI VO) called drop out voltage, must be typically 1.5V even during the low point as the input ripple voltage. Further more, the capacitor Ci is required if the regulator is located an appreciable distance from a power supply filter. Even though Co is not needed, it may be used to improve the transient response of the regulator. Typical performance parameters for voltage regulators are line regulation, load regulation, temperature stability and ripple rejection. Line regulation is defined as the change in output voltage for a change in the input voltage and is usually expressed in mille volts or as a percentage of Vo. Temperature stability or average temperature

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM coefficient of output voltage (TCVo) is the change in output voltage per unit change in temperature and is expressed in either mille volts/C or parts per million (PPM/C). Ripple rejection is the measure of a regulators ability to reject ripple voltage. It is usually expressed in decibels. The smaller the values of line regulation, load regulation and temperature stability the better the regulation.

3.8 SLOT SENSOR

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM


5 V 2 7 0 o h m 1 0 k o h m

O
D 1 L E D 1 2 3 Q 1 A

t p

Fig 3.8 Slot sensor It consists of photo diode and phototransistors. It is used to detect the position of the target. When the diode is in off state, no light falls on the base of phototransistor. So, it acts as open circuit. Thus output is high. This implies that the antenna and gun are present in their respective reference positions. When light falls on the photo diode that is on the base of the phototransistor then Q acts as short circuit and thus the output is low. This implies the antenna and gun are away from their respective reference positions.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

CHAPTER 4 RESULT

CCTV SECURITY SYSTEM KIT:

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

OUTPUT:

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

CHAPTER-5 APPLICATIONS AND ADVANTAGES

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

APPLICATIONS OF CCTV
Probably the most widely known use of CCTV is in security systems and such applications as retail shops, banks, government establishments, etc. The true scope for applications is almost unlimited. Some examples are listed below.

Monitoring traffic on a bridge. Recording the inside of a baking oven to find the cause of problems. A temporary system to carry out a traffic survey in a town centre. Time lapse recording for the animation of plasticine puppets. Used by the stage manager of a show to see obscured parts of a set. The well-publicised use at football stadiums. Hidden in buses to control vandalism. Recording the birth of a gorilla at a zoo. Making a wildlife program using a large model helicopter. Reproducing the infrared vision of a goldfish! Aerial photography from a hot air balloon. Production control in a factory. The list is almost endless and only limited by the imagination.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

CHAPTER 6 CONCLUSION

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

CONCLUSION
Each IR is connected with an I/O line of the controller. In the initial condition the IR Sensor OUT PUT is in ZERO. I/O line value is compared. When Intruder enters IR receiver gives High value. With this the stepper motor rotates in particular angle. The angle of rotations given by the shaft angle of stepper motor. The pulses are given from the I/O lines of stepper motor. The pulses are fed to the driver circuit through which MOSFET drives the ground corresponds to the coil connected. This magnetizes the internal coil and shaft is attracted or rippled by the coil, by this it rotates depend on the shaft rotation angle. The rotation of angle given by the step sequence. The supply for stepper motor that is 12V DC is taken from the rectifier circuit and 5v for driver circuit and Micro Controller.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

CHAPTER 7 SOURCE CODE

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

ALP
; ;> ;> TITLE : SECURITY SYSTEM USING IR AND CCTV ;> TARGET : AT89C51 ;> STARTED : 01-06-2006 ;> ; ;> ;> INCLUDES : $MOD51 ;> ; ;> ;> HARD WARE DETAILS : ;> ;> IR SENSOR INPUT1 - P2.1 IRIP1 BIT P2.1 ;> IR SENSOR INPUT2 - P2.2 IRIP2 BIT P2.2 ;> IR SENSOR INPUT3 - P2.3 IRIP3 BIT P2.3 ;> IR SENSOR INPUT4 - P2.4 IRIP4 BIT P2.4 ;> SLOT SENSOR INPUT - P2.0 SSI BIT P2.0 ;> BUZZER CONTROL - P2.5 BUZ BIT P2.5 ;> ; ;> ;> FLAGS :

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM DIR_FLG ;> ; ;> ;> ;> ; ;> ;> ;> ;> ; ;> ;> BIT 01H

VARIABLES : STEP_CNT DIR_CNT

DATA 30H DATA 31H

DEFINITIONS SPTR

: EQU 65H

VECTOR ADDRESESS: ORG 0000H Limp RESET

; program starting

;> ; ;> RESET: mov P2, #0FFH ; move all ports HIGH mov P3, #0FFH mov P1, #0FFH mov P0, #0FFH mov sp, #SPTR ; init stack pointer mov DIR_CNT, #00H mov DPTR, #0800H mov STEP_CNT, #0FFh lcall BRING_MOT_HOME ;> ; ;> MAIN: xrl clr mov anl xrl jz setb jnb P2, #20H BUZ A, P1 A, #0FH A, #00H MAIN BUZ IRIP1, SENSE1

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM lcall BRING_MOT_HOME mov DIR_CNT, #00H SENSE1: jnb IRIP2, SENSE2 LOOP_FB1: mov A, DIR_CNT cjne A, #45D, CHEK_ERR1 ljmp SENSE2 CHEK_ERR1: jnc MOVE_RIGHT1 lcall MOVE_FRWD inc DIR_CNT ljmp MOVE_LEFT1 MOVE_RIGHT1: lcall MOVE_REV dec DIR_CNT MOVE_LEFT1: lcall DLY1 ljmp LOOP_FB1 SENSE2: jnb IRIP3, SENSE3 LOOP_FB2: mov A, DIR_CNT cjne A, #145D, CHEK_ERR2 ljmp SENSE3 CHEK_ERR2: jnc MOVE_RIGHT2 inc DIR_CNT lcall MOVE_FRWD ljmp MOVE_LEFT2 MOVE_RIGHT2: lcall MOVE_REV dec DIR_CNT MOVE_LEFT2: lcall DLY1 ljmp LOOP_FB2 SENSE3: jnb IRIP4, SENSE4 LOOP_FB3: mov A, DIR_CNT cjne A, #220D, CHEK_ERR3 ljmp SENSE4 CHEK_ERR3: www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM jnc MOVE_RIGHT3 inc DIR_CNT lcall MOVE_FRWD ljmp MOVE_LEFT3 MOVE_RIGHT3: lcall MOVE_REV dec DIR_CNT MOVE_LEFT3: lcall DLY1 ljmp LOOP_FB3 SENSE4: ljmp MAIN ;> ; ;> MOVE_FRWD: mov A, STEP_CNT movc A, @A+dptr mov P1, A inc STEP_CNT mov A, STEP_CNT cjne A, #04h, NOTCH1 mov STEP_CNT, #00h NOTCH1: ret ;> ; ;> MOVE_REV: mov A, STEP_CNT movc A, @A+dptr mov P1, A dec STEP_CNT mov A, STEP_CNT cjne A, #0FFh, NOTCH4 mov STEP_CNT, #03h NOTCH4: ret ;> ; ;> BRING_MOT_HOME: jb SSI, STOP_MOT_HOME lcall MOVE_REV lcall DLY1 lcall DLY1 www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM jnb SSI, BRING_MOT_HOME STOP_MOT_HOME: ret ;> ; ;> ; software delay loops DLY: mov r4, #1fh GONE: mov r5, #00h OUT: mov r6, #00h IN: djnz r6, IN djnz r5, OUT djnz r4, GONE ret DLY1: mov r4, #04h GONE1: mov r5, #05h OUT1: mov r6, #00h IN1: djnz r6, IN1 djnz r5, OUT1 djnz r4, GONE1 ret DLY2: mov r4, #10h GONE2: mov r5, #7Fh OUT2: mov r6, #00h IN2: djnz r6, IN2 djnz r5, OUT2 djnz r4, GONE2 ret ;> ; ;> ORG 0800H db db db db ;> ; ;> END 0AH 06H 05H 09H

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

BIBILOGRAPHY
www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM

BIBLIOGRAPHY Books
1. Kennedy, Electronic Communication Systems, McGraw-Hill Publ, 2001 2. D.Roy Chowdhury, Linear Integrated Circuits, New Age International (P) Ltd., 2003 3. Kenneth J.Ayala,The 8051 MicroController,Penram International, Second edition, 1997 4. Douglas V. Hall, Micro Processor and Interfacing, TMH, Second Edition. 5. A.K.Ray and K.M.Bhurchandi. Advanced Micro Processors and

Peripherals, TMH, 2000.

www.final-yearproject.com | www.finalyearthesis.com

CCTV SECURITY SYSTEM 6. The 8051 Microcontroller and Embedded Systems Using Assembly and C , second edition Muhammad Ali Mazidi., Janice Gillispie Mazidi, Rolin D. McKinlay

Websites
1. www.nationalsemicondutor.com 2. www.atmel.com 3. www.wikipedia.org 4. www.stepperworld.com 5. www.discovercircuits.com

www.final-yearproject.com | www.finalyearthesis.com

You might also like