Introduction: WiFi Based Home Automation by Intel Edison and Banana Pi M1
This is the project I done alone during the period of National Taiwan Univ. Hackthon, since August 21, 2015 to August 23, 2015 in Taipei. I tried to make something could be helpful to those Taiwaness whose age is old. So, I picked those comsuming electronics products up which is available and inexpensive to make this project.
The host computer in this project is Banana Pi M1, which is a famous name card size Linux single board computer, the image I adopted is Ubuntu MATE, but installed wiringBP and Banana Pi GPIO package for Python. You can download and prepare everything you need to clone the host in this project :
1. OS Image download ==> http://www.bananapi.com/index.php/download?layout=...
2. wiringBP ==> http://regishsu.blogspot.tw/2015/05/banana-prowiri...
3. GPIO package for Python ==> https://github.com/LeMaker/RPi.GPIO_BP
Actually, all *.py those script files written in Python are compatible with Raspberry Pi 2, but please do not forget the definition of pins are different.
The sensors in whole system are bundled with Intel Edison and its WiFi shield. There are 4 sensors this project adopted : flame detector, smoke detector, thermal and photo-resistors. Their specifications are listed as following :
1. Flame detector ==> http://www.ltc.com.tw/product_info.php/products_id...
2. Smoke detector ==> http://www.ltc.com.tw/product_info.php/products_id...
3. Thermal resistor ==> http://www.seeedstudio.com/wiki/Grove_-_Temperatur...
4. Photo-resistor ==> http://wiki.openpicus.com/index.php/GROVE_-_Light_...
The other components included : One 9V LED with PIR, a 5V/3A DC power supply, one DC servo (Mine is Tower Pro MG90), Logitech C170 webcam and 4 ports USB hub.
Whole system are based on traditional TCP chat client and server, so it is not too difficult to understand. Now, let's get it done and put it work!
Step 1: Make Your Distributed WiFi Sensors by Intel Edison
I programmed my Intel Edison by its Arduino IDE 1.6.0, the sensors are all supplied DC 5V on board power, for easy to implement, I adopted Base Shield. That's OK if you just wire them by jumpers with no Base Shield.
You can download the source code file : https://www.instructables.com/files/orig/F3Z/0B5Z/I...
Follow the instructions Intel told you, and program your Intel Edision! When this step is done, you can check it out by your Android App. Like you watch in the following video :
The commands to read four sensors are :
A --> Smoke detector
T --> Thermal resistor
P --> Photo resistor
F --> Flame detector
The Android App I use in video can be downloaded at Google Play, key word is 'Telnet'. Or, the Python script I wrote also works :
Step 2: Prepare Your Webcam and DC Servo for Monitor Your Home
This part is based on : Web Cam streaming from Raspberry Pi to Android using streamer
You can get your live video in your home on your Android App by follow the steps this forum told you. But, we can not change the angle of webcam as we want, for this article didn't teach us how to control the motor or something to fit our requirement.
Thus, I try to get a DC servo which is Tower Pro MG90, and a plastic rack I got to put webcam on it. The DC servo repeat changes the angle of webcam, and you can watch live video on your Android phone then. The Python script to control DC servo by GPIO BCM #27 is :
For Tower Pro MG90 is not so powerful to drive the webcam and plastic rack I found, so an independent 5V/3A DC power supply for Tower Pro MG90 is suggested.
All Banana Pi M1 GPIO description has shown here : http://hardware-libre.fr/2014/07/banana-pi-gpio-no...
Step 3: Modify Your LED to Be Controlled by Banana Pi M1
I did some modification on the marketed 9V LED with PIR, for it needs batteries, so I replaced the batteries with many parallel linked capacitors. And, get its series with an NPN to let it becomes controlled by Banana Pi M1.
The 9V adaptor is boundled with 9V LED with PIR itself, I just wired it.
Step 4: Put Everything Together and Run Your Host!
The host runs Python script "qs.py" to accept commands from Android App, such as "light off" and "light on" to power 9V LED up or not.
It also can produce voice by Text to Speech that pre-installed in Ubuntu MATE of Banana Pi M1. If not, please check out "eSpeak" package.
That's all! So easy, huh? Enjoy!
And, please let me know if you have any good idea about this project, I am an open source maker, of course I like DIY forever!