Working on other topics since last update I’m back to improve this project some more.
I bought an Axis network camera. I’m planning to improve video part using Motion, which I’ve talk about last year.
Also, I’ve replaced the old fashion and fat laptop with a tiny RaspberryPi.
A nice device to replace my usb webcam :
Better image quality, especially in poor light condition. I also use an IR led projector.
WiFi : Allowing a remote install without usb cord
RJ45 connector : Easiest configuration
Perfect motion support
It’s a software motion detector.
Real time analysis is a lot faster than with ZoneMinder.
Configuration through a classic text file is a easiest and efficient.
netcam_url allows to get image from camera (
IP:8081/jpg/image.jpg for Axis 207MW)
Motion event can be stored in a database, which is convenient to reuse images.
Standard latop has been replaced with the tiny nano-computer.
I’m using Raspbian (Installed using Noobs)
Everything looks fine, except the fact that Motion requires some tweaks in order to get a fast motion detection.
(I’ve reduced camera resolution to VGA)
I will try to explain in details my aAlarm setup. My next task in to improve some Perl code and Django web monitor.
I’m also planning an Android interface, but that would take some time.
I’m currently testing Motion, a camera motion detector.
Recently, I’ve reinstalled aAlarm to a fresh Ubuntu Server box. For unclear reasons I could’nt use ZoneMinder at all, my C270 is not detected anymore.
It’s working smoothly with Motion. Motion service is also faster to start than ZoneMinder. Motion does not come with a complete Web UI (as in ZoneMinder), but it’s by far easier to use. Also, Motion provides db support. Each recorded image could be registered into db. I will integrate Motion with aAlarm, allowing replace ZoneMinder service.
Soon more about it.
AAlarm is an alarm system based on Arduino.
Feel free to leave your comments at the bottom of the page.
Up to 13 digital sensors
Control panel: Matrix keyboard, LED status, Buzzer
Sending email alert
Playlist playing (Sound presence simulator)
Video recording (Using ZoneMinder)
Configurable through Web Interface
Overview of web interface
Use Case 1: Activation and deactivation of the system without intrusion
Use Case 2: Activating the system with intrusion
Create a complete home automation solution (remote control of electrical devices, wireless capabilities) including aAlarm
Complex sensors using the Arduino analog inputs
Multi-user : personal access codes, per zone and per user permits
Event logging by user
Event Planning (Turn alarm off on a specific time frame, for a particular user ..)
aAlarm consists of three electronic modules connected via USB to a PC.
The main module is based on an Arduino Uno board, connected as a classic Arduino shield.
The main module concentrates connections to :
Control board (matrix keyboard) connected I2C
PC (Serial over USB)
Connected with I2C, it can be placed relatively far from the main board (more than 5 meters in my case). I used a telephone-type cable with RJ11 connectors on both sides for a clean and easy connection.
The connection cable also carries power for operating the board components (5v).
Enable or disable alarm
Visual status (Green and Red LEDs)
Audible signal (buzzer)
The siren is supplied with current by a voltage booster circuit. (This type of siren requires small current to operate)
Thus, the module converts the Arduino 5v output to 12v, with a sufficient level of decibels to wake the whole building..
Arduino has 14 digital I/Os. With siren connecyed, it is possible to connect 13 sensors on the main module.
Currently, I use a single detector door. It consists of a simple second hand switch.
Placed against the door of my apartment, the sensor detects door status : Open or Closed.
I’ve tested with multiple sensors connected (some simple switches). However, I would try to connect a gas or a smoke detector on free inputs.
ZoneMinder allows you to use one (or more) USB webcam.
I use a cheap Logitech cam to monitor the front door.
I’m using an old second hand laptop recovery. Several reasons for this:
Easy to fit
Works on battery and provides power to the entire alarm system in case of power failure (plus my modem is connected to an APC, this way alerts continue to be sent)
CPU power : ZoneMinder is a intensive CPU user. I doubt that a RaspberryPi would be sufficient.
I use a spared amplified speaker, placed near the door. Play music when I’m leaving home.
aAlarm has 3 software components:
aAlarm Controller, written in Perl, which provides interface with Arduino
The program loaded in Arduino itself
A Web client written in Django
The Controller and the Web client communicates through a data model (MySQL) built with Django ORM.
This is the main software component.
It communicates with Arduino, checking sensors states and determines the overall status. On the other hand, it intercepts commands from the web client to run them.
Serial communication (Serial over USB) with Arduino (Device::SerialPort)
Sending emails (MIME::Lite)
This Perl script also checks the ZoneMinder service is running and playlist is playing
Default settings are provided by a configuration file. Later, settings are saved in database and becomes the reference.
An evolution from the first version, simplified and more effective.
Checks sensors states, in case of change, notify the Controller. In addition, it controls the electronic components (LEDs, Buzzer, Siren) according to the orders passed by the Controller.
Initially, the Web client was written in PHP. Using Django allows more development flexibility, and provides an integrated ORM.
The Web client provides a real-time view (Ajax) of statuses and allows to remote control aAlarm.
Real-time status of the alarm and sensors
Real-time ZoneMinder and playlist status
Remote control (Enable / Disable alarm and services)
User authentication (Django)
Intrusion viewing (Using intrusion images from ZoneMinder)
On the fly settings (some configurations, however, require a reboot of the controller)
The data model is maintained by the built-in Django ORM.
Event: Events (global state and sensors)
Execute: Orders from the Web Interface
Parameter: Application Settings
ZoneMinder uses USB cameras (or IP) with motion detection.
This optional service is launched by aAlarm, and provides access to intrusion recordings.
AAlarm is based on six linked global states.
Each state represents a different situation that causes actions
OFFLINE: Disabled alarm
TIMED: Transient state, allowing user to get out
ONLINE: Enabled alarm
INTRUSION: A sensor has changed, the deactivation code must be entered
WARNING: The deactivation code was not entered correctly, warn the intruder with a sound (buzzer) and send a first email to user
ALERT: The siren is triggered, an email alert is sent
The transition from one state to another is determined either by user actions or by a changing sensor state.
The door sensor can be open or closed. It is possible to create other types of sensors through configuration.
Monitoring of optional services (ZoneMinder and playlist playing ) are implemented as sensors. Thus, they appear in the interface as conventional sensors.
The first full version AAlarm was functional, but basic:
Simplistic model data
Web client written in PHP / MySQL
Refactor of Perl Controller
Many settings (file and database)
New data model based on the Django ORM
Web client rewritten with Django
Integration with ZoneMinder (video monitoring tool)
Playlist playing to simulate presence