Door entry alarm that uses a BeagleBone Black microcontroller to monitor the opening & closing of a door.
- BeagleBone Black (BBB)
- BBB Power Supply
- Magnetic Door Alarm (used this model from Harbor Freight, cost $4.49 in a two-pack)
- Small prototyping breadboard
- (1) 10K Ohm resistor
- Wire in various colors
- Multimeter with test leads
- Dremel tool with attachment to cut plastic
- Soldering Iron
- Solder
- Desoldering Braid (optional)
-
Open the magnetic door alarm case
-
Cut wires from speaker
-
Desolder the wires running from circuit board to the speaker
-
Solder two new, longer wires to the circuit board
-
Use a Dremel to create a small hole in the alarm case to route the new wires outside
-
Seal up the case
-
Connect the wires to the breadboard in a voltage divider configuration with the resistors, ensuring that voltage doesn’t exceed 1.3V
-
Use a digital multimeter to verify that the alarm triggers about a 200 milli-volt rise in voltage across the voltage divider circuit wires when the magnet is removed.
-
Connect the voltage divider outputs to analog input pins on the BeagleBone Black
-
Apply power to the BBB
-
SSH into the BBB
-
Install Python dependencies:
sudo apt-get update sudo apt-get install python-pip git clone https://github.com/bear/python-twitter.git cd python-twitter/ sudo pip install -r requirements.txt python setup.py build sudo python setup.py install sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus -y sudo easy_install -U distribute sudo pip install Adafruit_BBIO
-
Clone this project into the ubuntu home directory:
git clone https://github.com/urlgrey/beaglebone_entry_alarm.git
-
Edit the settings file:
vi ~/beaglebone_entry_alarm/settings.py
-
Add an entry to the
/etc/rc.local
file, before theexit
statement, to start the script on boot:
/home/ubuntu/beaglebone_entry_alarm/door_alarm.sh &> /var/log/door_alarm.log