I wanted to add video surveillance to my home automation project, which was a good excuse to add another Raspberry Pi to the project. I’d tried using an ATMega328 with the Pi but found it too cumbersome to write Python code and Arduino ATMega code. It worked with an I2C interface but I wanted something simpler.
The diagram below illustrates the Adafruit photo-board with all of the necessary interfaces to 5 volt and 3.3 volt devices.
Features of a Raspberry Pi 2 Surveillance project:
- Raspberry Pi 2 – REST server (HTTP communication and control)
- Surveillance – Raspberry Pi camera for video capture
- Panic Button – hardware debounced button (3.3 volts)
- Motion sensor – PIR sensor at 5 volts
- Night Light – large LED at 3.3 volts
- Identification – IR Sensor to check for “me”
- iBeacon sensor – BLE USB dongle checking for my iPhone iBeacon
- Alarm – 555 Timer driving a loud speaker
I enclosed the project in a plain wooden box. As you can see the cable management was a hassle with the hinge and external interfaces on the door.
All of the code is in Python. There are four main packages
- REST server code
- Hardware interace – interrupts
- Camera controls with 2 rotating JPEG images
- BLE iBeacon scanner
I will publish the code to GitHub when I get a chance.