Completed on: 07/12/17 SYSC 3010 Plant Pals project repository
Plant Pals
Plant Monitoring and Watering made easy
Caleb Gryfe
Muhammad Tarequzzaman
Emma Maddock
Steven Nash
To operate this system in a similar fashion as we have done, you will require 2 Raspberry pi's, an Arduino, and an internet connection.
Additional Hardware used:
*- moisture sensors and accompanying Detector Modules
*- DC Stepper motor & motor shield
*- DC water pump
*- 1pin input Transistor module
(An additional rig was used to hold plants and move the pump nozzle)
-
Plug Arduino into raspberry pi using USB A/B serial cable
-
Open Terminal and run the following commands:
$ sudo apt-get update
$ sudo apt-get install arduino
-
Once these have finished
-
Download Rpi_headless
-
Unzip contents to Desktop
-
Navigate to the Libraries Folder of the Arduino IDE and the ArduinoJson file in Rpi_headless, use the "Extract to" function to move ArduinoJson into the library folder
-
Navigate to Rpi_headless -> plantMoisture.ino and open using the Arduino IDE
-
At the top left of the Arduino ide click the forward arrow "Upload"
-
Open terminal and run the following commands:
cd \home\pi\Desktop\Rpi_headless
python main.py
The headless pi have been developed by using Python 2.7 language. This device consist of following classes,
1.main.py
Execute the System operations and can be called over SSH.
2.Http_server.py
Send JSON package to server using HTTP protocol and gets the instruction after that.
3.PlantSpecific.py
Have preset of Plants position and watering behavior.
4.Pump.py
Enable or disable water pump.
5.Read_serial.py
Reads serial data from Arduino serial.
6.SetupGPIO.py
Setup GPIO pin to control Pump motor and Stepper motor.
7.StepperMotor.py
Control Stepper motors motion, Forward or backward over time or stop it in a position.
8.WaterPlant.py
Execute the logic of watering the plant using Server instruction.
- Install Apache onto the Raspberry Pi.
- Download all .php files into the /var/www/html directory in the Raspberry Pi.
- Find the IP of the Pi using the ifconfig command in a terminal.
- Change the code in the Python client and in the app that reference the IP to said IP.
- Create a MySQL database called web_plants, and give it user access (you can change the user info in the PHP code).
- Create MySQL tables plants and plant_data with the fields defined in the image in the serverCode directory.