Position: Index > Unclassified >

home security project

2017-08-15 21:38  
Declaration:We aim to transmit more information by carrying articles . We will delete it soon, if we are involved in the problems of article content ,copyright or other problems.

This article describes a circuit schematic home security items. For your better understanding in the diagram, we recommend that you look at the text. The project's security system home security applications and provides a simple demonstration of the basic serial interface. By adding only a few doors and window switch, a transistor , siren, (see diagram) and a few lines of basic procedures (see list of procedures) interface can be a versatile security system. Please Note, however, this is a "skeleton" program. This is left to the reader to imagine their hobby. Normally closed switch can be attached to the door in the "Port Interface schematically shown (All unused ports be grounded.) Turn off the switch in this configuration of the" in "port hold" low. "When any switch port to the" high . "the plan recognizes that this is an alarm condition associated with the port area. If the program" detects "high" in the "Port number 1, sounded the alarm will be delayed for a user-defined length of time, which is to allow owners time to enter the protected area and reset the alarm siren is activated before, if a "high" conditions found in any other port, and 2-7, the alarm will immediately sounded the alarm time, the "out" port number for a high. connected to "Out" port 1 is an NPN transistor switch 12 volt supply security alarm or bell (Figure 3). still until the system is reset or clock reaches its time period in order to transfer state BSI, it is "in the" port data Strobe (pin 23) must be switched of IC1. such switching data strobe is controlled by the program in the application data strobe connected to the "out" by an 8-port jumper in order to trigger a transfer port conditions procedures the "" port8 "on" and "off." this led IC1 transmits its status is "in" port. understanding of the text, you can plug a high efficiency.

10 ` BASIC SERIAL INTERFACE
20 `
30 ` SECURITY SYSTEM DEMONSTRATION PROGRAM
40 `
50 ` setup
60 KEY OFF:CLS:CLOSE`………………………………….. turn key off, clear screen, close
70 OPEN “COM1:1200,N,8,2″ AS #1` …………………..all files, open the serial port
80 PRINT#1,CHR$(NUL);`…………………………………..as com port #1, and transmit “0″.
90 GOTO 310
100 `
110 FOR X=1 TO 8`………………………………………….. Subroutine to convert decimal number
120 B=C MOD 2:C=INT(C/2):R(X)=B`…………………. received from the UART to binary
130 NEXT X`……………………………………………………. and set array variables to represent
140 RETURN`…………………………………………………….UART port conditions,R(1) to R(8)
150 REM
160 IF T(HP)=1 THEN 210`…………………………………Subroutine to turn one UART port on
170 FOR X=1 TO 8`…………………………………………..without changing the condition of
180 IF HP=X THEN OT=OT 2^(X-1):T(X)=1`……………any other UART port.—
190 NEXT X
200 PRINT #1,CHR$(OT);
210 RETURN
220 `
230 IF T(HP)=0 THEN 280`………………………………….Subroutine to turn one UART port off
240 FOR X=1 TO 8`……………………………………………without changing the condition of
250 IF HP=X THEN OT=OT-2^(X-1):T(X)=0`…………….any other port.—
260 NEXT X
270 PRINT #1,CHR$(OT);
280 RETURN
290 `********************* SECURITY SYSTEM MAIN PROGRAM *******
300 `
310 PRINT” Security System Program
320 `
330 PRINT:PRINT”Note:`OUT` port 8 of the UART (pin 5)
must be connected to Data Strobe (pin 23)before running this
program.”:PRINT
340 INPUT”ENTER ALARM DELAY FOR ZONE #1 ENTRY “;DELAY
350 INPUT”ENTER ALARM TIMEOUT “;TIMEOUT
360 `
370 CLS:PRINT#1,CHR$(128);`……………………………clear screen and turn UART port 8 on
380 PRINT “Ctrl E to reset”
390 HP=8 :GOSUB 220:HP=8:GOSUB 150`…………….Ask UART for `in` port status.
400 IF LOC(1)=0 THEN 470`…………………………………If transmission not received,skip.
410 IN$=INPUT$(1,#1):C=ASC(IN$):GOSUB 100`… read transmission and convert to
420 FOR X=1 TO 8`………………………………………………binary,assign each bit to array R(X)
430 LOCATE X 9,10
440 IF R(X)=1 THEN PRINT X;” ALARM !!!!!”` Print UART port status conditions
450 IF R(X)=0 THEN PRINT X;” ZONE SECURE”` as either `alarm` or `secure`
460 NEXT X
470 IF R(1)=1 THEN TIME=TIME `………………………..If zone 1 is high start delay time.
480 IF TIME=DELAY THEN ALARM=1`…………………..if delay time is up set alarm.
490 FOR X=2 TO 8
500 IF R(X)=1 THEN ALARM=1`…………………………….if any zone,2-8,is high,set alarm.
510 NEXT X
520 IF ALARM=1 THEN HP=1:GOSUB 150`…………… if alarm set,turn port 1 on.
530 IF ALARM=1 THEN RESETT=RESETT 1`………… if alarm is set start timeout.
540 IF RESETT=TIMEOUT THEN GOTO 580`………… If timeout is up then shutdown.
550 A$=INKEY$:IF A$=”" THEN 570`…………………… Check to see if Ctrl E was entered,
560 IF ASC(A$)=5 THEN 50`……………………………….. if it was then reset program.
570 GOTO 390
580 PRINT#1,CHR$(NUL);`…………………………………Turn alarm off
590 PRINT:PRINT”SYSTEM SHUTDOWN AT “TIME$,DATE$ ` print shutdown
600 END

?

bsisecur home security project