

- #Opensprinkler power raspberry pi how to
- #Opensprinkler power raspberry pi code
- #Opensprinkler power raspberry pi free
If you choose to run the script from the terminal, type sudo python rain-bypass.py Launch IDLE IDE as a superuser by typing sudo idle into the terminal. Remember, to access the GPIO pins with your Python script, you will need to run Python as a superuser.
#Opensprinkler power raspberry pi code
You can download the python source code for the program here. Build Itįirst you will want to build the circuit according to this diagram:

Make note of this key, as you will need to add it to the python script. STEP 3: Developer - this plan should allow you to ping for weather information up to 500 calls per day, and up to 10 calls per minute.Īfter doing so, you will have access to your wunderground API key.STEP 2: History add-on - sure, why not, we may want to use this later.STEP 1: Anvil plan - this will grant us access to hourly 10-day forecasts.Go to this site, and sign up for an account.Ĭhoose the following settings when you sign up:
#Opensprinkler power raspberry pi free
It is free to become a member, and you will be able to access weather data up to 500 times a day, which is way more than we would ever need for this project. Signing-Up For a Free Weather API Account:īefore you can access live weather feeds from, you will need to sign up to become a member of their weather API program. An irrigation controller with a rain-bypass option.1 - 2n2222 transistor or similar (I used an NTE NTE123).1 - 3v relay switch (I used a Goodsky RW-SH-103D).A Weather Underground API developer account.Raspberry Pi with active internet connection and GPIO library installed.
#Opensprinkler power raspberry pi how to
The system will provide notification that the system is enabled/disabled/not working even when it isn't plugged into a monitor. You will construct a simple circuit that will disable your irrigation controller when it rains.You will learn how to create a configuration file to save the settings of your program even when your RPi is reset.You will learn how to access weather forecast information using the Weather Underground forecast API.Using Python code, we can combine internet connectivity with the ability to control IO to make the project behave however we want. We can use the GPIO pins and a relay to break the continuity of the rain sensor contacts. We can use its network connectivity to get current local weather conditions, forecasts, and even weather history. These shortcomings can be readily solved with a RPi. I would like to have more control over how long it takes before my watering schedule is re-enabled. After rain, my soil is still extremely saturated with water after 2-3 days, and certainly doesn't need to be watered again. In my particular case, the cork discs seem to dry out after 2-3 days and then watering commences. With most rain sensors, you cannot control how long to wait before the watering is re-enabled.Would you waste 200 gallons of water on your garden today if it were going to rain tomorrow? You may have just finished watering your garden minutes before it starts raining. The bypass will only disable the watering after it has rained, it cannot predict rain.The watering is enabled again when the discs dry-out and contract, releasing the switch. When it rains, the discs swell-up with water, depressing a switch which disables the watering. My particular rain sensor works by using absorbent cork discs to detect moisture. The problem with rain sensors lies within how they are engineered. So if a solution to this problem already exists, why go through all the trouble of creating a 'custom' rain bypass? A Better Solution When the continuity is broken, the irrigation will immediately disable all solenoid valves in the sprinkler system. When there is continuity between the two contacts, the watering will commence normally.
