
Jackson Sheu, Toya Amechi
05/01/2018
GATECH ECE 4180
The mini automated greenhouse is designed to make home plant care easier through flexibility and automation. It provides for both manual and scheduled functionalities, such as irrigation and lighting. The greenhouse system also collects, stores and visualizes environmental data. In addition, a web GUI combines all above data and functionalities.
1. Automated and Manual Irrigation: irrigation is done on a schedule unless triggered by dry soil moisture level or manual remote control.
2. Soil moisture measurement: keep track of moisture level of the soil to trigger or stop irrigation.
3. Temperature and Humidity measurement: keep track of the greenhouse temperature and humidity level.
4. Light intensity measurement: measure light intensity received by the plant and trigger the lights to turn on when natural light is insufficient.
5. Plant Growth measurement: track the height of the plant.
· A Raspberry Pi 3 - https://www.adafruit.com/product/3055
· Mbed LPC1768 - https://os.mbed.com/platforms/mbed-lpc1768/
· NeoPixel Stick - https://www.adafruit.com/product/1426
· Temperature and Humidity sensor (TH02) – https://www.mouser.com/ProductDetail/Seeed-Studio/101020074?qs=sGAEpiMZZMt6ebhnBMWiDGx7DEbjJyM5n589gVHaC6BOMmfoBr%2frXA%3d%3d
· Water sensor - https://www.mouser.com/ProductDetail/Seeed-Studio/101020018?qs=%2fha2pyFadui6qdzJb%2fTJaS%252brio5eBXMQREY1WG4uDbIsyBQZT1MPeg%3d%3d
· Light sensor - https://www.mouser.com/ProductDetail/Seeed-Studio/101020030?qs=%2fha2pyFadui6qdzJb%2fTJafx0xzjqbb%2f3eABWjalUs8oliEzoYcD%2fMQ%3d%3d
· Sonar sensor - https://www.sparkfun.com/products/13959
· Servo - https://www.adafruit.com/product/155
· A fish Tanks or a clear case.
· A Plant
Project development code can be found in the following links:
Python source code: https://github.gatech.edu/tamechi3/4180_Project
Mbed source code: https://os.mbed.com/users/tamechi3/code/Final_project/
This guide assumes you are familiar with Raspberry Pi and the Linux environment. Install Raspbian OS on your Raspberry Pi, update, upgrade, and set up as desired.
How the greenhouse works: read-serial.py on the Raspberry Pi sends commands over the serial port to the Mbed to read sensor data. Mbed sends data back over the serial port, which read-serial.py receives and pushes to a MySQL database. App.py (also on the Pi) runs a Flask web server that queries the MySQL database and displays data on the Web GUI. App.py can also send commands to the Mbed to activate the lights or servo for irrigation.
Our web GUI was created using the Flask framework. First, make sure Flask and other dependencies are installed:
sudo apt-get update
Pip install flask
Pip install serial
sudo apt-get install rpi.gpio
Copy app.py into any directory of your choice. Make sure you create subdirectories called /templates to hold the home.html file and /static to hold the Chart.min.js file.
To get the website up and running, navigate to the same directory where app.py is and run:
Python app.py
If successful, you should be able to open the web page in a browser at http://127.0.0.1:5000/
We use a MySQL database to hold all the sensor data. First, make sure the correct dependencies are installed:
sudo apt-get install mysql-server
pip install mysqlclient
Then create your database:
mysql -u root -p
<ENTER YOUR PASSWORD>
CREATE DATABASE sensordata
use sensordata
exit
Then create the Data table by running the provided createdatabase.sql script:
mysql -u root -p < createdatabase.sql
In the app.py and read-serial.py files, we need to add the credentials for your database. In both files, at the top you will see the following line.
db=MySQLdb.connect(user="root",passwd="<YOURPASSWORD>" ,db="sensordata")
Replace <YOUR PASSWORD> with the password you set for your mySQL database.
Now your database should be set up!
Import the program from the following link and load the program onto your mbed: https://os.mbed.com/users/tamechi3/code/Final_project/
NeoPixel
|
Mbed |
NeoPixel |
|
VU |
VCC |
|
GND |
GND |
|
P5 |
DIN |
Water Sensor
|
Mbed |
Sensor |
|
VOUT |
VCC |
|
GND |
GND |
|
P15 |
SIG |
Temperature and Humidity Sensor
|
Mbed |
Sensor |
|
VOUT |
VCC |
|
GND |
GND |
|
SDA |
P9 |
|
SCL |
P10 |
Light Sensor
|
Mbed |
Sensor |
|
VOUT |
VCC |
|
GND |
GND |
|
SDA |
P28 |
|
SCL |
P27 |
Sonar Sensor
|
Mbed |
Sensor |
|
VU |
VCC |
|
GND |
GND |
|
P6 |
TRIG |
|
P7 |
ECHO |
Servo
|
Mbed |
Servo |
|
VU |
VCC(red) |
|
GND |
GND(black) |
|
P24 |
SIG(white, yellow or orange) |