Reads moisture level of soil in order to keep track of watering your plants.
- Clone this repo to a Raspberry Pi (I run Debian Wheezy on mine).
- Download the Arduino IDE onto your Raspberry Pi.
- Connect your Arduino to your Raspberry Pi via USB.
- Verify which serial port on your Pi your Arduino is connected to (check for /dev/ttyA*)
- Change line 7 of MoistureReader.py (ser = serial.Serial('/dev/ttyACM0', 9600)) to use the correct serial port.
- Attach your moisture sensor to your Arduino as shown in the diagram above.
- Place moisture sensor into soil in area you would like to monitor.
- Upload the GetMoistureLevel sketch to your arduino.
- Run the following command on your Raspberry Pi
$ python MoistureReader.py
Kill the python process when you want to stop. (Plan to make this more elegant later). Results will be written to a local /logs directory on your Pi with timestamps. The higher the number, the more moisture is present. You can use whichever software you'd like to graph the data, or you can see the graphing section below.
I read a value from the moisture sensor every 5 minutes. (Based on the delay in the arduino code). I now also read data from a water sensor. This is used to measure how much water is in the bucket I will use for my reservoir. All it does right now is print the value to console.
I added a new file to allow graphing with python. Hopefully this will run automatically and host images to a server in the future, but for now it's a simple program that takes a file as a command line argument:
$ python GraphData.py <moisture-data-file-name>
It displays a graphical window plotting each data point (moisture on the vertical axis, time (in intervals of 5 minutes by default) on the horizontal axis).
You can graph the raw data in excel or google sheets if you prefer (or whatever you want).
-Automatic Watering
-Automatic email to remind user to fill water reservoir
-Server on RPI with rest API to control/monitor from anywhere
-Automatic long-term monitor scheduling
-Automatic graphing on RPI with matplotlib