Using Machine Learning to Create an Efficient Irrigation Controller

In the United States alone, 50% of water used in residential irrigation is wasted due to overwatering. This equates to 4.5 billion gallons in wasted water each day. Additionally, large amounts of energy are wasted in pumping/delivering this water.

Overwatering results from the fact that both types of irrigation controllers that exist today, timer-based and climate-adjusting are inefficient. Timer-based controllers irrigate on a timed cycle, while climate-adjusting attempt to irrigate only on days when weather conditions are such that irrigation is required. Even climate-adjusting controllers are inefficient-on average only 15% water savings over timer-based alternatives.

Seeing these facts, the dire need for a more efficient irrigation controller became clear to us.

We proposed to create an irrigation controller which would offer water savings of greater than 30% without negatively affecting lawn growth.

We used a logistic regression algorithm which was trained to make irrigation decisions based on weather conditions and each yard’s specific water needs, rather than using the same formula for every yard as climate-adjusting controllers do. We built our controller using PHP/Arduino-C/Octave languages and Arduino hardware.

We evaluated our controller in two testing phases: pretesting period (control group), where we measured normal grass growth during an alternating-day watering schedule, and the testing period, where our controller made watering decisions. Our irrigation controller reduced water usage by 58% from pretesting to testing, without negatively affecting grass growth.

Our solution has the potential to save billions of gallons of water and gigawatt-hours of energy each year.










Slideshow Link


We are Nihar & Harshal Sheth from Westford, Massachusetts.

We have always been interested in science/technology. We taught ourselves programming in elementary school, and we are both now nationally ranked in robotics (FLL), mathematics (MATHCOUNTS, AMC)  and programming (USACO). We have always made learning a priority, whether it is by taking online Algorithms/Machine Learning courses or by attending advanced science classes at MIT.

We have come to realize the countless ways in which science can be used to change the world for the better. We admire Thomas Edison for his invention of the lightbulb to solve a major world problem. Following Edison’s example, we have a goal of using science to positively impact the world at large.

In the future, we both plan to go into STEM fields where we can continue to pursue our dream of doing research to solve global issues.

Winning the Google Science Fair would give us the coveted opportunity to present our findings to a highly-esteemed group of scientists. It would also assure us that the value of the hundreds of hours of work we put in is well understood. Most of all, it would also help us turn our work into reality, saving billions of gallons of water and gigawatts of electricity around the world. We have always dreamt of using science to positively change the world, and winning the Google Science Fair would provide us with the unbelievable opportunity to do just that.

Link to Science Awards/Honors


Problem: Existing irrigation controllers are inefficient and waste large amounts of water and energy because they are not adaptive enough to weather conditions and the landscapes which they are irrigating.

Proposal: Create an irrigation controller which provides water savings of greater than 30% compared to timer-based irrigation without negatively affecting lawn health as measured by weekly grass growth rates.

Note: We chose target water savings of 30% because this is the highest water saving for an individual household reported by any of the major surveys of climate-adjusting controllers[8].

Hypothesis: If the irrigation controller is able to adapt to the weather conditions and to the landscape it is irrigating, then it will achieve water savings greater than 30% while maintaining grass health (measured by grass growth). The controller will be able to adapt to each landscape by using a logistic regression algorithm trained to historical weather data labeled with correct daily irrigation decisions for that landscape (more information on the Research & Method pages). The hypothesis will be shown in the results through a decrease in the amount of water used from the pre-testing period to the testing period without a negative effect on grass growth.


We researched various existing irrigation controllers to understand why they are inefficient, and then crafting our solution to improve upon their shortcomings.

  1. Timer-Based Irrigation Controllers: Timer based irrigation controllers are used by over 90% of homeowners because of their low cost. However, these are the most inefficient because they don’t adapt to changing weather conditions. Therefore, they are normally used as benchmarks to compare more efficient controllers against. Over 50% of irrigation water is wasted, and this can amount to trillions of gallons of water per year[1]. In addition, gigawatts of energy are wasted in pumping all of the water from public supplies to households. This overwatering also leads to other issues, such as lawn disease, thatching, and sogginess[2].

  2. Types of Climate-Adjusting (Smart) Irrigation Controllers: The following two types of smart irrigation controllers have been developed in response to the shortfalls of timer-based controllers[3].

    1. Soil moisture based irrigation controllers (SMCs) use soil moisture sensor networks to determine irrigation timing. SMC sensors must be embedded in the turf at multiple locations around the yard. Whenever the soil water content goes below a pre-programmed threshold, irrigation begins[5]. SMCs use a single, predefined threshold to make irrigation decisions.

    2. Evapotranspiration based controllers make irrigation decisions based on the reference evapotranspiration value (ET). The ET estimates the total amount of water that evaporates and transpires from a specific area based on multiple weather parameters in the area. The ET is most commonly computed using the Penman-Monteith Equation[6]. However, this formula can not be adapted to the needs of individual landscape[4].

