7
DILSHAN R JAYAKODY ([email protected]) Colombo, Sri Lanka All the soſtware and firmware programs are distribute under the terms of All the schemacs, PCB designs and other documents are distribute under the terms of This work is licensed under the Creave Commons Aribuon-ShareAlike 3.0 Unported License. To view a copy of this license, visit hp://creavecommons.org/licenses/by-sa/3.0/ or send a leer to Creave Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. In this project we design low cost high performance programmable home security system using few LDR’s as an input sensors. When above sensor(s) get triggered system may dial the user specified phone number (using build-in DTMF generator) and acvate the high power audio alarm and lights. All the parameters of DTMF generator, audio alarm and light interface are programmed through the RS232 serial interface. Current firmware of this system presents interacve control system through the RS232 interface. This control system consist with the menu driven configuraon opons, self tests, system report generators, etc. This system also contain 5W (with 4Ω speaker) audio alarm with three selectable tone configuraons, which include Police siren, Fire engine siren and Ambulance siren. Integrated Circuits This system uses a Microchip’s PIC16F877A as a main controller, LM339 as sensor interface, UM3561 as a tone generator and µPC2002 as a speaker driver (audio amplifier). LM7805, LM7812 and LM317 voltage regulators are used to obtain +5V, +12V and +3V respecvely. Assembly The PCB design given with this arcle makes the assembly much simpler. As PCB contain 230V AC main lines care must be taken while assembling the circuit. As shown in the fig.1 all the photoelectric SYSTEM FEATURES Touch tone phone dialing interface 5W High powerful audio alarm 2 sensor interface with separate sensitivity adjustments Programmed through the RS232 interface Build-In intelligent light ON/OFF switch

Programmable Home Security Alarm System

Embed Size (px)

DESCRIPTION

In this project we design low cost high performance programmable home security system. This system uses a few LDR's as input sensors. When above sensor(s) get triggered system may dial the user specified phone number (using build-in DTMF generator) and activate the high power audio alarm and lights. All the parameters of DTMF generator, audio alarm and light interface are programmed through the RS232 serial interface. Current firmware of this system presents interactive control system through the RS232 interface. This control system consist with the menu driven configuration options, self tests, system report generators, etc. This system also contain 5W (with 4Ω speaker) audio alarm with three selectable tone configurations, which include Police siren, Fire engine siren and Ambulance siren.

Citation preview

Page 1: Programmable Home Security Alarm System

DILSHAN R JAYAKODY ([email protected])

Colombo, Sri Lanka

All the software and firmware programs are

distribute under the terms of

All the schematics, PCB designs and other

documents are distribute under the terms of

This work is licensed under the Creative Commons

Attribution-ShareAlike 3.0 Unported License. To view

a copy of this license, visit

http://creativecommons.org/licenses/by-sa/3.0/ or

send a letter to Creative Commons, 171 Second

Street, Suite 300, San Francisco, California, 94105,

USA.

In this project we design low cost high performance

programmable home security system using few LDR’s

as an input sensors. When above sensor(s) get

triggered system may dial the user specified phone

number (using build-in DTMF generator) and activate

the high power audio alarm and lights. All the

parameters of DTMF generator, audio alarm and light

interface are programmed through the RS232 serial

interface.

Current firmware of this system presents interactive

control system through the RS232 interface. This

control system consist with the menu driven

configuration options, self tests, system report

generators, etc.

This system also contain 5W (with 4Ω speaker) audio

alarm with three selectable tone configurations,

which include Police siren, Fire engine siren and

Ambulance siren.

Integrated Circuits

This system uses a Microchip’s PIC16F877A as a main

controller, LM339 as sensor interface, UM3561 as a

tone generator and µPC2002 as a speaker driver

(audio amplifier). LM7805, LM7812 and LM317

voltage regulators are used to obtain +5V, +12V and

+3V respectively.

Assembly

The PCB design given with this article makes the

