hAlarm hAlarm
« Home Alarm System »

Guide

The soft Keypad

I use an old old phone but you can use a tablet or whatever that have a modern webbrowser.
Since the application rely on LAN network this one is the weakest part of the system. You can strengh it by using an UPS to power your logger, your router, your detectors, sensors and sirens.
You can also strengh the WAN side by using a GPRS shield on the arduino to send SMS messaging. Or use Automate for Android to do so via your Keypad (see the how-to)

Mind that the device should stay powered when armed. I bought a mini 12V to usb for that purpose also most of android devices have build-in battery.
You will need to force the Wifi to be always active and remove the screen lock, the device should always be reachable when the application run. You can also disable all notification if you don't want to be bother.

Turn the old central using an Arduino


I advice to take your times doing things, making the system can take several hours or even few days. So don't work in a rush, take the time to understand.
As my logger is close from the old system i use a simple (2m) USB cable. If your system is farther you can use a wifi, bluethooth, one wire-shield or wiser an ethernet shield which could be as 100m from the logger.

Step 1

To recuperate an existing installation, you'll need to power it off. Wait few hours to make sure the batteries are empty.
You may get a warning from your old central, look on the documentation to skip the message.

Step 2

Open the enclosure. You'll see bunch of wires going to detectors, sensors, sirens and keyboard. You might also have a telephone line.
Disconnect the phone line first and extend the circuit if necessary. Test if your phone is ok.

Step 3

Try to see indication of the whole wiring. Checking the circuit board is a good idea. Mark each cable and unplug them carefully from the central.
If you have unknow cable you can test it using a multimeter, i know it's a pain and it can take times to do so.

Step 4

Now you should see clearer. Remove the old alarm card, the old battery and others uneeded parts.

Step 5

Unplug one detector to make some test on a bench. You either have a dry contact or some resistors in it.
It is best to use the resistor bridge to check the signal level and to see if something wrong with the detector.
The arduino have a limited number of analog inputs. You can either connect several arduino together or you can switch using only digital ones.
If you plan using digital, use normally close contacts and make sure to use a pull-up resistor on the inputs as the arduino can detect really low voltage. Without, it will lead to false alarm.

Step 6

Do some sketchs with the arduino, test how long last a pulse. Using analogue inputs: figure out the level range from (0-1024). Mine is around 500 when high and 1000 low.
You can set a threshold when the value is detect, again be patient. It is playfull and should stay fun !

Step 7

Use dedicated power sources, it will be safer. My system is 12V, one is dedicated for detectors and keypad, the second one will be for sirens and flash light. Check also if the consumption of your outputs is enough with the source.
Don't mess-up with power, that could ruin your componements. For exemple, the ground of the arduino isn't the same as the ground for sirens.

Step 8

Now you can do the arduino coding part, take my ino code example. Set up the inputs for detectors, the outputs for relays.
It is also important to keep a timer inside the µcontroller to turn off the main siren. If something ever went wrong with the software, you won't annoy the neighborhood..

Step 9

Adjust your code to make it talk with hAlarm. The output string must be in JSON such as : {"I0":"off", "I1":"off", "I2":"off", "I3":"off", "O1":"off", "O2":"off", "O3":"off"}
Where I entries correspond to Input, O for Output and T for Tamper.
You may test if your output is valid with JSONlint

Step 10

Connect your arduino into your logger. Take a look on the reqalarm.py example, adjust it and test if you can retrieve data from your terminal.
Make sure you can execute the application and use the com port as webserver user. (Some good hints are available in debug)

Step 11

We're getting closer, it's time to configure hAlarm. Into config/config.php you will setup the installation. All details are in the code.

Step 12

Do the recabling and do it properly. I advice to use a screw shield, it's really convient.
Wire the inputs contacts to the arduino and the power the detectors and sensors.
Wire the outputs to the relays but don't connect power to your sirens yet.

Step 13

Place your soft keypad(s) nearby the entrance(s), fix on a wall and power it/them.

Step 14

Processed full testing with hAlarm, carefully test each senario. Entering, leaving, alarms and what it does (command relays)

Step 15

That's the final one, wire the dedicated power for sirens and enjoy !
 
 
Credit: Jean-Marc Louviaux

hAlarms