Current Issues:

According to the EPA, water savings for homes using smart controllers range from 6% to 30%, and average savings are less than 15%[8]. The California Survey[11], the Florida Survey[12], and the USBR Survey[7] have arrived at similar results. The low savings resulted from the fact that smart controllers use same thresholds and formulas for each landscape even though each landscape has different water requirements in different weather conditions. The lack of adaptation to each landscape limits the controllers’ water and energy saving potential[9].

Shaping Our Approach:

After discovering the problems with the existing solutions, we realized that decision-making must be tailored to each landscape individually in order to increase water savings. We also realized that the homeowner himself would have the best knowledge about his/her lawn’s water requirements.

We found that a machine learning model would solve both of these problems. Machine learning (specifically Logistic Regression) has the ability to learn how raw data and decisions are correlated to mimic the decision making process with a formula. In our case, the raw data was historical data, and the correct watering decisions were given by the homeowner. The model then learns the optimal formula and parameter weights for mimicking the homeowner’s correct irrigation decisions. The model is now adapted to the landscape through the homeowner’s informed watering decisions. After this training, the model will be able to make its own landscape-specific irrigation decisions.


Model/Controller Design and Implementation

  1. We wanted the combination of weather parameters that would result in the most accurate model. We created multiple models and evaluated each model against an evaluation dataset. The best performing model would be used in the live testing. This process will be explained in the next three steps.
    1. The models used combinations of past, present, and predicted parameters as well as computed weather parameters (i.e. total precipitation in last three days).
    2. We, simulating the homeowner, classified each day in the training and testing datasets with the correct watering decision. To ensure fairness, all the models would be trained and tested using the same weather data and classifications.
    3. Train each model using the following method:
    4. After training each model using the training data, we evaluated their effectiveness at making watering decisions using the evaluation dataset. We found that the model with the following set of parameters and weights performed the best on the testing dataset. Following is the parameters and weights of this optimal model:
    5. Below is the training data and classifications for the model that performed the best on the testing dataset:
    6. Below is some of the Octave code we wrote to train the LR model:
  2. Add a constraint logic to not water on two consecutive days to comply with local town regulations.
  3. Create a PHP script to process weather data and compute derived factors as follows:
  4. Build the irrigation controller hardware according to following block diagram:
  5. The finished irrigation controller wired to the sprinkler solenoids is shown here:
  6. Program the irrigation controller using Arduino C-style programming language:

    1. Program Arduino Uno controller to access web page hosting the PHP script at 3:00 AM each day and receive watering decision

    2. If watering signal is positive, raise digital I/O pin output to HIGH for 30 minutes (it is configurable) for each individual solenoid (zone) in sequence to go through the lawn irrigation cycle

Live Experimentation:

NOTE: All experimentation was done using our lawn. Our lawn is Bermuda grass. Our experiment didn’t require any dangerous tools or equipment, and was safe

6. Begin three week-long pre-testing period on 7/14/13 in which the lawn is watered every other day (odd/even days) for a full cycle. We chose every other day watering cycle for comparison since in the area of the country we live in the (the northeast), odd/even watering day is adequate over the summer. Each week, we: recorded grass height just before lawn mowing (lawn mowing cuts grass height to 2 inches, from which growth can be measured)

7. Begin testing period on 8/5/13, allowing Arduino controller to automatically execute on irrigation decisions from PHP script. Watering stats and weather conditions were automatically logged by the system, and we measured grass growth weekly in the same exact way that we did in the pre-testing period. End testing period 9/29/2014.


We compiled the grass growth and watering data from the pre-testing period (control group) which was from 7/14/2013 - 8/4/2013 as well as from the testing period (experimental group) which was from 8/5/2013 - 9/29/2013. We chose to end the testing period on 9/29/2013 due to the increasingly cold weather and increasing number of overnight frosts in the area.

During both periods of testing, the lawn was irrigated in a 2.5 hour cycle - 30 minutes for each of the 5 zones. Every zone contained 4 sprinkler heads, each using 4 gallons per minute. During the pre-testing period, we irrigated 11 out of 22 days (50%). During the testing period, our controller irrigated 12 out of 56 days (21%). Therefore, our controller achieved a 58% reduction in irrigation water usage compared to a typical alternating day irrigation schedule.