assembly much simpler. As PCB contain 230V AC

main lines care must be taken while assembling the

circuit. As shown in the fig.1 all the photoelectric

SYSTEM FEATURES

Touch tone phone dialing interface

5W High powerful audio alarm

2 sensor interface with separate

sensitivity adjustments

Programmed through the RS232

interface

Build-In intelligent light ON/OFF switch

Page 2: Programmable Home Security Alarm System

DC Power Input (18V) RS232 Serial Interface Connector

PHONE / LINE Connector

3V LASER Light Supply Line

Tone Selector

Alarm Volume Control

Alarm Audio Output

Status indicator

Connector for Sensor 1

Connector for Sensor 2

Reset switch

Phone dialer enable switch

Environment Sensor

Beeper

230V Light connector

Program/Run switch connector

Fig.1 - Connectors, Jumpers and other controls of the Programmable Home Security Alarm System

sensors, some of the switches and alarm speaker are

connected with the circuit through the connector

bars.

External connectors and controls

DC Power input : Attach DC power supply with 18V -

25V (2A Max.) output.

RS232 Connector : Connect RS232 serial cable to the

port to configure the system. Do not use RS232 Null

Modem cable with this port.

PHONE/LINE connector : Attach standard RJ12/RJ11

telephone cable connector to this port. One port is

need to use with the phone line and remaining port is

for the phone (and it is optional).

3V LASER supply : 3V supply line for LASER diode

assembly.

Connectors for Sensor 1/2 : Attach high sensitive

LDRs for these ports. To get the maximum sensitivity

it is recommended to use EG&G VACTEC LDRs.

Status Indicator : Indicate run, program and sensor

trigger modes.

Reset Switch : Press this button to reset entire alarm

system. This button enable only when the audible

alarm get activated. It is not possible to use this

function at the phone dialing/ringer states.

Phone dialer enable switch : Turn on this switch to

enable the phone dialing feature of this system.

Environment Sensor : In-circuit LDR to detect light

conditions of the environment.

Alarm Volume Control : Use this to control the

output power (volume) of the audible alarm.

230V Light connector : Attach 230V AC light (or

related peripheral) to these terminals.

Tone Selector : Configure the master alarm tone

from this jumper as follows,

1—2 : Fire Engine Siren

2—3 : Ambulance Siren

Open : Police Siren

(Do not connect jumper terminal 1—3, this

combination may permanently damage the entire

system)

Beeper : Produce beeps (e.g: at the input error, etc.)

Page 3: Programmable Home Security Alarm System

Program / Run Switch connector : Attach switch to

this header to select Program or Run mode.

Alarm Audio Output : Attach 8Ω (8W) or 4Ω (10W)

speaker to this connector.

Calibration and Testing

Once everything is assembled take following steps to

calibrate the system,

1. Remove IC1, IC2, IC3 and IC4 from the IC bases.

2. Apply 18V ( to 22V Max.) DC source to the power

connector (J3).

3. Check the voltage between Pin12 (GND) and Pin3

of IC2. It need to be 4.8V - 5.1V DC.

4. Check the voltage between GND and E$4 jumper.

It need to be 11.7V - 12.3V DC.

5. Check the voltage between Pin1 and Pin3 (GND)

of JP1. It need to be 2.5V - 3.1 V

6. If all the above Step 3, 4 and 5 are correct,

disconnect the power supply and insert IC1, IC2,

IC3 and IC4 in to the appropriate IC bases. Attach

suitable speaker to the X4 and connect RS232

cable to the system.

7. Close the jumper J2 (Program Mode) and power

on the system.

8. Download and install PuTTY on to the target

computer and setup the “Serial” connection with

9600 baud rate (see Fig. 3).

9. Press “2” and enter into the “Parameter Setup”

mode. Configure all the parameter options with

the appropriate settings.

10. Attach phone line to the PHONE/LINE connector

and fix photoelectric LDR sensors to the X1 and

