Fork me on GitHub

The Blog

Turn your old phone into a security Alarm System for Android

If you are an Android fan like me, you probably have several old Android Smartphones collecting dust in your drawer. In this post I will present to you the Irdroid AlarmBug – Electromagnetic Alarm Sensor Accessory for Android that will turn your OLD Android Smartphone into a Security Alarm System which will notify you every time someone opens / closes the door where the Irdroid AlarmBug is installed.

The Irdroid AlarmBug comes with a free and open source app for Android that will detect the Irdroid AlarmBug accessory and act in accordance with the door state – opened or closed. It also has a tamper protection – in case someone disconnects the Accessory it will send alarm to the email that you have specified for alarm reception.

The Irdroid AlarmBug accessory has two parts – a magnet and a sensor unit with cable, both equipped with a sticker band thus allowing you to easily fix the magnet and the sensor unit to the door that need to be monitored. The magnet is to be fixed on the movable part of the door – the wing and the sensor unit somewhere near the magnet, so that when the door is closed the distance between the magnet and the sensor unit is not more that 2.5 cm. The sensor unit connects to your Android device via a 4 Pole 3.5mm Audio Jack.

The Irdroid AlarmBug accessory is designed in accordance with the AOSP 3.5 mm Headset: Accessory Specification . The specification defines Functional, Mechanical and Electrical characteristics for the 3.5mm headset accessory.


In our case the magnetic sensor that we use has a reed relay inside. When a magnet is close to the reed relay its state becomes closed and it acts like a simple switch. When the magnet is away, the circuit is open. Considering the above we can use one of the buttons defined in the AOSP 3.5mm headset specification and represent its state by connecting the magnetic sensor to the Android device in accordance with the above schematic.

The Irdroid AlarmBug is using function  / button “C” shown on figure 1

If we comply with the connection shown on fig 1 then in Android we can listen in our App for a keypress that correspond to the relevant function (in our case function C / Volume Down and take action – trigger and Alarm or send message, once the action is performed.

The Irdroid AlarmBug Open Source Software Application has a simple user interface. It will indicate the magnetic sensor states – open / close


The Irdroid AlarmBug App is available from Google Play. Once downloaded you need to setup your email notification address in the App Settings. Once you set your email address for notification , connect the Irdroid AlarmBug to your smartphone and tap the magnet to the sensor unit several times in order to activate it.

If the sensor unit is close to the magnet < 2 cm the App screen turns Green with indication “System Armed” , if the magnet is at a distance greater than 2 cm from the sensor unit the screen turns Red with indication “Security Breach Police are on their way!”. In both cases an email is sent to the target email address configured in the app with information about the last state and date / time timestamp in the email. There is also a tamper protection feature which notifies the owner if the sensor unit cable is unplugged from the smartphone.

The Irdroid AlarmBug App is Open Source Software , you can freely modify it to fit for your particular purpose, add more features or whatever you decide to do.



Tags: , , , ,

Comments are closed.