Electronic Float Valve Keeps The Horse’s Feet Dry

[Bob] built this simple device that can best be described as an electronic float valve. He was wasting a lot of water from overflowing water troughs and buckets around his farm. He would usually put the hose in the container, turn on the water valve and carry on with his work. By the time he remembered to come back, the area would be flooded. It’s obvious that there’s many different ways to solve a problem. For example, a simple mechanical float valve might have worked, but it’s not horse friendly and liable to get damaged soon.

The electronics is unabashedly minimal. An ATtiny85 controls a relay via a common variety NPN transistor. The relay in turn switches the solenoid valve. A push-button tells the microcontroller to start the water flowing, and when the water level gets high enough that it touches two hose clamps, the micro shuts it off again.

There’s some ghetto engineering going on here. The electronics is driven by a 9V battery, although the relay and the solenoid valve that [Bob] used are both rated for 12V. He’s not even using any sort of voltage regulation for the ATtiny, but instead dropping the voltage with a resistor divider. (We wonder about battery life in the long run.)

He built all of it on perf board and stuffed it inside a small enclosure, with two wires coming out for the level sensor and another two for the solenoid, and it seems to work. Check the video below where [Bob] walks through his build.

While some may point out the many short comings in this build, [Bob] found the one solution that works for him. Sometimes the right solution is what you’ve got on hand, and we’re glad he’s hacking away and sharing his work. And check out this wireless water level sensor that he built some time back.


31 thoughts on “Electronic Float Valve Keeps The Horse’s Feet Dry

  1. I think it’s great that people are forging ahead with innovative builds. My only concern is that they fail in ways that are not detrimental to the intended usage. I assume this is a NC valve at least so if the battery fails, it defaults to not flowing water. Can the water sensor build up debris and no longer detect the water being present that would normally instruct it to turn off? Is there any kind of timeout involved if that happens? Could one be added given it is using an ATtiny85 and has roughly 5 pins to work with?

    How tolerant is all of this to getting wet, given it is used to dispense water?

    Sounds like a good start and a decently low cost, bare bones hack. Are there COTS products that do a better job and might be less hacking oriented but at least would solve the problem quickly?

    1. Yes. There are plenty of COTS products. I was looking at Chicken water heaters at the Local Animal Products/Quick-E-Mart/McDonalds/Gas Station/Hardware/Farm Supply Store (we’re small town America in these parts) and noticed several of these in the Horse/Cattle section. There are actually systems like this for Chickens (a lot are gravity feed and manual shutoff valves, kinda like a toilet) as well and I may have to integrate one into the new chick coop next summer.

      Can’t tell from the build, but I would think an irrigation valve would be the preferred method here (like for sprinkler systems). The issues is that most sprinkler valves are 24VAC and are a bit more complex. I have a little battery powered timer for lawn watering and it stays closed with dead batteries, so this is probably using a similar solenoid (also thinking about building an automated garden watering system that uses soils sensors and rain detection to adjust watering scheduled automatically).

  2. I made a similar device to fill a tank of water in a cool room. A mechanical device is difficult to position to choose the water lever while an electric wire hanging in the tank as a sensor is much more pratical. I used just a op amp (lm358) a transistor and a relay. After long time the copper of the wire corrode and the sensor will fail, better to use stainless steel contacts.

  3. A mechanical float value like they’ve been using for 50 yrs might get damaged but this electronic one won’t? A lot of over engineering going on here. Could put one of these in every toilet too, but why reinvent something that works perfectly fine and is a lot simpler?

    1. There’s a fix for that. The water tank for our house has a similar electronic switch that controls the well pump to fill it. There’s a third electrode, which would go further down the pipe and then the middle electrode would go down closer to it. So when the middle electrode is exposed the circuit is broken and the valve opens again to top off the tank, then when the top electrode is covered the valve closes as it does now. All electronic, no push button needed, so you can seal the box against the elements.

      1. Oh, I misunderstood what you were saying. I thought you meant the push button being exposed to the elements. To protect the electrodes you can just cover the pipe. Plus it needs a continuous circuit, which raindrops or snowflakes wouldn’t give you. If it’s raining hard enough to interfere with the sensors you probably don’t need to fill the tank :-)

    1. Neither does my housemate. Most of the lights are now under Zigbee control, the food database is in progress and we’re even computerizing the beer. The toilets are apparently non-negotiable. Oh well, I tried. Guess Japan is still leading the Waste Race.

  4. I like the portable aspect of it and being adjustable if you move the sensors up and down to what you need.
    As you are using an ATTINY85 you could just add a fail safe timer.If the electrode switch fails the valve is always closed after X seconds of operation. It would just limit any flooding.

  5. Why have a water level sensor at all? Just have it be a timer. Each push of the button will fill for X time which converts to Y inches of water for a given bucket. You may put vertical marks in the bucket at a spacing of Y. Then you just count the lines above the water level and push the button that many times. A failure in the water level sensor could still result in flooding especially if you come to depend on this device to turn off.

  6. I’m surprised it’s a one shot program. He could just build a few of these and have the firmware on the dev board (yes I call it firmware) wait about 30 seconds and read the input for continuity. This way he could leave the pipe in place and as the livestock or evaporation remove water, it will auto refill. If he’s going to over complicate the design with a micro controller, he could at least make it do something useful besides be a glorified 555. Hell he could do the same thing I described with a 555 but this way it doesn’t keep cycling the relay on and off, which could slowly add residual water to the point of flooding.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.