X2 connectors.

11. Press “3” and execute “Self Test”.

12. Adjust R4*, R6* and R8* preset controls, if the

sensors are not trigged as expected.

13. Adjust R11 preset to control the “Day” and

“Night” mode detection.

14. Open the Jumper J2 and press 5 to return to the

Run mode.

15. Shutdown the power supply and disconnect the

RS232 cable.

Fig.2 - DTMF output generated by the system at the

testing stages. (Test points : TRN1 input terminals)

RS232 Configuration settings for

Programmable Alarm System

Speed (baud) 9600

Data bits 8

Stop bits 1

Parity OFF

Flow control XON/XOFF

Fig.3 - PuTTY configuration setup for Programmable

Home Security Alarm System

* R6 - X1 sensor sensitivity, R8 - X2 sensor sensitivity,

R4 - sensor gain controller (Common mode)

Page 4: Programmable Home Security Alarm System

Parts List

C1, C18, C19 0.1µF (25V)

C2, C3 10pF

C11 0.22µF (100V)

C16, C17 0.33µF (50V)

C4, C5, C6, C7 1µF (50V)

C13, C14 1µF (100V)

C9 10µF (35V)

C10 1000µF (35V)

C12 220µF (35V)

C20 100µF (35V)

C21 470µF (35V)

R1, R2, R3, R1, R19 10K

R5, R7, R9, R10 22K

R12 68K

R13, R14 2.2K

R15 330K

R16, R20 1K

R21, R22, R42 330Ω

R23, R24, R25, R26,

R27,R28, R29, R30

100Ω

R31, R32, R33, R34,

R35, R36, R37, R38

220Ω

R39, R40, R41 47K

R43 240Ω (0.5 W)

TRN1 600Ω : 600Ω isolation

transformer

SG1 F/QMX Buzzer

RL1 SHINMEI RSB-5-S Relay

RL2 FANGKE JZC-23F 12V Relay

(220V 5A)

S1 B3F-10XX - push on switch

S2 M251 SPDT micro switch

IC1 PIC16F877A

IC2 LM339N

IC3 MAX232

IC4 UM3561

IC5 µPC2002 / TDA2002

IC6 7805TV

IC7 7812TV

IC8 LM317

D1 1N4004 Diode

D2 1N4148 Diode

C8 VE09-0151 MOV

T1, T3 2SC945

T2 2SD400

Q2 BS170

Q3 IRF9640

Q1 20.00MHz Crystal

R4, R8 30K (LIN) Potentiometer

R6 20K (LIN) Potentiometer

R11 50K (LIN) Potentiometer

R18 50K (LOG) Gang Potentiometer

L1 4.8 µH Inductor

LDR1 VT90N2 LDR

LD1 5mm Tri-Color LED

JP1 3 Pin Jumper Header

J1 Tyco Electronics 2RJ11-6L-B

J2 1X2MTA header

J3 DCJ0303 DC Jack connector

X3 H3M09RA D-SUB9 connector

X1, X2, X4, X5 Phoenix 350 connector

SPK 8Ω (8W) or 4Ω (10W) Speaker

All the resistors are 1/4W unless otherwise specified

Page 5: Programmable Home Security Alarm System

SENSOR 0

SENSOR 1

ENV. SENSOR

SY

S. G

AIN

R4, R8 - SENSOR GAIN

ENV. SENSOR GAIN

BEEPER

SERIAL OUTPUT

CONTROL BUS

SERIAL BUS

CB6 CB7

TE

LE

PH

ON

E IN

PU

T/O

UT

PU

TS

EN

SO

R IN

PU

TS

LIG

HT

IN

PU

TS

TONE SELECTOR

1 - 2 : FIRE ALARM3 - 2 : AMBUL. ALARMOPEN : POLICE ALARM

CB2

CB1

MASTER ALARM VOLUME

230V / 5A MAX. LOAD

