Raspberry Pi Irrigation Control – Part 3
In the past two Raspberry Pi Irrigation Controller Tutorials we have assembled the board, connected the Pi, added sensors, and tested all of the components. In the third part of this four part tutorial we are going to figure out how to write a program that will run our sprinklers, monitor a few of our sensors, and email us once it has finished running. We will also figure out how to schedule this program so it only runs when we want it to – what good would a sprinkler system be if it can’t follow your watering schedule! There are several different ways to approach this on the Raspberry Pi and we will go into the design logic and reason for our choices in this tutorial as well as writing the code.
Before we get started, you should have completed the previous two sections of this tutorial. We are going to start by setting up a Gmail account to send our emails and then it is straight back to coding as we will have to modify our Python program. We want our program to operate the sprinklers for the correct duration, read the sensors, and email us once it has run. After that we will look at how to schedule it to run at the right time on the right date. As always, we will break it down into a bunch of easier steps to get through this!
If you have any questions, or need further clarification please post in the comments section below; this way future users of this tutorial can see the questions and answers!