Solar Powered 'Smart' WiFi Controlled Irrigation System




Introduction: Solar Powered 'Smart' WiFi Controlled Irrigation System

This project makes use of standard DIY solar and 12v parts from ebay, along with Shelly IoT devices and some basic programming in openHAB to create a homemade, fully solar powered, smart garden power grid and irrigation setup.

System Highlights:

  • Fully solar powered system (day and night)
  • 3 zone irrigation system (can be more!)
  • Fully wifi controlled, with Google Home/Alexa integration using Shelly RGBW2 devices
  • 'Smart' Irrigation, use set automatic watering system, with links to weather API to check recent rain fall.

Why this design?

1) I was looking at irrigation systems for my vegetable garden and found that they were either very expensive, or fairly limited in function (just on/off at a set time for a single hose).

2) My garden is really long and there is no external power, so setting up a solar powered 12v garden grid from my shed seemed like a fun (and safe!) idea to get power all over the far end of the garden)

3) I've been playing about with Shelly devices and OpenHAB and thought it would be fun to see what i could achieve!


Solar System:

  • Solar Panel (120W)
  • Battery (130aH leisure battery)
  • Solar charge controller (30A)
  • 12v stabilizer
  • Cabling

'Smart' Irrigation System:

  • Waterbutt / Water supply
  • 12v DC water pump
  • 12v Solenoid valves (3x = 1 per irrigation zone)
  • Waterproof housing
  • Irrigation hose, connectors and hose
  • 5-Core cable
  • Shelly RGBW2

(+standard items like tools, cable connectors, hoses etc. as required!)

It is possible to complete many of the functions in the project using the Shelly app, but for more advanced automation logic on the irrigation i have been using OpenHAB.

Step 1: Solar System Setup