A chart summarizing the day-by-day irrigation decisions is shown below:

The relative weights of each of the factors in the logistic regression formula (derived through training) are shown below:

A table displaying the logistic regression algorithm outputs for each day alongside the weather conditions on those days is shown below:







In order to ensure fairness in the experiment, we analyzed the weather differences between the pretesting period and the testing period:

Overall, precipitation and cloud cover decreased from the pre-testing period to the testing period, as shown by their negative-sloping trend lines. Since lower precipitation and cloud cover increase lawn water needs, the weather in the testing period was less conducive to lawn growth. However, the model was still able to reduce water usage without causing lawn health deterioration. This means that weather conditions, which were the only uncontrolled factors between the pre-testing and testing periods, did not favor our model and it can be concluded that the experiment was fair.

No significant change in the health of the lawn was observed. We measured the health of the lawn by using weekly grass growth data collected as an average of grass growth at 6 distinct points in the lawn. The grass growth over the pre-testing period as well as the testing period is shown below:

The average weekly grass growth during the pre-testing period was 0.707 inches/week, while the average grass growth during the testing period was 0.738 inches/week, despite weather conditions that were less conducive to lawn health. The standard deviation of grass growth in the pre-testing period was 0.061 inches while it was 0.208 inches in the testing period. The grass growth was slightly more volatile (on the order of 0.14 inches in standard deviation difference) in the testing period, but it is mostly upside (higher grass growth) rather than downside volatility.


Results Summary:

Our controller reduced water usage by 58% without deterioration in lawn health (0.707 inches/week grass growth in pre-testing, 0.738 inches/week during testing period), despite less favorable weather conditions in the testing period.

Hypothesis Confirmed:

We hypothesized that it would be possible to build an irrigation controller which would provide water savings of greater than 30% from the regular every-other-day timer-based system by using a novel implementation of machine learning techniques to process public weather data. It turned out that using a logistic regression algorithm to learn under which conditions to irrigate the lawn led to far more accurate modeling of grass water needs, and therefore, far greater water savings. The 58% reduction in water usage garnered by our system far surpassed the 30% goal.


The major limitation in terms of our experiment design is that we were unable to test on more than one lawn (low sample size). To increase the sample size and to gain a better understanding of our system’s performance in a variety of situations, we are working to pilot test the controller at 10-15 houses across the town. However, it is likely that the controller would produce similar results at other households due to the separate machine learning approach.

Future Work:

We are currently working on several next steps:

  • As explained above, we are working to begin a larger scale pilot test of our controller throughout our town.

  • We plan to implement self-reinforced learning into our logistic regression training. Rather than just training once for each household, the homeowner would be able to correct the algorithm at any time. The algorithm will be able to continually learn and re-train itself, allowing the system to increase its accuracy and savings in real-time.

  • We are looking into increasing the scope of our system to see if it can be applied in other areas, such as commercial farming.


NOTE: all of the following calculations follow the format of the calculations done in the EPA WaterSense Survey[10]
The following three-slide presentation sums up the impacts. If it cannot be viewed here, please view at this link:











This research highlights a novel approach to climate-adjusting irrigation control by using a logistic regression model to process public weather data and make irrigation decisions in a more accurate and cost-effective manner. This makes intelligent irrigation control much more economically appealing to the general public, and has the potential to save billions of gallons of water and hundreds of gigawatt-hours of energy.



We would like to thank our parents for their endless support and encouragement. They also bought the parts necessary to create the controller and allowed us to use the yard for testing.

We would also like to thank our science teachers, Mr. Wayne Kotary and Mrs. Maureen Severo, for reviewing our project and providing excellent feedback and support.

The machine learning used was based on what we learned in the online Machine Learning course that we took.

The Data:

The complete weather data can be found at This data is collected by the National Oceanic and Atmospheric Administration (NOAA) weather stations and is published on a daily basis. This project used the data from the Bedford, Massachusetts weather station. The data is from the months May to August in the years 2011, 2012, and 2013. Explanations of the labels on the data can be found at


[1] (EPA)

[2] (American Lawn Guide)

[3] (University of Florida)

[4] (University of Florida)

[5] (University of Florida)

[6] (Food and Agriculture Organization of the United Nations)

[7] (United States Bureau of Reclamation)

[8] (EPA)

[9] (National Public Radio)

[10] (EPA)

[11] (California Urban Water Conservation Council)

[12] (University of Florida)