10 Aralık 2012 Pazartesi

Intermediate Burglar Alarm Telephone with PIC16F628A


Phone Intermediate Burglar Alarm Operating Instructions
When power is first turned off the alarm system. In this case, an alarm can be activated by entering the password. Wrong key is pressed "3 beep" sound is heard.
Password when prompted, and phone numbers saved to the * and # keys pressed at the same time. The first pressing the "single beep" when the "three beep" sound is heard. 4 to 9 digit password is entered as zero. After each key pressure "beep" sound is heard. After entering the four-digit password, "3 beeps" will be heard. In this case, enter the phone numbers one by one.



A phone number can be up to 11 digits. If the entered number is less than 11 digits after the * and # keys pressed simultaneously written to the figures. After entering a phone number first before the "3 beeps" will be heard. Then the number is the count of up to 1 sec then it will beep. So 1 When entering the phone number "3 beeps" after "1 beep", 2nd When entering the phone nurber "3 beeps" after "2 beep", 3 When entering the phone number "3 beeps" after "3 beeps", 4 When entering the phone number "3 beeps" after "4 beep" is heard, and entered the figures recorded in the EEPROM will return to its normal position.
To activate the alarm code must be entered in the normal position. After entering the four-digit password, alarm LED flashes and a beep sounds. In this case, an alarm will be activated within 30 seconds. The alarm can be canceled by pressing any key within 30 seconds. 30 seconds when the "three beep" sounds and the alarm LED motion sensor that continuously read by burning starts.
The motion sensor PIR + and PIR-in terminal block on the card ends of the relay contacts are connected. The relay ends of the short-circuit when the motion is detected.
For 30 seconds, start beeping when motion is detected the device. In the meantime, the alarm can be silenced by pressing L. password. One long beep you in 30 seconds and phone numbers in order Bazer susturulmazsa starts translated.
DTMF tone when dialing the number you flaşlamasıyla alarm LED can be seen in the numbers. Kırpıştırmadan alarm LED is lit continuously over the cycle number, the download is expected to respond to state. When you answer the phone as the phone beeps for 20 seconds Tanu # DTMF tone will be heard.
Alarm LED lights up continuously by entering the password that is sent to the phone beep alarm susturulbilir. Keeps silent alarm after entering the password required "3bip" and understood.

EEPROM structure:

     00-03 4-digit password
     1 04-14 11-digit phone number
     15-25 11-digit 2 phone number
     26-36 11-digit 3 phone number
     37-47 11-digit 4 phone number

Pronenin version 3 data

This circuit instead of the previous version of the same relay Optocoupler made ​​by placing one more. uploading the source code, circuit diagrams, and open her basic codes attached. The only difference is doing the same job as his work entirely, instead of the keypad buttons and the relay instead of a small circuit with optocoupler is made.

Hardware

     one will have access pırsensör
     telephone line will be independent of
     an outlet for phone commissioning
     dtmf telephone line to send an output signal
     collektör open when the alarm output
     s got to be one warning buzzer sound
     One alarm LED will

Software

4 x 11-digit phone memory will be a pre-defined time has elapsed in the event of an alarm in the event of an alarm, this 4-phone call while playing against the side of the phone cut off çaldıracak for 1 min with a warning beep will sound after the expiration of a minute to call other telefonlarıda 1 times and the phone will end the call function.

Buzzer alarm output is activated 30 seconds after alarm is triggered. During this time the alarm to sound for a period of up to recognize that the owner will leave the scene. After discontinuation of the buzzer alarm warning tone will be completely disabled

When I get home immediately generate an alarm in case of an alarm caused by motion pırdaki
period of 30 seconds to turn off the alarm will not work. Buzzer will sound. During these 30 seconds, the buzzer will alarm. alarm to sound when the system is not closed during this time.







picbasic version 3. bas file content


DEFINE OSC 20

BUZZER  VAR PORTA.0
ALARM_LED VAR PORTA.1
ALARM_OUT VAR PORTA.2
TEL_ON  VAR PORTA.3
TEL_AUDIO VAR PORTA.4
PIRINPUT VAR PORTA.5

