Escolar Documentos
Profissional Documentos
Cultura Documentos
Diseo
OBJETIVOS:
Construir, disear y entender el funcionamiento de un sistema de
alarma.
Utilizacin y aplicacin de conceptos fundamentales, bsicos y
avanzados del diseo de un sistema electrnico.
Entendimiento
los
sistemas
de
unidades
smbolos
de
leyes
DESCRIPCIN DE LA ALARMA:
La siguiente alarma presenta hasta 8 zonas para activar en las cuales
se puede usar sensores de contacto, infrarrojos y de movimiento de
acuerdo al criterio de cada casa o lugar donde se vaya a instalar la
alarma. Un breve ejemplo seria activar 4 zona para en las cuales :
o 2 zonas de sensor infrarrojo
o 2 zonas de sensores magnticos
El sistema de alarma muestra el control de esta mediante un PIC
programado, el PIC usado es el 16F877A.
Cuenta con clave de activacin/desactivacin mediante un teclado
matricial.
El estado de la alarma es displayado mediante un LCD 2x16,
indicadores de Led que indican el estado de las 8 zona de activacin o
las zonas q desea activar.
La alimentacin puede realizarse por medio de una fuente monofsica
(220v) o a travs de una fuente en DC (12v).
Salida mediante Rel 12V.
DIAGRAMA ESQUEMTICO:
UBICACIN DE COMPONENTES:
LISTA DE COMPONENTES:
Resistencias:
11 de 10 KOhm
5 de 330 Ohm
1 de 4.7K
STATUS,RP0
org
goto
org
;goto
;org
0
Inicio
5
Interrupcion
5
macro
STATUS,RP1
STATUS,RP0
Tecl_ConvierteOrdenEnHex
addwf PCL,F
DT
0Ch,0Bh,0h,0Ah
DT
0Dh,9h,8h,07h
DT
0Eh,6h,5h,04h
DT
0Fh,3h,02h,01h
;Configuracion Puertos
Inicio
BANK1
list
p=16f877a
include <p16f877.inc>
__config
3F72h
DIGITO1
DIGITO2
DIGITO3
DIGITO4
EQU
EQU
EQU
EQU
cblock 0x20
Tecl_TeclaOrden
PDel0
PDel1
TEMP
Wtemp
STATUStemp
Contador_Digito
Primer_digito
Segundo_digito
Tercer_digito
Cuarto_digito
Digito
MINUTO
SEGUNDO
endc
;MACROS
BANK0 macro
bcf
STATUS,RP1
2
5
8
0
movlw
movwf
movlw
movwf
clrf
clrf
clrf
call
bcf
b'00000110'
ADCON1
b'11111111'
TRISA
TRISB
TRISC
TRISD
Teclado_Inicializa
INTCON,GIE
BANK0
clrf
clrf
clrf
clrf
clrf
clrf
clrf
ADCON0
Tecl_TeclaOrden
PDel0
PDel1
TEMP
Wtemp
STATUStemp
clrf
Contador_Digito
call
Teclado_LeeHex
btfss
STATUS,C
goto
ESPERA_SEGUNDO_DIGITO
movf Tecl_TeclaOrden,W
call
Tecl_ConvierteOrdenEnHex
movwf Digito
incf
Contador_Digito
call
Teclado_EsperaDejePulsar
;*********************************
movf Contador_Digito,W
xorlw .2
btfss
STATUS,Z
goto
ESPERA_SEGUNDO_DIGITO
movf Digito,W
movwf Segundo_digito
movlw 0xC1
call
LCD_DIR
movlw '*'
call
LCD_DATO
ESPERA_TERCER_DIGITO
;*******************************
bcf
STATUS,C
call
Teclado_LeeHex
btfss
STATUS,C
goto
ESPERA_TERCER_DIGITO
movf Tecl_TeclaOrden,W
call
Tecl_ConvierteOrdenEnHex
movwf Digito
incf
Contador_Digito
call
Teclado_EsperaDejePulsar
;*********************************
movf Contador_Digito,W
xorlw .3
btfss
STATUS,Z
goto
ESPERA_TERCER_DIGITO
movf Digito,W
movwf Tercer_digito
movlw 0xC2
call
LCD_DIR
movlw '*'
call
LCD_DATO
ESPERA_PRIMER_DIGITO
;*******************************
bcf
STATUS,C
call
Teclado_LeeHex
btfss
STATUS,C
goto
ESPERA_PRIMER_DIGITO
movf Tecl_TeclaOrden,W
call
Tecl_ConvierteOrdenEnHex
movwf Digito
incf
Contador_Digito
call
Teclado_EsperaDejePulsar
;*********************************
movf Contador_Digito,W
xorlw .1
btfss
STATUS,Z
goto
ESPERA_PRIMER_DIGITO
movf Digito,W
movwf Primer_digito
movlw 0xC0
call
LCD_DIR
movlw '*'
call
LCD_DATO
ESPERA_CUARTO_DIGITO
;*******************************
bcf
STATUS,C
call
Teclado_LeeHex
btfss
STATUS,C
goto
ESPERA_CUARTO_DIGITO
movf Tecl_TeclaOrden,W
call
Tecl_ConvierteOrdenEnHex
movwf Digito
incf
Contador_Digito
call
Teclado_EsperaDejePulsar
;*********************************
movf Contador_Digito,W
xorlw .4
btfss
STATUS,Z
goto
ESPERA_CUARTO_DIGITO
movf Digito,W
movwf Cuarto_digito
movlw 0xC3
call
LCD_DIR
movlw '*'
call
LCD_DATO
ESPERA_SEGUNDO_DIGITO
;*******************************
bcf
STATUS,C
;Comprobar Contrasea
bcf
INTCON,GIE
movf Primer_digito,W
xorlw
btfss
goto
movf
xorlw
btfss
goto
movf
xorlw
btfss
goto
movf
xorlw
btfss
goto
DIGITO1
STATUS,Z
CLAVEINCORRECTA
Segundo_digito,W
DIGITO2
STATUS,Z
CLAVEINCORRECTA
Tercer_digito,W
DIGITO3
STATUS,Z
CLAVEINCORRECTA
Cuarto_digito,W
DIGITO4
STATUS,Z
CLAVEINCORRECTA
movlw
call
movlw
call
call
call
;Clave
bcf
bcf
bcf
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
call
call
Aceptada
PORTB,0
PORTB,1
PORTB,2
INICIO_LCD
'A'
LCD_DATO
'C'
LCD_DATO
'E'
LCD_DATO
'P'
LCD_DATO
'T'
LCD_DATO
'A'
LCD_DATO
'D'
LCD_DATO
'O'
LCD_DATO
Delay
Delay
btfss
goto
bsf
bsf
goto
PORTA,1
$+4
PORTC,5
PORTC,1
ZONA2
btfss
goto
bsf
bsf
goto
PORTA,2
$+4
PORTC,6
PORTC,1
ZONA3
btfss
goto
bsf
bsf
goto
goto
PORTA,3
$+4
PORTC,7
PORTC,1
ZONA4
Sensores
ZONA1
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
call
goto
INICIO_LCD
''
LCD_DATO
''
LCD_DATO
''
LCD_DATO
''
LCD_DATO
'Z'
LCD_DATO
'O'
LCD_DATO
'N'
LCD_DATO
'A'
LCD_DATO
''
LCD_DATO
'1'
LCD_DATO
Delay3
ALARMAACTIVADA
ZONA2
call
movlw
call
movlw
call
movlw
call
movlw
INICIO_LCD
''
LCD_DATO
''
LCD_DATO
''
LCD_DATO
''
ALARMAACTIVADA
clrf
PORTC
call
INICIO_LCD
movlw 'A'
call
LCD_DATO
movlw 'L'
call
LCD_DATO
movlw 'A'
call
LCD_DATO
movlw 'R'
call
LCD_DATO
movlw 'M'
call
LCD_DATO
movlw 'A'
call
LCD_DATO
movlw ' '
call
LCD_DATO
movlw 'A'
call
LCD_DATO
movlw 'C'
call
LCD_DATO
movlw 'T'
call
LCD_DATO
movlw 'I'
call
LCD_DATO
movlw 'V'
call
LCD_DATO
movlw 'A'
call
LCD_DATO
'D'
LCD_DATO
'A'
LCD_DATO
Delay
Delay
Sensores
BANK0
btfss
PORTA,0
goto
$+4
bsf
PORTC,4
bsf
PORTC,1
goto
ZONA1
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
call
goto
LCD_DATO
'Z'
LCD_DATO
'O'
LCD_DATO
'N'
LCD_DATO
'A'
LCD_DATO
''
LCD_DATO
'2'
LCD_DATO
Delay3
ALARMAACTIVADA
ZONA3
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
call
goto
INICIO_LCD
''
LCD_DATO
''
LCD_DATO
''
LCD_DATO
''
LCD_DATO
'Z'
LCD_DATO
'O'
LCD_DATO
'N'
LCD_DATO
'A'
LCD_DATO
''
LCD_DATO
'3'
LCD_DATO
Delay3
ALARMAACTIVADA
ZONA4
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
call
movlw
INICIO_LCD
''
LCD_DATO
''
LCD_DATO
''
LCD_DATO
''
LCD_DATO
'Z'
LCD_DATO
'O'
LCD_DATO
'N'
LCD_DATO
'A'
call
movlw
call
movlw
call
call
goto
LCD_DATO
''
LCD_DATO
'4'
LCD_DATO
Delay3
ALARMAACTIVADA
;Clave Incorrecta
CLAVEINCORRECTA
call
INICIO_LCD
movlw 'I'
call
LCD_DATO
movlw 'N'
call
LCD_DATO
movlw 'C'
call
LCD_DATO
movlw 'O'
call
LCD_DATO
movlw 'R'
call
LCD_DATO
movlw 'R'
call
LCD_DATO
movlw 'E'
call
LCD_DATO
movlw 'C'
call
LCD_DATO
movlw 'T'
call
LCD_DATO
movlw 'O'
call
LCD_DATO
call
Delay
call
Delay
clrf
Primer_digito
clrf
Segundo_digito
clrf
Tercer_digito
clrf
Cuarto_digito
clrf
Contador_Digito
goto
Msj_IngreseClave
;.........................
Delay3
call
SEGUNDOS
return
;..........................
SEGUNDOS
movlw .60
movwf SEGUNDO
call Delay
decfsz SEGUNDO
goto
$-2
return
MINUTOS
movlw .3
movwf MINUTO
return
;............................................................................................................
....................
Delay
;--------------------------------------------------------------------------------------------------------PDelay movlw
.239
; 1 set number of repetitions (B)
movwf
PDel0
;1|
PLoop1 movlw
.232
; 1 set number of repetitions (A)
movwf
PLoop2
PDelL1
PDelL2
PDelL3
PDel1
;1|
clrwdt
; 1 clear watchdog
goto PDelL2
; 2 cycles delay
goto PDelL3
; 2 cycles delay
clrwdt
; 1 cycle delay
decfsz PDel1, 1 ; 1 + (1) is the time over? (A)
goto
PLoop2 ; 2 no, loop
decfsz PDel0, 1 ; 1 + (1) is the time over? (B)
goto
PLoop1 ; 2 no, loop
PDelL4 goto PDelL5
; 2 cycles delay
PDelL5 goto PDelL6
; 2 cycles delay
PDelL6 goto PDelL7
; 2 cycles delay
PDelL7 clrwdt
; 1 cycle delay
return
; 2+2 Done
;----------------------------------------------------------------------------------------------------------include<lcd4bitsPORTC.inc>
include<teclado.inc>
end
CONCLUSIONES:
Debemos tener mucho cuidado a la hora de realizar la
instalacin de una alarma electrnica, por eso siempre
debemos asesorarnos correctamente para as no cometer
ningn tipo de error para no daar la alarma.
BIBLIOGRAFIA:
http://www.forosdeelectronica.com/f23/alarma-casera-4715/
http://new.taringa.net/posts/info/4182331/Como-construir-tupropia-alarma-casera.html
http://www.antirrobo.net/alarmas/alarmas-electronicas.html
http://arckangeles.blogspot.com/
http://www.yoreparo.com/foros/diseno_electronico/237880.html
http://blog.bricogeek.com/noticias/electronica/alarma-caseracon-un-pic-16f628-sensor-pir-y-viejo-modem/
http://www.aprendergratis.com/instalar-una-alarma-encasa.html