4R SPEAKER

AL

AR

M A

UD

IO O

UT

PU

T

+

CB2

IC5 - HEAT SINK REQ.

CB5

CB4

STATUS LED

DA

C_

BU

S

DC0DC7

CB0

CB

0

MODE SELECT SWITCH

CB

3

CB3ALARM RESET SWITCH

DIAL MODE SWITCH

LA

SE

R P

OW

ER

OU

TP

UT

+

DC

- IN

PU

T (

15

V -

25

V)

IC6 - HEAT SINK REQ. IC7 - HEAT SINK REQ.IC8 - HEAT SINK REQ.

PIC16F877P

+5V

0.1

MF

D (

25

V)

GND

GND

20

.00

MH

z

10pF10pF

GND GND

LM339N

LM339N LM339N

LM339N

10

K

+5V

10

K

10

K

30

K L

IN

GND

22

K

+5V

20

K L

IN

22

K

30

K L

IN

GNDGND

+5V

22K

22

K

+5V

GND

50

K L

IN

GND

+5V

68K

GND

F/QMX

1N4148DO35-10

+5

V

MAX232

1MFD/50V

1MFD/50V

1MFD/50V

1MFD/50V

+5

V

GND

D-SUB9-H3M09RA

GND

2RJ11-6L-B

2RJ11-6L-B

RSB-5-S

TPTRANS

MOV 221

2SC945

+5V

GND

2.2

K

2SD400

2.2

K

GND

JZC-23F

+12V

WIREPAD3,17/1,3

WIREPAD3,17/1,3

UM3561

330K

GND

BS170

+3V

GND

1K

10K

UPC2002

50K LOG POT

GND

10MFD/35V

GND

10

00

MF

D/3

5V

0.22MFD/100V

22

0M

FD

/35

V

4.8uH

GND

IRF9640

+12V

2SC945

GND

10

K

1K

GND

330R

330R

100R 100R 100R 100R 100R 100R 100R 100R

22

0R

22

0R

22

0R

22

0R

22

0R

22

0R

22

0R

22

0R

GND

1M

FD

/10

0V

1MFD/100V

GNDGND

47K

47K

GND

+5V

47

K

GND

1N4004

7805TV

0.33MFD/50V

+5V

7812TV

0.33MFD/50V

+12V

LM317

0.1MFD (25V)

0.1MFD (25V)

+3

V

33

0R

24

0R

100MFD/35V470MFD/50V

GND

+3V

GND

+5V

GND

MCLR/THV1

RA0/AN02

RA1/AN13

RA2/AN24

RA3/AN35

RA4/T0CKI6

RA5/AN47

RE0/RD/AN58

RE1/WR/AN69

RE2/CS/AN710

OSC1/CLKIN13

OSC2/CLKOUT14

RC0/T1OSO15

RC1/T1OSI16

RC2/CCP117

RC3/SCK18

RD0/PSP019

RD1/PSP120

RD2/PSP221

RD3/PSP322

SDI/RC423

SDO/RC524

TX/RC625

RX/RC726

PSP4/RD427

PSP5/RD528

PSP6/RD629

PSP7/RD730

12

11

INT/RB033

RB134

RB235

PGM/RB336

RB437

RB538

PGC/RB639

PGD/RB740

32

31

IC1

VDD

VSS

C1

21Q1

C2C3

312

4

5

2

IC2A

6

7

1

IC2B

8

9

14

IC2C

10

11

13

IC2D

R1

R2

R3

13

2

R4

R5

13

2

R6

R7

13

2

R8

R9

R1

0

13

2

R11

LDR1

R12

SG1

+-

D2

C1+1

C1-3

C2+4

C2-5

T1IN11

T2IN10

R1OUT12

R2OUT9

V+2

V-6

T1OUT14

T2OUT7

R1IN13

R2IN8

IC3

1615GND VCC

IC3

P

C4

C5

C6 C7

X3-1

