Home Surveillance with Raspberry Pi and Azure Storage
No monthly or annual cloud service cost at all, and all the photo send to Azure Storage (very cheap) immediately.
- Raspberry Pi 2 : http://www.makershed.com/products/raspberry-pi-2
- TF card (recommand 8GB, I use my existing one)
- Camera with night vision : http://www.ebay.com/itm/301282564581
- PIR Sensor for motion detection : http://www.ebay.com/itm/261455286898
- Female to Female jumper wire: http://www.ebay.com/itm/201206217951
WIFI Dongle: http://www.ebay.com/itm/200899513388
Initialize Raspberry Pi 2
Raspberry Pi connect to Camera using special cable, which is already included in the package.
Connecting to PIR Sensor take some time, here are the reference :
- PIR Sensor diagram: http://stak.com/image/cache/data/products/235/235914/hc-sr501-labelled-alt-800x800.png
- Raspberry Pi 2 GPIO diagram: http://pi.gadgetoid.com/pinout
So Pi pin 6 (GND), connect to PIR GND.
Pi pin 2 (5V), connect to PIR VCC.
Pi pin 11 (BCM 17), connect to PIR OUT.
The most convenience language code on Raspbian is Python, while in my understand it’s like Powershell on Windows.
Luckly, we got most of the modules we need:
- GPIO Module: http://sourceforge.net/p/raspberry-gpio-python/wiki/Home/
- PiCamera Module: https://github.com/waveform80/picamera
- Azure Module: http://azure.microsoft.com/en-us/documentation/articles/storage-python-how-to-use-blob-storage/
Then the code is really simple:
Keep pulling status from BCM 17, which is hooked to OUT from PIR, once it return true, take a photo and send to Azure Storage, which is very cheap.