A Raspberry Pi project to detect and display my plants' soil moisture (image). My project is configured for the Raspberry Pi 3B+ using Python 3.7.3.
It's as simple as cloning this repository and running:
pip3 install -r requirements.txt python3 main.py
This project is designed to provide a fairly simple API out of the box.
- For example, let's set up this instance:
- We want to set up 5 soil moisture sensors
- We want these sensors to have callback (i.e. notify in real-time when soil moisture changes)
- We want to display this information on a 16x2 I2C LCD display.
from soil import Soil, lcd
import time
# gpio channel: plant name
plant_map = {
16: "Peace Lily",
19: "Prls/Jade Pothos",
20: "Calathea Mdln",
21: "Micans Pothos",
26: "Golden Pothos",
}
my_plants = Soil(plant_map)
my_plants.setup(callback=True, display="lcd")
if __name__ == "__main__":
try:
# let's display a welcome message for 5 seconds
lcd.display("Let's detect", "soil moisture!", duration=5)
while True:
time.sleep(1)
except KeyboardInterrupt:
# clean up GPIO channels on application exit
my_plants.cleanup()
- The bare minimum hardware to run the example above are:
- Listed are resources I found useful in setting up hardware:
If you are having issues or would like to propose a new feature, please use the issues tracker.
This project is licensed under the MIT license.