ROW2  VAR PORTB.0
ROW4  VAR PORTB.1
ROW3  VAR PORTB.2
COL1  VAR PORTB.3
COL2  VAR PORTB.4
COL3  VAR PORTB.5
ROW1  VAR PORTB.6

TUS_DONUS VAR BYTE
HAFIZA_NO VAR BYTE
DEGER  VAR BYTE
SANIYE_SAY VAR BYTE
I   VAR BYTE

; CMCON=7

 ADCON1=7 ; 819 İÇİN
 OPTION_REG=0
  
 OUTPUT BUZZER
 OUTPUT ALARM_LED
 OUTPUT ALARM_OUT
 OUTPUT TEL_ON
 OUTPUT TEL_AUDIO
 INPUT PIRINPUT

 OUTPUT ROW1
 OUTPUT ROW2
 OUTPUT ROW3
 OUTPUT ROW4
 INPUT  COL1
 INPUT  COL2
 INPUT  COL3

 PORTA=0
 PORTB=0
 CALL ZIRLA
 CALL ZIRLA
 CALL ZIRLA
 HAFIZA_NO=0

MAIN_LOOP:
; ALARM KAPALI DURUMDA
 LOW ALARM_LED
 
 CALL TUSLARI_TARA
 IF TUS_DONUS=12 THEN KAYIT_MENUSU
 IF TUS_DONUS<10 THEN SIFRE_GIR_ALARM_AC ; ŞİFRE GİRİLİP ALARM ÇALIŞTIRILACAK
 
 GOTO MAIN_LOOP

; ---------------------------------------------------
; ŞİFRE GİRİLİP ALARM ÇALIŞTIRILACAK
SIFRE_GIR_ALARM_AC:
 READ 0,HAFIZA_NO ; ŞİFRENİN 1. KARAKTERİ
 IF TUS_DONUS<>HAFIZA_NO THEN ALARM_ACMADAN_CIK
ALARM_AC_1:
 CALL TUSLARI_TARA
 IF TUS_DONUS>9 THEN ALARM_AC_1
 READ 1,HAFIZA_NO ; ŞİFRENİN 2. KARAKTERİ
 IF TUS_DONUS<>HAFIZA_NO THEN ALARM_ACMADAN_CIK
ALARM_AC_2:
 CALL TUSLARI_TARA
 IF TUS_DONUS>9 THEN ALARM_AC_2
 READ 2,HAFIZA_NO ; ŞİFRENİN 3. KARAKTERİ
 IF TUS_DONUS<>HAFIZA_NO THEN ALARM_ACMADAN_CIK
ALARM_AC_3:
 CALL TUSLARI_TARA
 IF TUS_DONUS>9 THEN ALARM_AC_3
 READ 3,HAFIZA_NO ; ŞİFRENİN 4. KARAKTERİ
 IF TUS_DONUS<>HAFIZA_NO THEN ALARM_ACMADAN_CIK
; ALARM DEVREYE ALINIYOR
 GOTO ALARM_DEVREYE_AL:

ALARM_ACMADAN_CIK:
 CALL ZIRLA
 CALL ZIRLA
 CALL ZIRLA
 GOTO MAIN_LOOP
; -----------------------------------
; ALARM 30 SANİYE BEKLENECEK VE DEVREYE ALINACAK
ALARM_DEVREYE_AL:
 FOR HAFIZA_NO=0 TO 50
  TOGGLE ALARM_LED
  CALL ZIRLA
  PAUSE 300
  CALL TUSLARI_TARA
  IF TUS_DONUS<10 THEN     ; BİR TUSA BASILMIS. ALARM İPTAL
   LOW ALARM_LED
   HIGH BUZZER
   GOTO MAIN_LOOP
  ENDIF
 NEXT
 CALL ZIRLA
 CALL ZIRLA
 CALL ZIRLA
 CALL ZIRLA
 CALL ZIRLA ; SON UYARI YAPILDI. ALARM ARTIK DEVREDE
     
 HIGH ALARM_LED
HAREKET_BEKLE: ; ALARM AÇIK VE HAREKET GELENE KADAR BURADA BEKLE
 IF PIRINPUT=0 THEN HAREKET_BEKLE
 PAUSE 200
 IF PIRINPUT=1 THEN HAREKET_VAR
 GOTO HAREKET_BEKLE
