Building an Arduino-based alarm shield

Maker develops an anti-theft alarm shield compatible with a range of sensors, RFID, GSM and a web server.

No stranger to the Hackaday Prize, a Maker by the name of “IngGaro” has developed an Arduino-based anti-theft shield that offers users many of the same functions as a commercial home automation system for a fraction of the cost.


Simply put, the project is a shield for an Arduino Mega (ATmega2560). The unit includes connections to an alarm, a GSM modem, temperature and humidity sensors, magnetic and IR movement sensors to detect tampering and intruders, as well as an Ethernet module, a siren and a small UPS 2.2Ah battery for power. The Arduino discreetly attaches to a remote control box mounted near the front door, which boasts an LCD display, an NFC and RFID reader for authorization, a speaker for feedback, and capacitive buttons to arm and disarm the system.

“The panel is connected to the shield with a long 2/4 wire cable. The result is pretty good and it works perfectly. Since the I2C cable that connects to the main circuit is long, more than [the] I2C specification, I planned to add some kind of serial translator,” IngGaro explains. “However, it already works perfectly so I didn’t need it; the only trick to make it working fine was to add some capacitors to the magnetic sensors pins near the Arduino, since the rolling shutter electric motors randomly introduced some noise that caused I2C errors.”

The whole system can be remotely managed from a web-based interface or a smartphone via its app. When activated, owners can receive notifications by way of text message and email. It also connects to other in-home automation systems, which allows the DIY device to do things like open/close the blinds, turn on/off lights, control security cameras and monitor the temperature and humidity inside the house. What’s more, users can even manually trigger the alarm to sound for “emergency purposes.” Pre-set times and other options are fully programmable and stored in the Arduino’s EEPROM.


What’s nice is that users can choose to enable both perimetral and volumetric sensors, or just perimetral only if they’re in the house, and then activate it with NFC. This will trigger a predefined domotic action, like closing the rolling shutters and turning off all the lights, and then provide an owner with a pre-defined amount of time to exit the house — no different than the grace period in traditional systems.

“If some windows (perimetral sensors) are opened before activating the system, they’re automatically disabled until they’re closed again. If you open a windows, the alarm sounds immediately; if you open the door (e.g. coming back home) or move in front of a volumetric sensor, you have a (configurable) amount of time to disable it. You can also configure how many consecutive times the siren will be activated on alarm, for how long, and the ‘pause’ length between two alarms,” IngGaro writes.


Beyond that, the anti-theft shield’s software was written with Arduino IDE. According to the Maker, he employed the help of several libraries, including UIPEthernet for Ethernet, time and timezone for time management, and LiquidCrystal_I2C for LCD, among a few others.

“The system configuration (sensor number/type, authorized NFC IDs, etc.) has to be hard-coded in the Arduino code in some proper sections; system options (siren duration and other timings, domotic control, etc.) may be runtime configurated through the web server, and will be stored in the Arduino EEPROM. Date and time are automatically and periodically acquired with NTP,” he adds.

Intrigued? Head over to the project’s page on here.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s