Smart Rain Barrel

Introduction: Smart Rain Barrel

This smart barrel has a water spigot at the bottom for filling buckets and a submersible pump inside for feeding a hosepipe or other irrigation system. The pump is connected to a manifold that can feed multiple sections of the garden, controlled by solenoid valves. The pump and valves are controlled by outdoor smart switches which are compatible with all the major home automation platforms including Apple Homekit, Google and Alexa.


Many of the items for this project are available at

  • Rain Barrel
  • Submersible Pump with float switch
  • Solenoid Valve (normally closed)
  • Water-proof 12V power supply
  • Outdoor smart switch
  • Downpipe rainwater diverter kit
  • Barrel spigot kit

Step 1: Set Up Rainwater Collection

Before you start, make sure you have some means of collecting rainwater from your roof.

The best system is guttering with a downpipe. Kits for diverting water from a downpipe into a barrel are available.

Failing that, a rain chain can work. These work best when the chain is attached to the roof and hangs down a join in the roof, into your barrel.

Step 2: Build Platform

Ideally your barrel will be raised high enough to:

  1. Fill a bucket from the downspout
  2. Water beds by gravity

You should build a flat platform for your barrel. 1-2 feet should be high enough, depending on exactly what your irrigation system looks like. Since I am using a pump for irrigation, I only needed the barrel to be high enough to fill buckets. The cheapest and easiest way to build the platform is flatten the earth, put a pre-made concrete slab down (make sure it is level) and put 1-2 layers of concrete blocks on top of that.

