An Arduino powered automatic plant watering system
During the depths of the March pandeminc, I decided to make an automatic plant watering system with the Arduino board I had from college. While it took a little while to figure out, the system now monitors the soil moisture level, records the measurements to an SD card, and waters the plant according to a simple model I created. By tuning the watering model I have been able to reduce the variability in the soil moisture, decreasing the standard deviation in weekly moisture readings from ~12.5 at the start to ~6 as of the last weekly test. Most important of all the plant is THRIVING! Here's how the system works.
The watering system is made up the following components:
- Arduino board
- Soil moisture sensor
- 12V peristaltic water pump
- 12V external power supply
- 5V relay
- Micro SD card reader
- RTC clock module
- Breadboard
- Wiring
Below is a wiring diagram showing how the different parts. The circuito.io diagram with parts can be seen here. See the attached .ino file for the associated program code.
The watering system is a mix of inputs and outputs. First, the moisture sensor reads the soil moisture level and returns a number corresponding to how wet or dry the soil is. The data is then written to the SD card module along with a date/time measurement. The system performs this process every minute. Every hour, the system takes the average of the prior 60 moisture readings and inputs it into a model that determine how long to water the plant. The system uses an average in order to mitigate any single erroneous measurement. A signal then triggers the 5V relay attached to the Arduino to power the 12V water pump for the duration of time specified by the model. This monitoring and watering process continues 24/7.
The watering model takes the input from the soil moisture sensor and outputs a watering time. Soil moisture values range from ~300 (very wet) to ~750 (very dry). I used a linear model to calculate watering duration. Based on the data, I tweaked the model to administer more or less water (slope). The final model (v5) used the following equation: (Avergage Soil Moisture/20) - 25. By tuning the watering model I have been able to reduce the variability in the soil moisture, decreasing the standard deviation in weekly moisture readings from ~12.5 at the start to ~6 as of the last weekly test.
| v1 | v5 |
|---|---|
![]() |
![]() |