X3-2

X3-3

X3-4X3-5 X3-6

X3-7X3-8

1

2

3

4

J1-1

5

6

1

2

3

4

J1-2

5

6

K2

K1 RL1

D1

N1

C1

RL

1

D2

N2

C2

RL

1

TRN1

L2

L1

H1

H2

M2

M1

C8

T1

R1

3

T2

R1

4

K2

K1 RL2

O1

S1

P1

RL

2

PAD1

PAD2

SEL16

OUT3

OSC28

OSC17

IC4

VSS2

VDD5

SEL21

R15

Q2

1

2

3

JP1

R1

6 R17

2

1

4

IC5

53

R18

C9

C1

0

C11

C1

2

2 1

L1

Q3

T3R

19

R2

0

LD

1

R21

R22

R23 R24 R25 R26 R27 R28 R29 R30

R3

1

R3

2

R3

3

R3

4

R3

5

R3

6

R3

7

R3

8

C1

3

C14

R39

R40

J2

1

31 2

4

S1

S2

2

3

1

R4

1

J3 1

2

3 D1

VI1

2

VO3

IC6

GNDC16

VI1

2

VO3

IC7

GNDC17

IC8

ADJ

IN OUT

C18

C19

R4

2

R4

3C20

C21

red

gre

en

DC1

Page 6: Programmable Home Security Alarm System

1 2 3

12

12

34

12

31

23

OI

A

N1

N1

N2

N2

N3

N3

IC1

C1

Q1 C2

C3

IC2

R1

R2

R3

R4

R5

R6

R7

R8

X1

X2

R9

R10

R11LDR1

R12

SG1

D2

IC3 C4

C5

C6

C7

X3

J1

RL

1T

RN

1

C8

T1

R13

T2

R14

RL2

PAD1PAD2

IC4R15

Q2

JP1

R16

R17

IC5

R18

C9

C1

0

X4

C11

C12

L1

Q3

T3

R19

R20

LD1

R21

R22

R23

R24

R25

R26

R27

R28

R29

R30

R31

R32

R33

R34

R35

R36

R37

R38

C13

C14

R39

R40

J2

S1

S2

R41

J3

D1

IC6

C16

IC7

C17

IC8

C18

C19

R42

R43

C20

C21

X5

E$1

E$2

E$3

N$21

N$20

N$25

E$4

E$5

E$6

E$7

E$8

E$9

E$10

E$11

E$12

E$13

E$14E

$15

E$16E$17

E$18

E$19

E$20

PIC

16

F8

77

P

0.1

MF

D (

25V

)

20.0

0M

Hz 10pF

10pF

LM

339N

10K

10K

10K

30K LIN

22K

20K LIN

22K

30K LIN

1751248 1751248

22K

22K

50K

LIN

68K

F/QMX

1N4148DO35-10

MA

X232

1M

FD

/50V

1M

FD

/50V

1MFD/50V

1MFD/50V

D-SUB9-H3M09RA

2RJ11-6L-B

RSB-5-S

TP

TR

AN

S

MOV 221

2S

C945

2.2K

2S

D400

2.2K

JZ

C-2

3F

UM

3561

330K

BS170

1K

10K

UP

C2002

50K

LO

G P

OT

10M

FD

/35V

10

00

MF

D/3

5V

1751248

0.2

2M

FD

/100V

220MFD/35V

4.8uH

IRF9640

2S

C945

10K

1K

330R

330R

100R

100R

100R

100R

100R

100R

100R

100R

220R

220R

220R

220R

220R

220R

220R

220R

1M

FD

/100V

1M

FD

/100V

47K47K

47K

1N

4004

7805T

V0.33MFD/50V

7812T

V

0.33MFD/50V

LM

317

0.1

MF

D (

25V

)

0.1

MF

D (

25V

)

330R

240R

100MFD/35V

470MFD/50V

1751248

Page 7: Programmable Home Security Alarm System