Step 3: Prepare Your Barrel

    Make sure your barrel is clean inside. Mine came from a soft drinks manufacturer and had to be rinsed out thoroughly to get rid of all the syrup inside.

    If you are going to put a pump inside, make sure it has (or you create) an opening in the top big enough to drop the pump in. You might want to cover this opening with a solid or mesh lid.

    If your barrel is translucent, paint or cover it to keep the light out and slow down algae growth. As you can see from the photo, when I painted my barrel, I left a small tape line down the side unpainted so I could see the water level.

    Step 4: Install Spigot

    Use the spigot installation kit to install a spout at the bottom of your barrel. Try to choose a flat-ish part of the barrel so it makes a good seal. However, place it as low as possible so dirt that collects at the bottom of the barrel over time can be drained into a bucket. Hopefully, you built your platform high enough so that a bucket will fit under your water spout.

    Allow the sealant to dry overnight before connecting anything to this spigot. I recommend not connecting hoses directly to the spigot because as you pull them around the yard they may put stress on the sealed joint and cause it to leak after a while.

    Once the sealant was dried, I connected a Y adaptor to my spigot so that I could connect it to another barrel at the bottom. The other side of my Y connector is used for filing buckets. You can connect multiple barrels at the top in an overflow arrangement, but I chose to connect them at the bottom so they would behave like one single barrel with all the levels going up and down together. This is useful for my system because I have a submersible pump in one of the barrels so as long as there is water somewhere in the system, the pump will be able to use it.

    Step 5: Install Downpipe Water Diverter

    Use the water diverter kit to connect your barrel with the downpipe. Make sure the gradient between the diverter (inside the downpipe) and the entry to your barrel is not too steep. You are looking for a gentle gradient so water will flow into the barrel, but once the barrel is full it should resume falling down the downpipe.

    The diverter kit is a good place to put a filter to prevent too much solid material from your roof ending up in your barrel. Nylon hose is a good filter material for this purpose.

    I messed up my initial installation a little bit by putting my diverter kit too high. This means the barrels overflowed and I got a big puddle next to my barrels every time they got full. I fixed this by putting in a second diverter kit upside down below the first one to act as an overflow. Now, instead of overflowing onto the ground, they go down the downpipe (which I eventually plan to route away from the area, but I haven't got round to it yet). This is the reason you see two diverter kits in my photo.

    Step 6: Set Up Pump

    The pump itself is easy. It just needs to go inside the barrel and it will be ready to go once you fill it with water. However, check the following:

    • The float switch is not so long it could wrap around the pump or other items in the barrel
    • Check it will reliably switch off inside the barrel when the water level gets too low
    • Consider adding another filter here, perhaps a mash cage around the pump to keep out the bigger leaves

    Note, I didn't take photos as I went along and now my pump is in the barrel connected to all that piping. Rather than dig it out, I just found a photo of the same pump used in a different context.

    Step 7: Build Pump Riser and Manifold

    The pump comes with an outlet adaptor that will allow you to attach a hose directly to it. However, I would not recommend that for several reasons:

    • The pressure drop will be higher than necessary
    • The hose is likely to kink as it changes direction and goes over the top edge of the barrel
    • It will be hard to maintain this connection inside the barrel if it develops an issue
    • It will be hard to modify the system if you need to add to it later

    Instead, I suggest you build a riser using PVC pipe and add elbows, adaptor and a hosepipe manifold once the pipe is above the top of the barrel. This will mean you have a manifold above the barrel to which you can easily add hosepipes or drip tubes.

    The other nice thing about this arrangement is that because they are above the barrel, if they leak you won't lose all your water while the pump is off.

    Step 8: Set Up Smart Switch for Pump

    CAUTION: Check the power requirement for your pump is less than half the maximum power capacity of your smart switch. When pumps start up, they have a brief surge of roughly double the power usage so you need to allow for that. My smart switch came with a warning not to use it with pumps, but I am confident my pump is low powered enough that it will not cause a problem.

    Set up your outdoor smart switch a safe distance away from your barrel and as sheltered from the rain as possible. Try to also allow for any spray that might result from leaking connections on your pump/manifold. Hang the outdoor smart switch on a loop pointing down so any water that does get on it runs off instead of into the plug.

    CAUTION: Do not run the pump without water and do not run the pump when outlet is blocked.

    When the outdoor smart switch is set up, and the barrel has water in it you can plug the pump into the outdoor smart switch. For testing purposes, I suggest putting a short length of hosepipe onto one of the manifold outlets and pointing it back into the barrel so you can test the pump without losing water.

    Step 9: Set Up Solenoid Valves

    If you are using hosepipes with a "trigger" spray end, you can connect these directly to the manifold. They do not pass water unless being squeezed. However, take care not to run the pump with your trigger is closed, as you will cause damage to the pump. Always turn the pump off when not spraying.

    For other types of irrigation, such as drip tubes and soaker hoses you will want to install some valves. If you don't, all the water will syphon out of your barrel when not in use. If you install 12V solenoid valves, you can use outdoor smart switches to turn these valves on and off. For a "normally closed" valve, it will open when the power is on and close when the power is off.

    Set up your outdoor smart switches as you did for the pump in the previous step.

    Set up the outdoor 12V power supply with push-on connectors so they can attach to the solenoid valve. This may require some wire stripping, soldering and crimping to make a good connection.

    Attach the solenoid valve to the hosepipe manifold, taking care to observe the flow direction arrow marked on it.

    When ready to test, connect the outdoor 12V power supply to the solenoid valve (polarity does not matter) then plug the power supply into the outdoor smart switch.

    Step 10: Set Up Faucet Top-Up Valve (optional)

    If you like, you can use one of your solenoid valves to control a hosepipe that fills the water barrel if it hasn't rained for a while and level is getting too low.

    Bear in mind that:

    • You should install a non-return valve if your outdoor faucet doesn't already have one. This stops water that has been sitting in a hosepipe for an indeterminate length of time from flowing back into your house supply and contaminating it.
    • If you hook up a remote control valve to your faucet, it is possible to accidentally leave it on and flood your garden (and incur a huge water bill). I recommend setting up your home automation system so that any time this valve is opened (smart switch is turned on) it is automatically closed after 30 minutes.

    Note: This project was originally just the faucet control valve connected to an irrigation system, before I got the rain barrels and pump at my house. The first solenoid valve (seen in this photo) was meant for a washing machine and I had to buy a god-awful amount of adaptors to get it to fit my hose system. I later learned you can get solenoid valves that fit hosepipe thread directly. You need to look for valves with a "G3/4" thread.

    Step 11: Water Maintenance

    On a regular basis you should plan to do the following maintenance tasks:

    • Drop a cup of bleach into the barrel to kill unwelcome microbes. Make sure there is adequate time for the bleach to dissipate before you next water your garden
    • Clean out filters
    • Flush out any soaker hoses, drip tubes or pipework connected to your system
    • Treat separately for mosquitoes if the bleach plus mesh doesn't work
    • Consider draining or otherwise protecting your system if frost is expected
    • Drain your barrel and rinse out the inevitable slime build-up

    Step 12: Final Garden Irrigation Tips

    Now you are ready to use your smart rain barrel. Here are my final words of advice:

    • Normal soaker hoses and drip tubes are designed to work with mains water at a pressure of about 60 PSIG. This pump will deliver maybe 8 PSIG, gravity alone will get you about 2 PSIG. Use soakers and drip tubes that are designed for use with water barrels, or drill your own slightly bigger holes in the conventional ones.
    • The water is not going to be as clean as mains water, so use with care if you are growing veggies with it. In particular, bird feces from your roof could be an issue. At a minimum veggies will need to be washed thoroughly before consuming.
    • You could consider using a "first flush diverter" system to make sure the first flush of rainwater from your roof does not go into the barrel. A water shocking regime (with bleach) will also help.
    • On the plus side, if you live in an area with hard water, your rainwater will not be hard and you will not get buildup of calcium in your soaker hoses.
    • Installing a leaf filter system in your gutter will help reduce the amount of solids entering your barrel, as will the filters at various points in your piping.

    Be the First to Share


      • Pi Day Speed Challenge

        Pi Day Speed Challenge
      • Trash to Treasure Contest

        Trash to Treasure Contest
      • Sculpt & Carve Challenge

        Sculpt & Carve Challenge



      8 days ago

      I like this! I need to upgrade my garden set-up this summer, so far the barrels are just daisy-chained...