This step is just a quick explanation of my setup, there are many good guides on how to best setup a DIY solar system and the main objective of this Instructable is the 'Smart' garden grid and irrigation system! (This step is also optional, you can power the whole system via a mains powered 12V transformer if you have easy access to a power source and don't want to use solar.)

I used a 120W solar panel (eBay or Amazon), a 130aH leisure battery (can use smaller capacity, but recommend using a leisure battery over a normal car battery due to cycle use of a solar system such as this) and a 30A solar charge control unit. You can go for a smaller Amp unit, but the cost difference is very minimal and when drawing power at 12V, the Amps can soon climb!

The solar system itself will output a range of voltages (documentation with my model says 10.7V to 14.4V depending on the battery charge level and solar input). The Shelly devices used in this project are reasonably voltage sensitive and need a steady 12V supply. To achieve this you'll need a voltage stabilizer, easily available on eBay. I got an 8V-40V input to 12V output capable of carrying 10A. 10A was the largest stabiliser i could find in this voltage range, so will only be able to draw 10A at a single time via this connection. It is always possible to connect a second stabiliser later to provide another 10A power supply.

I did a quick test setup on my garden table to ensure everything was working OK before installing. I checked the voltage output of the solar controller and it was indeed ~13.4V. Once the voltage stabiliser was connected i rechecked and it was 12.2V - suitable for the Shelly RGBW2 and i connected it.

The Shelly powered up immediately and I was able to configure it to my WiFi and tested it's response - my first Solar Powered IoT device!

Once it was all tested and working, i took the setup apart and moved the components to my garden shed for full installation.

I built a basic frame to hold the solar panel at 40 degree angle (most efficient is south facing at 40 degrees elevation at my location - check online, there are many calculators to get the best angle for your locaiton!)

Step 2: Smart Irrigation - Irrigation Valve Housing

The first step for creating the automated smart irrigation system is to create a valve control system.

The valves I used for this project are basic, normally closed, 12V DC, 1/2" Solenoid valves. These are easily obtainable from eBay relatively cheaply. Different dimensions are available also. I used 1/2" as there are many different standard irrigation system components that can be used with this size valve/tubing. The valves come with a standard 1/2" screw thread on each side, so you will need appropriate fittings to suit the type of hose/irrigation tubing you want to use.

As the electrical components of the valves are not waterproof, you need a water proof housing. I found that the Schnider Electric 12-entry junction box (195x165x90mm) was the perfect size to fit the 3 valves i wanted to use, plus the 1/2" screw on adapters for the 12mm irrigation hose i have.

I am running the water flows horizontally across the box, with power/control cable entering via the bottom of the junction box through a weather proof glad.

Step 3: Smart Irrigation - Connecting Valves to Shelly RGBW2 Controller

Each valve has 2 spade terminals. On the valves I am using there is no polarity difference, so I can connect positive or negative to either terminal. No power, valve is closed. Power on, valve is open.

(Note, for the build/testing of this part of the system, i used a standard 12V DC transformer (old LED driver) so that i didn't have to keep going out into the garden and connecting to the solar power supply to test it).

Terminate 3 of the cables from the 5-core cable coming into the box with appropriate sized spade connectors. (In the example photo, brown, black and grey are used for this). One cable (blue in the photo) will be used as the common +ve, so terminate one cable into a suitable multi-cable connector (I used a 5 terminal Wago 221).

The Shelly RGBW2 must be set to 'White' mode (under settings in the Shelly control screen). This effectively means that the Shelly is operating as 4 separate 12V DC (dimmable) relays.

The power source and Shelly should be somewhere away from the water in a safe (dry) location and the connection made to the valve housing using the 5 core cable (mine is about 5m long, going from shed to vegetable patch). The Shelly is inside a small weatherproof junction box inside my shed.

Connect the power as per the attached diagram and it should look something like in the photo. Note, the spare cable and space on the 5-terminal Wago are for connecting the pump.

Step 4: Smart Irrigation: Connecting the Pump

The next step is to connect the pump. For my setup, i connected the pump via the valve housing as i used the main 5-core cable to get the power out from the shed, but you could easily connect the pump separately if that is more convenient.

I used the highest flow 12V pump i could find on ebay (1000L/h), but there are many options available. (I have several pumps connected to Shelly RGBW2 now and found that some pumps only work ON/OFF at 100%, whereas others you can control the flowrate using the Shelly dimmer function. This is not important for the irrigation system as you just want 'max' flow, but it may be important for a water feature etc).

Note, unlike the solenoid valves, pumps ARE polarity sensitive, so you need to ensure you connect the +ve and -ve supply the correct way around.

Once this is complete, the pump needs to be connected to the inputs of each valve and each valve give an outlet from the box (so you don't flood the box when testing!).

You can test the valves without any water by turning them ON/OFF in the Shelly RGBW2 interface. You should see the power consumption going up to ~10W when they are open (ensure the 'dimmer' is set to 100% before turning the channel on, they don't seem to like anything but 100%!). If you have wired up the Shelly RGBW2 as shown in the wiring diagram, channels 1-3 should control the valves and channel 4 the pump.

The image shows me testing the system using a bucket in my bath to circulate the water around (the pump is the red thing in the bucket).

Final image shows how I have connected this setup to my water butt for water supply.

Step 5: Smart Irrigation: Connecting Shelly RGBW2

All the cables from the system need to come into a dry area (with wifi connectivity!) where the Shelly RGBW2 can be housed.

The cables should be connected up to the Shelly as per the wiring diagram. I opt to use a static IP on all of my Shelly devices as it generally makes the connect more stable.

Step 6: Smart Irrigation: Control System

Now that the system is setup, there are various ways you can choose to control your system and various levels of how 'Smart' you want it to be!

Basic: The most basic way to control your system is via the Shelly App and native integration with Google Home or Alexa. In the app you can setup standard schedules for each of the channels (Pump, Zone 1, Zone 2 etc) and also connect these to voice control if you so desire.

Advance: The Shelly App also allows you to create 'Scenes', you could setup various 'scenes' that run through different watering patterns at different times of day etc. There are many options within the app... get creative!

Really Smart!

I decided I wanted to go one-step further. I am already using OpenHAB to control most IoT devices in my house, so i setup my own Irrigation system control using OpenHAB. I have attached the basic .items .rules and .sitemap files to this Instructable to assist if you would like to setup something similar.

Overall features:

  • Full automatic and manual control from dashboard page.
  • Google home integration - "Hey Google, Start Irrigation" . - See video.
  • Weather integration - I connected to the OpenWeatherMap API to check the total rainfall for the last 24 hours and if it has rained more than 10mm, the irrigation cycle is not run automatically
  • Irrigation can occur at a set time each day, or variable with sunset/sunrise etc.
  • System calculates how much water will be used for each irrigation cycle (important if you are using water-butts collecting rain water like i am!
  • Push notification to your phone to alert you when the automatic irrigation is about to run.

Be the First to Share


    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge
    • For the Home Contest

      For the Home Contest
    • Make It Bridge

      Make It Bridge



    1 year ago

    Very interesting and well structured. Guess the Shelly RGB is only used to drive the four valves with single device since variable voltage has no effect on electrovalve, right ? In the description is stated "To take it a step further, add Shelly Uni in a dry place with 3 sensors- temperature, humidity and moisture." I'd like to know how to measure humidity with UNI, I've tested several probes but humidity has not been implemented on UNI. If you discover how to, please post. Last question is how you implement the graphical interface, very clear and keen, well done !


    1 year ago

    This is a great post, I was working on something similar using Shelly and HA. I was planning to also integrate with soil moisture sensors (vegtrug-flora-plant-sensor).


    Question 2 years ago

    How long are your cables? As far as I know you can not go too far with 12v.

    My valves will be at 100 meters from the shed (where I want to put the shelly). I think 12v or 24v will not work for so long cable, isn't it?

    I am searching for 220v valves


    Tip 2 years ago

    If you'd like to see a video run through of the irrigation system (and also some additional things i have running off my solar system!) then you can view it here:


    2 years ago

    is Shelly expensive?


    Reply 2 years ago

    I think they are reasonably priced. The most basic 'Shelly 1' (1 240v / 12v relay) is 10.90euro. RGBW2 (4x 12v relay) is 17.90 euro. You can purchase direct at . There are local resellers, but i always brought mine direct!