; ---------------------------------------------------
HAREKET_VAR:
; HAREKET VAR İSE 30 SANİYE BEKLENECEK
; ŞİFRE GİRİLMEZSE ALARM ÇALACAK VE
; TELEFONLAR ARANACAK

 SANIYE_SAY=0
 HAFIZA_NO=0
 
BEKLE_30_SN:
 SANIYE_SAY=SANIYE_SAY+1
 IF SANIYE_SAY>62 THEN GOTO SURE_DOLDU_TEL_ARA
 CALL TUSLARI_TARA
 IF TUS_DONUS<10 THEN ; BİR TUŞA BASILMIŞ
  READ HAFIZA_NO,DEGER
  IF TUS_DONUS=DEGER THEN ; TUS KARAKTERI DOĞRUDUR
   HAFIZA_NO=HAFIZA_NO+1 
  ELSE
   HAFIZA_NO=0
  ENDIF
 ENDIF
 IF HAFIZA_NO>3 THEN MAIN_LOOP ; ŞİFRE DOĞRUDUR. ANA MENUYE GİT
 PAUSE 200
 CALL ZIRLA
 TOGGLE ALARM_LED
 GOTO BEKLE_30_SN 
; ---------------------------------------------
SURE_DOLDU_TEL_ARA:
; 1. TELEFON ARANIYOR
 HIGH ALARM_OUT ; ALARM ÇIKIŞI VER
 
 LOW BUZZER ; BUZZER SÜREKLİ ÇAL
 HIGH TEL_ON  ; TELEFON HATTI AÇILDI.
 PAUSE 500 
 HAFIZA_NO=4
 SANIYE_SAY=0 ; ŞİFRE İÇİN KULLANILACAK

TEL_1_CEVIR: 
 READ HAFIZA_NO,DEGER
 IF DEGER>9 THEN TEL_1_BITTI
 DTMFOUT TEL_AUDIO, [DEGER]
 HIGH ALARM_LED
 HAFIZA_NO=HAFIZA_NO+1
 IF HAFIZA_NO>14 THEN TEL_1_BITTI
 GOTO TEL_1_CEVIR
TEL_1_BITTI:
 FOR I=0 TO 30  ; 30 SANIYE BOYUNCA
  CALL TUSLARI_TARA
  IF TUS_DONUS<10 THEN ; BİR TUSA BASMIS
   READ SANIYE_SAY,DEGER
   IF DEGER=TUS_DONUS THEN 
    SANIYE_SAY=SANIYE_SAY+1
   ELSE
    SANIYE_SAY=0
   ENDIF
   IF SANIYE_SAY=4 THEN GOTO SIFRE_DOGRU_ALARM_KAPAT
  ENDIF
  HIGH ALARM_LED
  PAUSE 1000 ; TEL NO ÇEVRİLDİ. 1 SN BEKLE
  SOUND TEL_AUDIO,[100,10,50,10,100,10] ; BU SESi TELE VER
 NEXT
 LOW TEL_ON ; TEL. KAPAT
 PAUSE 1000

 HIGH TEL_ON  ; TELEFON HATTI AÇILDI.
 PAUSE 500 
 HAFIZA_NO=15 ; 15-25 arası

TEL_2_CEVIR:
 READ HAFIZA_NO,DEGER
 IF DEGER>9 THEN TEL_2_BITTI
 DTMFOUT TEL_AUDIO, [DEGER]
 HIGH ALARM_LED 
 HAFIZA_NO=HAFIZA_NO+1
 IF HAFIZA_NO>25 THEN TEL_2_BITTI
 GOTO TEL_2_CEVIR
