ECE497 Project Home Control System
Embedded Linux Class by Mark A. Yoder
Team members: Boyu Zhang, Bo Pang, (List all the team members here with link to their eLinux User page. Use my format.)
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.
Highlights
Here is where you brag about what your project can do.
Include a YouTube demo.
Theory of Operation
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
List the major tasks in your project and who did what.
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.
Future Work
Suggest addition things that could be done with this project.
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