Pinging the Depths of a Rain Barrel

Rain barrels are a great way to go green, as long as your neighborhood doesn’t frown upon them. [NikonUser]’s barrel sits up high enough that he has to climb up on an old BBQ and half-dangle from the pipe to check the water level, all the while at the risk of encountering Australian spiders.

Arachnophobia, it turns out, is a great motivator. At first, [NikonUser] dreamed up a solar-powered IoT doodad that would check the level and report the result on a web page. He battled the Feature Creep and decided to build a handheld device that pings the water level with an ultrasonic sensor and displays it on a 7-segment.

Everything is contained in a water-resistant box and driven by an Arduino Pro. The box is mounted on a piece of scrap lumber that lays across the top of the barrel. This allows the HC-SR04’s eyes to peer over the edge and send pings toward the bottom. It also helps to keep the readings consistent and the electronics from taking a swim.

Operation is simple: [NikonUser] reaches up, sets the plank across the barrel, and pushes the momentary. This activates the Arduino, which prompts the HC-SR04 to take several readings. The code averages these readings, does a little math, and displays the percentage of water remaining in the barrel.

Interested in harvesting rain water, but not sure what to do with it? You can use it for laundry, pour it in the toilet tank instead of flushing, or make an automated watering system for your garden.

49 thoughts on “Pinging the Depths of a Rain Barrel

  1. Rain barrel WTF everyone knows its a rain tank :roll eyes: Yanks.. I dont know ;-)

    my tanks could use something like that – with an remote readout would be good :)

    1. I think they’re called cisterns, you insenitive clod! ;-)

      Not sure where others have seen them but in the US the above ground ones look like Whiskey barrels. In NY city, where I grew up the tanks were huge and weren’t capturing rain water. Growing up every TV Western town had barrels. ;-) The trains had the tanks.

      1. In Colorado until very recently it was illegal to capture the rainwater coming off of your roof unless you owned the water rights to the bit of land your house was on. You couldn’t slow it down any by using a rainbarrel to divert it to a garden, you had to let it flow free to the real “owner”.

      1. A butt is a unit of volume of half a tun, or four hogsheads, or eight barrels. Approximately 125 gallons or 475 liters.

        Since it’s a container, you could refer to a container that size as one. Since it’s not as common as a barrel, it hasn’t become the name of a type of container itself.

  2. You could save yourself the climb and just install a pressure cell off a connection at the bottom of the tank. Get one that measures in inches of water column (“H20). Or, if you do not need the reading to be recorded, just a good old fashion sight glass.

    1. yeah, but it’s non-optimal to drill a hole below the water line. if that hose deteriorates or whatever, all da water gone.
      plus, clear tubing invites mold and general ichy-ness.

    2. yeah, but it’s non-optimal to drill a hole below the water line. if that hose deteriorates or whatever, all da water gone.
      plus, clear tubing invites mold and general ichy-ness.

  3. You could also use a clear plastic tube (like aquarium air tube) coming off the bottom of the barrel. Just securely hang the other end up towards the top, and you’re done! Personally though, I’m a fan of the HC-SR04 sensors. I use one in my water softener to keep track of the salt level and use either Domoticz or Node-Red to alert me when it’s low.

  4. this is a doubly cool project cause it’s actually functional useful and also a really great Arduino project that’s easy to get your head around.
    i did something similar for my 2, 10 foot tall well water tanks. they can run low in the summer/fall and i want to know when the well is struggling before that happens, so this thing monitors how much water in there and also how long it takes to fill the tank up, indicating how much water is in the ground.
    also monitors well pump current and water temps etc. data is presented on the web and very informative.
    i can monitor whole house water usage and notice if there is a major leak in the system.

    1. Could you ad something like a piezo element glued to the pump body and “listen” for cavitation? this would tell a lot about the water flow. Having grown up with a well, I was familiar with that moaning growl from the pump when the water was low.
      Nothing to do but stop water usage till the well recovered.

      1. it seems quite common to use well guardians these days that monitor the pump current draw and it notices when the current suddenly changes because it’s not lifting water any more. have sensitivity adjustments on them for that and for how long to stay off before trying again. really protects the pump and greatly helps get the most of the the well under difficult conditions.

  5. I’ve done the same thing using the innards from a tire pressure gauge in the top end of a PVC pipe (sealed at the top). Turns out those sensors are quite sensitive and I could measure fractions of an inch of water in the container.

  6. Something that floats, a piece of string and a weight. Connect the floating thing with the weight using the string. Put the floating thing in the barrel and the weight outside.

    1. yeah, good idea too. i have that as a passive measure on my 10′ tanks. basically a block of wood painted red on a string hanging down the outside with a pulley at the top. inside is a sealed plastic jug with enough sand in it to lift the block as the water sinks, but not so much as to sink. i can see it from my house 350′ away, and pretty fail-proof.

  7. I am myself working on a project to get depth of a well and throw a warning when water is too high.
    I used the same ultrasonic component but the thing quickly died because of humidity.
    Bought a new component that is said to be waterproof and things seem to be better.
    I’m still struggling / fighting with powering the esp8266. It doesn’t seem too stable (also deepsleep wise, it doesn’t always work….)

  8. Speaking of spiders, I’d fear (not in the same way, but still) that one might build a web right in front of the grills of that ultrasonic transmitter or receiver. And then you’d have to get in there and investigate that… O.O

  9. Nice project. But, he had to climb to check the water level now he has to climb to push the button? What about spiders?!
    I’d suggest one simple improvement, replacing push button with microswitch, and attaching the piece of string that can be pulled from ground level. That way those spiders will be kept on a safe distance. Although some would consider Europe a safe distance when it comes to Australian spiders.

  10. Had the same issue in an off-grid homestead, and everything I tried corroded or failed in < 1 year. Now have a real working setup. Use Ti wire (McMaster-Carr). One wire along the bottom of the tank (al wires come in from the top). This one you drive with 12v square wave from a 555 – 40khz but frequency not critical, .1uf coupling cap, no DC.
    Now, have other wires coming down from the top, to various levels. Each goes into a cap coupled volt doubler with around 100k load, and into an arduino input pin.
    No dc current through the sensor wire, no electrolysis, no corrosion. In my case all wires in holes in the top of a big farm-grade tank. I only use 4 levels as more than that makes the graph pretty but is no other use. I also have a flow meter (Adafruit) on the output and plot that for grins.
    Got the idea from a '70s National semiconductor app handbook. Has worked around 5 years now, seems like it'll go forever.
    Here's some info and pix:

    1. That only makes things more complicated. Sight tube + raspberry pi + openCV + some kinda neural network to interpret the data?!?! You could do it with a simple ultrasonic sonar unit.

      (Yes, I’m kidding.)

      Seriously, if you’re interested in logging the data, the sonar is probably the easiest/cheapest. Logging the height of water in a sight tube would bore me to death after day one.

  11. Cough … cough …

    Rain water tank connects to garden hose.
    Garden hose is held by hand.
    End of garden hose is lifted to such a height water no longer pours out.
    Bingo! That is the rain water tank level.

    You are welcome.

    (Mind you, with electronics is so much more fun !!!)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s