TEL_2_BITTI:
 FOR I=0 TO 30  ; 30 SANIYE BOYUNCA
  CALL TUSLARI_TARA
  IF TUS_DONUS<10 THEN ; BİR TUSA BASMIS
   READ SANIYE_SAY,DEGER
   IF DEGER=TUS_DONUS THEN 
    SANIYE_SAY=SANIYE_SAY+1
   ELSE
    SANIYE_SAY=0
   ENDIF
   IF SANIYE_SAY=4 THEN GOTO SIFRE_DOGRU_ALARM_KAPAT
  ENDIF
  HIGH ALARM_LED
  PAUSE 1000 ; TEL NO ÇEVRİLDİ. 1 SN BEKLE
  SOUND TEL_AUDIO,[100,10,50,10,100,10] ; BU SESi TELE VER
 NEXT
 LOW TEL_ON ; TEL. KAPAT
 PAUSE 1000

 HIGH TEL_ON  ; TELEFON HATTI AÇILDI.
 PAUSE 500 
 HAFIZA_NO=26 ; 26-36 arası

TEL_3_CEVIR:
 READ HAFIZA_NO,DEGER
 IF DEGER>9 THEN TEL_3_BITTI
 DTMFOUT TEL_AUDIO, [DEGER]
 HIGH ALARM_LED
 HAFIZA_NO=HAFIZA_NO+1
 IF HAFIZA_NO>36 THEN TEL_3_BITTI
 GOTO TEL_3_CEVIR
TEL_3_BITTI:
 FOR I=0 TO 30  ; 30 SANIYE BOYUNCA
  CALL TUSLARI_TARA
  IF TUS_DONUS<10 THEN ; BİR TUSA BASMIS
   READ SANIYE_SAY,DEGER
   IF DEGER=TUS_DONUS THEN 
    SANIYE_SAY=SANIYE_SAY+1
   ELSE
    SANIYE_SAY=0
   ENDIF
   IF SANIYE_SAY=4 THEN GOTO SIFRE_DOGRU_ALARM_KAPAT
  ENDIF
  HIGH ALARM_LED
  PAUSE 1000 ; TEL NO ÇEVRİLDİ. 1 SN BEKLE
  SOUND TEL_AUDIO,[100,10,50,10,100,10] ; BU SESi TELE VER
 NEXT
 LOW TEL_ON ; TEL. KAPAT
 PAUSE 1000

 HIGH TEL_ON  ; TELEFON HATTI AÇILDI.
 PAUSE 500 
 HAFIZA_NO=37 ; 37-47 arası

TEL_4_CEVIR:
 READ HAFIZA_NO,DEGER
 IF DEGER>9 THEN TEL_4_BITTI
 DTMFOUT TEL_AUDIO, [DEGER]
 HIGH ALARM_LED
 HAFIZA_NO=HAFIZA_NO+1
 IF HAFIZA_NO>47 THEN TEL_4_BITTI
 GOTO TEL_4_CEVIR
TEL_4_BITTI:
 FOR I=0 TO 30  ; 30 SANIYE BOYUNCA
  CALL TUSLARI_TARA
  IF TUS_DONUS<10 THEN ; BİR TUSA BASMIS
   READ SANIYE_SAY,DEGER
   IF DEGER=TUS_DONUS THEN 
    SANIYE_SAY=SANIYE_SAY+1
   ELSE
    SANIYE_SAY=0
   ENDIF
   IF SANIYE_SAY=4 THEN GOTO SIFRE_DOGRU_ALARM_KAPAT
  ENDIF
  HIGH ALARM_LED
  PAUSE 1000 ; TEL NO ÇEVRİLDİ. 1 SN BEKLE
  SOUND TEL_AUDIO,[100,10,50,10,100,10] ; BU SESi TELE VER
 NEXT
 LOW TEL_ON ; TEL. KAPAT
 PAUSE 1000

; 4 TELEFON DA ARANDI
; ŞİFRE GİRİLENE KADAR TEKRAR TEKRAR ARA.

 GOTO SURE_DOLDU_TEL_ARA 

SIFRE_DOGRU_ALARM_KAPAT:
 LOW ALARM_OUT ; ALARM ÇIKIŞI KPALI
 LOW TEL_ON
 LOW TEL_AUDIO
 LOW ALARM_LED
 CALL ZIRLA
 CALL ZIRLA
 CALL ZIRLA
 GOTO MAIN_LOOP
; ---------------------------------------------------
KAYIT_MENUSU:
 CALL ZIRLA
 CALL ZIRLA
 CALL ZIRLA

