This project will show you how fast you can build your own alarm system capable of supervising one or more magnetic contacts and inform you via SMS of the "burglar event". You even have the possibility to control (ENABLE/DISABLE) the alarm system remotely, via SMS commands.
For SMS communication purposes one of two pin to pin compatible c-uGSM and d-u3G shields
, can be used in this project. The first one it is a quad band GSM only
(world wide compatible) and has support for 2SIMs and the second one is SINGLE SIM 3G only (North American version
) / 3G+GSM (European and rest of the world version
). These shields are compact with dimensions of 1.25"x1.57"(31.75x39.88mm) / 1.35"x1.57"(34.29x39.88mm) respectively, weigh around 10g, have USB support (communication and powering), auto level 3-5V digital interfaces and an integrated Lithium Polymer charger.
Parts needed for project:
Other parts/materials/resources needed:
Hardware wiring (putting all together):
In the picture above you can observe almost all connections (c-uGSM shield in "WITH Lithium Polymer" configuration.). Supplementary, the Lithium Polymer battery must be connected to the c-uGSM shield. Both boards can be powered, in this configuration, via the Arduino UNO power connector, or via the Arduino Uno USB connector.
The magnetic contact
is connected between the ARDUINO UNO pins D4 and GND. HINT:
if you would like to have many magnetic contacts, just connect them in parallel mode (alternate way: use separate Arduino digital pins and modify the software...).
More info regarding c-uGSM / d-u3G shields wiring can be found in pictures bellow:
Advanced Interfacing and Wiring
GSM SHIELD (micro) c-uGSM v 1.13 top PCB view
GSM SHIELD (micro) c-uGSM v 1.13 bottom PCB view
*For Advanced wiring reference please check the modules documentation.
Software (let's see about the logic behind the SMS Alarm System):
a. Start by making a folder named "SMS_ALARM_Magnetic_contact_supervisor".
b. Then download the "c-uGSM kickstart for Arduino" from c-uGSM CODE SAMPLES and UTILITIES
, or "d-u3G kickstart for Arduino" from d-u3G CODE SAMPLES and UTILITIES
if you use the d-u3G shield. Product EMEI and your email address is required.
c. Uncompress the archive and copy "cuGSM_basic_lbr.h", "cuGSM_basic_lbr.ino", "cuGSM_SMS_lbr.h" or "cuGSM_SMS_lbr.ino" ("du3_basic_lbr.h", "du3G_basic_lbr.ino", "du3G_SMS_lbr.h" or "du3G_SMS_lbr.ino" - 4 d-u3G users) files to the folder previously created.
d. Download from here (right click&save as) use "SMS_ALARM_Magnetic_contact_supervisor.ino" as file name, in the very same folder as above (left click to view the code):
SMS_ALARM_Magnetic_contact_supervisor.ino : ARDUINO SMS ALARM & GSM/3G SHIELD - main code
e. Edit the "SMS_ALARM_Magnetic_contact_supervisor.ino" (double click on the file; this one will be open by the ARDUINO environment).
Write in your desired destination mobile number on line 19. (IMPORTANT:
Before doing this you may check the supported SMS number format by your NMO, using our kickstart software
.) You may edit the SMS commands and the SMS messages assigned to the alarm events.
Remove comment line 17 only if you use the d-u3G shield.
f. Compile, upload and enjoy
SMS ALARM SYSTEM USAGE (How to ARM/ DISARM the system)
DISARM the SMS ALARM SYSTEM, #1
ARM the SMS ALARM SYSTEM. Any other SMS, makes the ALARM reply with a sort of "help message".
Any replied SMS appends the SYSTEM STATUS REPORT as: "ALARM STATE"/"NORMAL STATE".
TUTORIAL and SOFTWARE ARE PROVIDED WITHOUT WARRANTY. USE IT AT YOUR OWN RISK.
Originally published by Dragos Iosub & itbrainpower team