Micro alarme caseiro - Homemade micro alarm

Micro alarme caseiro - Homemade micro alarm

Algumas pessoas perguntaram-me se tinha algum projecto de um alarme para colocar no site.

Decidi colocar este. É um micro alarme caseiro mas capaz de cobrir 4 zonas de detecção.

Sometime ago i was asked if i had any alarm project that i could post here on the site.

I decided to post this one. It's a homemade micro alarm capable of detecting 4 areas.

 

O micro alarme tem muitos poucos componentes.

O micro-controlador usado é um 16F84A e tem 2 saidas dedicadas para ligação a sirene e luz exteriores.

The micro alarm has few components.

The micro-controller used is the 16F84A and has 2 dedicated outputs for external sound and light.


 

 

Antes de fazer downloads veja este aviso

Before you start downloading please see this warning

 ruijc.webnode.com/news/downloads/

 

 

O esquema em maior detalhe pode ser descarregado aqui:

The schematic in better detail can be downloaded here:

... DOWNLOAD HOMEMADE MICRO ALARM JPEG

 

O circuito pode ser ligado a uma bateria de chumbo de 12V ou a um transformador com saida 12V.

Aqui fica a lista de componentes:

The circuit can be connected to a 12V Pb battery or any 12V power supply.

Here's the component list:

R1...39R

R2/R7/R8/R9/R10/R11...10K

R3/R4/R5/R6/R12/R13...1K

C1/C2...15pF

C3...10uF

C4...100nF

CR1...8MHz XTAL

VR1...7805

IC1...16F84A

L1/L2/L3/L4...5mm RED LED

L5/L6...5mm BICOLOR LED (L5 vermelho e L6 verde)

S1/S2/S3/S4...SWITCH

KEY...KEY SWITCH

 

O key switch é um interruptor de chave e vai servir para armar e desarmar o alarme.

Este é o que usei neste projecto:

The key switch showned bellow is used to arm and disarm the alarm.

 

Quanto aos switchs, qualquer tipo de switch pode ser usado desde que seja do tipo "Normalmente Aberto".

O projecto conta com 4 zonas, mas podem ser adicionados mais switchs desde que sejam colocados em série.

For the remaining switches, any kind of switch can be used as long as it's a "Normally Opened" type.

The project will detect 4 areas but more switches can be added plugging them in series.

Com este tipo de configuração, os switchs ficam com os contactos fechados quando o alarme está armado. Abrindo um deles ou caso o fio seja cortado o alarme actuará.

With this type of configuration, the switches will be closed when the alarm is armed. Opening one of them or even if the cable is cutted the alarm will be triggered.

Estes foram os que usei:

These are the ones i used:

 

 

Como mencionei em cima, o alarme tem 2 saidas para luz e som. Para a luz, podem ser usados leds de 10mm, por exemplo, ou então usando um relé de 5V é possivel ligar uma lâmpada com voltagem superior.

As i mentioned before, the alarm has 2 outputs for external light and sound. For the light, 10mm leds can be used or connecting a 5V relay it's possible to use a light bulb with higher voltage.

Para o som, decidi usar um daqueles alarmes de janela. Estes alarmes são baratos ( este custou apenas 1 euro ) e faceis de modificar para além de terem 90dB de potencia sonora.

For the sound, i decided to use one of those commercial window alarms. These window alarms are very cheap ( this one costs 1€ ) and it's very easy to modify. Also it can provide 90dB of sound.

 

É preciso abri-lo e fazer algumas alterações para funcionar com o meu projecto.

A primeira coisa a fazer é desoldar o interruptor magnético. Depois soldamos um fio em cada terminal de ligação ás pilhas.

É necessário ter atenção á polaridade e ligar os negativos de ambos os circuitos e o positivo á saida  do micro controlador.

A resistência R1 só é necessária se for instalado este alarme de janela para o som. Caso se use uma sirene exterior a resistência R1 deverá ser substituida por um relé de 5V.

We need to open it and make some changes for it to work with my project.

The first thing to do is to desolder the magnetic switch. Then we have to solder one wire on each battery connector.

Pay attention to the polarity and connect the ground together on both circuits and the plus wire to the microcontroller output pin.

The R1 resistor is only necessary if this window alarm is used. If other system is used the resistor should be replaced with a 5V relay.

 

O circuito pode ser montado numa placa experimental ou numa placa de circuito impresso.

O micro-controlador necessita ser programado com o programa que fiz.

The circuit can be mounted on a perf-board or on a pcb.

The microcontroller needs to be programmed with the firmware i created.

 

 

O ficheiro hex com o programa para o micro-controlador pode ser descarregado aqui:

The hex file with the alarm firnware can be downloaded here:

... DOWNLOAD HOME MADE MICRO ALARM HEX ( versão actualizada em / updated version on 1/Jul/2010 )

 

Funcionamento:

Ao ligar o alarme ele irá verificar o estado da chave que deverá estar na posição desarmada. Caso não esteja ele indicará piscando os 4 leds de zona.

Passando esta verificação, o alarme estra em modo de espera. O led bicolor ficará verde.

Ao rodar a chave o alarme entra no modo de transição piscando a vermelho o led bicolor.

O alarme permanece neste estado durante 40 segundos para dar tempo de sair e fechar a porta. Após esse tempo o alarme fica armado e o led bicolor fica vermelho fixo.

Caso nenhum switch seja activado e se torne a rodar a chave o alarme é desarmado e o led bicolor retorna a verde.

Caso algum dos switchs seja activado o alarme espera 40 segundos para o desarme e depois é activado e é aceso o led correspondente á zona detectada.

As saidas de luz e som são activadas e o alarme tocará durante 2 minutos. Fará uma pausa de 30 segundos antes de tocar de novo durante mais 2 minutos.

Rodando a chave o alarme deixará de tocar e ficará apenas com o led de zona detectada aceso durante uns segundos. Após alguns segundos o led de zona apagará e entrará em modo de espera novamente.

   

How it works:

Turning on the alarm for the first time it will check the key switch's position. In case the key switch is in the armed position the alarm will blink the 4 area leds. Turning the key switch to the correct position the alarm will enter the standby mode and the bicolor led will turn green.

Once in standby mode, turning the key switch to the armed position the alarm will go to the transition mode where it waits 40 seconds before it actually enters the armed mode with the bicolor led in red color. The 40 second transition is more than enough to close all the doors and leave.

If no switch is activated and the key switch is turned the alarm will go back to the standby mode and the bicolor led to green again.

If one of the switches is activated the alarm will go though a 40 seconds transition time where is possible to turn the key switch without triggering the alarm. If after the 40 seconds period the key switch is no turned the alarm will be triggered and the specific area led will turn on. Both sound and light outputs will be activated for 2 minutes. It will stop for 30 seconds and then activated again for the next 2 minutes.

Turning the key switch will stop the sound and light outputs but will keep the area led on for a few seconds until the led turns off and the alarm returns to the standby mode.