; İLK OLARAK 4 HANELİ ŞİFRE GİRİLECEK
; ŞİFRE EEPROMUN İLK 4 ADRESİNE YAZILACAK
 HAFIZA_NO=0
KAYIT_TUS_BEKLE:
 CALL TUSLARI_TARA
 IF TUS_DONUS>9 THEN GOTO KAYIT_TUS_BEKLE
 WRITE HAFIZA_NO,TUS_DONUS ; 1. KARAKTER KAYDEDİLDİ
 HAFIZA_NO=HAFIZA_NO+1
 IF HAFIZA_NO<4 THEN KAYIT_TUS_BEKLE
 
; ŞİFRE KAYIT İŞLEMİ BİTTİ
 CALL ZIRLA
 CALL ZIRLA
 CALL ZIRLA
 
; TELEFON NUMARASI - 1 KAYDEDİLECEK
; TELEFON NO UZUNLUĞU MAX. 11 KARAKTER OLACAK
; EEPROM 4-14 ARASI
KAYIT_TEL_BEKLE_1:
 CALL TUSLARI_TARA
 IF TUS_DONUS=12 THEN KAYIT_TEL_BEKLE_1_BITTI
 IF TUS_DONUS>9 THEN GOTO KAYIT_TEL_BEKLE_1
 WRITE HAFIZA_NO,TUS_DONUS
 HAFIZA_NO=HAFIZA_NO+1
 IF HAFIZA_NO<15 THEN KAYIT_TEL_BEKLE_1
KAYIT_TEL_BEKLE_1_BITTI: ; KAYIT 11 KARAKTERDEN KISA KESİLDİ İSE
 IF HAFIZA_NO<15 THEN  ; 11 KARAKTERE KADAR ESKİ KAYDI SİL
  WRITE HAFIZA_NO,255
  HAFIZA_NO=HAFIZA_NO+1
  GOTO KAYIT_TEL_BEKLE_1_BITTI
 ENDIF
 CALL ZIRLA
 CALL ZIRLA
 CALL ZIRLA
 PAUSE 1000
 CALL ZIRLA

; TELEFON NUMARASI - 2 KAYDEDİLECEK
; TELEFON NO UZUNLUĞU MAX. 11 KARAKTER OLACAK
; EEPROM 15-25 ARASI
KAYIT_TEL_BEKLE_2: 
 CALL TUSLARI_TARA
 IF TUS_DONUS=12 THEN KAYIT_TEL_BEKLE_2_BITTI
 IF TUS_DONUS>9 THEN GOTO KAYIT_TEL_BEKLE_2
 WRITE HAFIZA_NO,TUS_DONUS
 HAFIZA_NO=HAFIZA_NO+1
 IF HAFIZA_NO<26 THEN KAYIT_TEL_BEKLE_2
KAYIT_TEL_BEKLE_2_BITTI: ; KAYIT 11 KARAKTERDEN KISA KESİLDİ İSE
 IF HAFIZA_NO<26 THEN  ; 11 KARAKTERE KADAR ESKİ KAYDI SİL
  WRITE HAFIZA_NO,255
  HAFIZA_NO=HAFIZA_NO+1
  GOTO KAYIT_TEL_BEKLE_2_BITTI
 ENDIF
 CALL ZIRLA
 CALL ZIRLA
 CALL ZIRLA
 PAUSE 1000
 CALL ZIRLA
 PAUSE 300
 CALL ZIRLA

; TELEFON NUMARASI - 3 KAYDEDİLECEK
; TELEFON NO UZUNLUĞU MAX. 11 KARAKTER OLACAK
; EEPROM 26-36 ARASI
KAYIT_TEL_BEKLE_3: 
 CALL TUSLARI_TARA
 IF TUS_DONUS=12 THEN KAYIT_TEL_BEKLE_3_BITTI
 IF TUS_DONUS>9 THEN GOTO KAYIT_TEL_BEKLE_3
 WRITE HAFIZA_NO,TUS_DONUS
 HAFIZA_NO=HAFIZA_NO+1
 IF HAFIZA_NO<37 THEN KAYIT_TEL_BEKLE_3
