This repo contains scripts to first detect the moisture content in a soil and then send an alert or water the plant.
- RasberryPi
- Humidity sensor
- Tuya smart switch
- Aquarium water pump
- Plastic tubes
- Python3
- Put the moisture sensor in the soil.
- Connect the humidity sensor to the Arduino board provided with the sensor.
- Connect the Ground output of the Arduino board to pin 6 (ground) of GPIO of raspberrypi.
- Connect the Power input (VCC) of the Arduino board to pin 2 (5V supply) of GPIO of raspberrypi.
- Connect the digital signal output (DO) of the Arduino board to pin 3 of GPIO of raspberrypi.
- Attach the tubes to the water pump and the other end of the tube to the plant soil.
- Connect the power plug of the water pump to the Tuya smart switch.
- Complete the config.json file with credentials (SMTP server, emails & Tuya account and device info).
- Create local_config.json file. (for TUYA reference: https://docs.tuya.com/en/cloudapi/index.html)
{
"SMTP_HOST": "",
"SMTP_LOGIN": "",
"SMTP_PASSWORD": "",
"SENDER_EMAIL": "",
"RECEIVERS_EMAILS": [],
"TUYA_DEVICE_ID": "",
"TUYA_USERNAME": "",
"TUYA_PASSWORD": "",
"TUYA_LOCATION": ""
}
- Install the python libraries mentioned in requirements.txt file
- Run soil_status.py as sudo.
nohup sh -c "sudo python3 soil_status.py" > /dev/null 2>&1 &