AntiBurglar-pi – home alarm system

I’ve started this project when my old mobile phone died in security system, based on PIC microcontroller.

Instead of looking for another working old phone with a serial interface (and also because I had one spare Raspberry Pi 1 which was replaced by Raspberry Pi 2), I’ve decided to go “raspberry way”.

So, after a bit I’ve ended with such features:

  • 2 temperature zones. I monitor temperature inside device, also, since this is security system for my storehouse, I wanted to monitor temperature in a room also.
  • 2 security zones. Currently window and door, but it’s easy expandable to more.
  • Alarms via SMS. If a zone is triggered, a warning is sent to a specified mobile phone number via SMS.
  • Alarm via built-in siren. If a zone is triggered, system will power on a piezoelectric siren.
  • Control via SMS. System can be armed/disarmed via SMS. Also one can ask for a status report, trigger siren.
  • Power backup. System will be backed up with a Lead-acid battery. In case of a power loss, system will report about it to a specified mobile phone number via SMS and continue running on backup power.

Schematic of a controller:


First power regulator is used to charge a Lead-acid battery via standby voltage (for a 6.6V battery its between 6.75 and 6.9V) which cant be set via potentiometer (R1). Second, 5V low dropout power regulator is used to power “Raspberry-pi”. Optocoupler is used to detect power loss. GSM modem – currently I’m using “Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270/E870 HSDPA/HSUPA” modem. But any, which works in Linux with gnokii will do.

Eagle shematics and pcb together with the source code can be found in GitHub:

PCB is not very elegant one – it was created by a crude Eagle autorouter. Perhaps someday i will route it by hand.

Some notes on a software:

SMS susbsystem uses libgnokii library. Also you need wiring-pi libraries to compile software.

All system messages are written to syslog. All configuration is made in src/config.h file before compilation. Available SMS commands:

arm password (e.g arm 1111) – system is armed instantly (useful if you forgot to arm system by pressing arm button).
disarm password – armed system deactivates after receiving SMS.
status password – system responds with device uptime and temperature status after receiving SMS.
siren on password – siren is turned on.
siren off password – siren is turned off.


For a temperature sensors:

You need to have w1-gpio w1-therm modules loaded. After that, look for a devices in /sys/bus/w1/devices/ – you will have to enter unique names of your sensors listed there (usually starts with “28-0“) to config.h file.



About the Author

1 thought on “AntiBurglar-pi – home alarm system

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.