KAYIT_TEL_BEKLE_3_BITTI: ; KAYIT 11 KARAKTERDEN KISA KESİLDİ İSE
 IF HAFIZA_NO<37 THEN  ; 11 KARAKTERE KADAR ESKİ KAYDI SİL
  WRITE HAFIZA_NO,255
  HAFIZA_NO=HAFIZA_NO+1
  GOTO KAYIT_TEL_BEKLE_3_BITTI
 ENDIF
 CALL ZIRLA
 CALL ZIRLA
 CALL ZIRLA
 PAUSE 1000
 CALL ZIRLA
 PAUSE 300
 CALL ZIRLA
 PAUSE 300
 CALL ZIRLA
 
; TELEFON NUMARASI - 4 KAYDEDİLECEK
; TELEFON NO UZUNLUĞU MAX. 11 KARAKTER OLACAK
; EEPROM 37-47 ARASI
KAYIT_TEL_BEKLE_4: 
 CALL TUSLARI_TARA
 IF TUS_DONUS=12 THEN KAYIT_TEL_BEKLE_4_BITTI
 IF TUS_DONUS>9 THEN GOTO KAYIT_TEL_BEKLE_4
 WRITE HAFIZA_NO,TUS_DONUS
 HAFIZA_NO=HAFIZA_NO+1
 IF HAFIZA_NO<48 THEN KAYIT_TEL_BEKLE_4
KAYIT_TEL_BEKLE_4_BITTI: ; KAYIT 11 KARAKTERDEN KISA KESİLDİ İSE
 IF HAFIZA_NO<48 THEN  ; 11 KARAKTERE KADAR ESKİ KAYDI SİL
  WRITE HAFIZA_NO,255
  HAFIZA_NO=HAFIZA_NO+1
  GOTO KAYIT_TEL_BEKLE_4_BITTI
 ENDIF
 CALL ZIRLA
 CALL ZIRLA
 CALL ZIRLA
 PAUSE 1000
 CALL ZIRLA
 PAUSE 300
 CALL ZIRLA
 PAUSE 300
 CALL ZIRLA
 PAUSE 300
 CALL ZIRLA

; KAYIT İŞLEMLERİ TAMAMLANDI
 GOTO MAIN_LOOP
; ---------------------------------------------------
TUSLARI_TARA:
 PAUSE 150
 TUS_DONUS=255
 LOW ROW1
 HIGH ROW2
 HIGH ROW3
 HIGH ROW4
 
 IF COL1=0 THEN TUS_DONUS=1
 IF COL2=0 THEN TUS_DONUS=2
 IF COL3=0 THEN TUS_DONUS=3

 HIGH ROW1
 LOW ROW2
 HIGH ROW3
 HIGH ROW4
 
 IF COL1=0 THEN TUS_DONUS=4
 IF COL2=0 THEN TUS_DONUS=5
 IF COL3=0 THEN TUS_DONUS=6

 HIGH ROW1
 HIGH ROW2
 LOW ROW3
 HIGH ROW4
 
 IF COL1=0 THEN TUS_DONUS=7
 IF COL2=0 THEN TUS_DONUS=8
 IF COL3=0 THEN TUS_DONUS=9

 HIGH ROW1
 HIGH ROW2
 HIGH ROW3
 LOW ROW4
 
 IF COL1=0 THEN TUS_DONUS=10
 IF COL2=0 THEN TUS_DONUS=0
 IF COL3=0 THEN TUS_DONUS=11

; YILDIZ iLE KAREYE AYNI ANDA BASILIRSA
 IF COL1=0 AND COL3=0 THEN TUS_DONUS=12  ; * İLE # AYNI ANDA BASILMIS
 IF TUS_DONUS<13 THEN GOTO TUSA_BASILMIS
 RETURN

TUSA_BASILMIS:
 LOW ROW1
 LOW ROW2
 LOW ROW3
 LOW ROW4
 CALL ZIRLA
TUS_BIRAK:
 HIGH ALARM_LED
 IF (COL1=0 OR COL2=0 OR COL3=0) THEN GOTO TUS_BIRAK
 LOW ALARM_LED
 RETURN

ZIRLA:
 LOW BUZZER
 PAUSE 30
 HIGH BUZZER
 PAUSE 100
 RETURN

END

 

Hiç yorum yok:

Yorum Gönder