Difference between revisions of "ECE497 Project Home Control System"
(→Future Work) |
(→Work Breakdown) |
||
Line 121: | Line 121: | ||
== Work Breakdown == | == Work Breakdown == | ||
− | * Figure how to use Beaglebone green to read data from Grove sensors and control Grove devices -- Bo Pang | + | * Figure how to use Beaglebone green to read data from Grove sensors and control Grove devices -- Bo Pang -- Finished |
− | * Make web service working and build the web interface -- Boyu Zhang | + | * Make web service working and build the web interface -- Boyu Zhang -- Finished |
− | * Figure out how to transfer data between beaglebone to web browser -- Boyu Zhang | + | * Figure out how to transfer data between beaglebone to web browser -- Boyu Zhang -- Finished |
− | * Build the demo box -- Bo Pang | + | * Build the demo box -- Bo Pang -- Finished |
== Future Work == | == Future Work == |
Revision as of 14:14, 9 November 2016
Embedded Linux Class by Mark A. Yoder
Team members: Boyu Zhang, Bo Pang
Contents
Grading Template
I'm using the following template to grade. Each slot is 10 points. 0 = Missing, 5=OK, 10=Wow!
00 Executive Summary 00 Installation Instructions 00 User Instructions 00 Highlights 00 Theory of Operation 00 Work Breakdown 00 Future Work 00 Conclusions 00 Demo 00 Late Comments: I'm looking forward to seeing this. Score: 10/100
(Inline Comment)
Executive Summary
During an era of IoT(Internet of things). We thinks it is a good idea to use Beaglebone green (which works better with Grove sensors comparing to Beaglebone black)to build a home control system.
Currently, We have connected 3 Grove sensors (temperature sensor,air quality sensor and light sensor) to the Beaglebone, so that our Beaglebone can read temperature, air quality, and light intensity of its environment. We also implemented a web server base on the Work of Kervin-Lee to display all the sensor data on a webpage. Using Grove relays, We figured out how to use Beaglebone to turn on/off of a cooling pad and a heating pad which simulates controlling the cooler and heater in a house, so user now can control cooler and heater in the home remotely on a webpage. They can also set target temperature and let the Beaglebone control cooler and heater automatically.
Fortunately, we finished all our set tasks for this project before last week of this term, so there is no feature that is not working. There only problem we encountered with was when we booted the Beaglebone and run our program, the light intensity data got from the light sensor would always be 0. However, if we rerun the our program, the light sensor worked fine again.
Overall, the project is in good shape right now. Really thanks to all the demo codes that Grove Wiki provides to us. We learned a lot when making different sensors works and trying to write a web server on the beaglebone. This is a meaningful project.
Packaging
Cape and Wiring
Because we have 7 Grove devices that are needed to connect to Beaglebone, so we decided to use a Grove Base Cape for connection. The picture on the right shows the wiring of our system.
All the names of Grove devices we used and port they connect on the cape are listed in the following table.
Grove Device Name | Number of Devices | Port used on Cape |
---|---|---|
Grove - Temperature Sensor | 1 | AIN0 |
Grove - Air Quality Sensor | 1 | AIN2 |
Grove - Light Sensor | 1 | I2C Bus2 |
Grove - OLED Display 1.12" | 1 | I2C Bus2 |
Grove - Chainable RGB LED | 1 | UART4 |
Grove - Relay | 2 | GPIO50, GPIO51 |
Cooling and heating system
There is no practical way that we can use the beaglebone to control an air conditioner in our home, so we chose to use a heating pad and a cooling pad to simulate the air conditioner. The following picture shows the circuit of our cooling and heating system. (Two relays in the picture are the same relays in the previous sections)
Installation Instructions
Prepare work
1. The python version on our bone is 2.7.9. Please first execute following command to verify python version.
bone$ python -V
You should see the following message:
bone$ Python 2.7.9
2. For this project, we use flask web framework for our web service. To install flask please execute following command.
bone$ pip install flask
3. Flask-SocketIO gives Flask applications access to low latency bi-directional communications between the clients and the server. To install it please execute following command.
bone$ pip install flask-socketio
4. The flask-socketio package relies on asynchronous services, in this project, we selected gevent. To install gevent please execute the following command. This step may takes about 10 minutes.
bone$ pip install gevent
5. In this project, we use Adafruit_BBIO and Adafruit_I2C python module for GPIO and I2C communication. Please execute the following command to install them.
bone$ sudo pip install Adafruit_BBIO bone$ sudo pip install Adafruit_I2C
6. For controlling the OLED display, we need one more python module--smbus. To install it please execute the following command.
bone$ sudo apt-get install python-smbus
Running Code
1. Now, we have installed the requirements. Please download our code from our github repository by running the following command.
bone$ git clone https://github.com/Zhangb2rose/HomeControlSystem
2. Navigate to the project directory HomeControlSystem/Code and start the web service by executing the following command.
bone$ cd HomeControlSystem/Code bone$ python runserver.py
3. Open a web browser and input the Beaglebone Green local IP (default is 192.168.7.2) and port 8000. You will see a web interface.
User Instructions
- When the user open the web interface they will see a web page like the following picture.
- The top three panel shows the real-time temperature, air quality, and light intensity data.
- The bottom left three panel are used to control cooler and heater pad. User can turn on/off cooler/heater manually by pressing corresponding button, or user can set them in auto mode. Beagle will automatically turn on/off cooler/heater according to set temperature. Cooler will be turn on when current temperature is higher than the set temperature and heater will be turn on, if current temperature is lower than the set temperature. The default value of set temperature is 24 Celsius and user can change it by pressing up or down button.
- The bottom right panel is used to control a LED light which stimulate control lights in a house.
Highlights
- The RGB LED will tell us whether the cooler or the heater is running. When the cooler is running, LED will be blue. When heater is running, LED will be red.
- An LCD display will display the live sensor data once the web server is running
We also have a video demo which you can find Here (TODO)
Theory of Operation
TODO Give a high level overview of the structure of your software. Are you using GStreamer? Show a diagram of the pipeline. Are you running multiple tasks? Show what they do and how they interact.
Work Breakdown
- Figure how to use Beaglebone green to read data from Grove sensors and control Grove devices -- Bo Pang -- Finished
- Make web service working and build the web interface -- Boyu Zhang -- Finished
- Figure out how to transfer data between beaglebone to web browser -- Boyu Zhang -- Finished
- Build the demo box -- Bo Pang -- Finished
Future Work
There are a lot more Grove sensors and devices are available so more features can be added to the current control system.
- One interesting Grove devices is the Speech Recognizer which can can recognize 22 pieces of commands including 'start', 'stop', 'Play music'. Using this device, we can control our home control system using voice.
- Another interesting devices is the Fingerprint Sensor This device will allow users to use their figerprint to login the system making the system more secure.
- Sunlight Sensor is also a very useful device to allow the system detect whether sun rise or not and whether is a good time to open curtain of a window.
Conclusions
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.
Embedded Linux Class by Mark A. Yoder