[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.
He could have used a 555!! Cool tho – avr adds opportunity for expanding features.
He could have used an Amazon Echo!!!! Then his horses could talk to the water tank.
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?
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).
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.
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?
I should hope you don’t have horses in your toilet.
The horses play with the float valve, not specifically to break it, but they usually manage it anyway.
It can’t be beyond the wit of man to put a guard round the float valve, or construct it in a way that can’t be horsed around with…
You haven’t owned horses………
read my mind
Great work. Only problem is that the switch off is exposed to elements. If there is a rain or snowy situation the switch off can happen prematurely due to the circuit being completed through a water from rain or moisture from snow.
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.
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 :-)
Ever heard of hardware cloth, fence wire, or some type of grill covering over the valve float. Toilet valve!
I don’t want a wired toilet for sure.
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.
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.
Good grief, they make horse waterers that have protected floats:
https://www.valleyvet.com/ct_detail.html?pgguid=8880817a-2fcf-4ff7-8fbd-aba02e7f8464&sfb=1&itemguid=bd11b3d5-182e-4550-ace5-c2c225769400&utm_content=10111&ccd=IFM003&mr:trackingCode=58EBA264-3C81-E211-BA78-001B21631C34&mr:referralID=NA&mr:device=c&mr:adType=plaonline&mr:ad=43741505443&mr:keyword=&mr:match=&mr:tid=kwd-84506322523&mr:ploc=9032826&mr:iloc=9032951&mr:store=&mr:filter=84506322523&gclid=CjwKEAiAvPGxBRCH3YCgpdbCtmYSJABqHRVw56EQKU685bwfkkDY5RVrgcDucKJuTH3O5tkZs9T7dxoCzn7w_wcB
Why should an existing product stop anyone from trying to make one of their own design?
Yes you are correct they make protected float valves. Doesn’t do you any good until you have a horse or a head of cattle rip that hose out. BTDT.
You can protect the hose just like the float.
Yes, you can buy $10 worth of components for only $32.
This is an excellent hack. Why pay $32 when you have everything you need sitting in your junque boxes already?
Because it does not need batteries.
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.
A voltage divider to feed 5V to the ATTiny? Pure genius!
It will continuously draw 10mA, even when the switch is off…
So what? It’s not your battery that he’s using.
When I look at things like this I fall back to iterative design. He’s proven the concept and if this ends up getting long term use he’ll probably rev the design and include small fixes like that.
A float switch and a relay would have been sufficient for this…. >.>
The mystery device looks a lot like a valve spring compressor for doing a valve job on a small engine.
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.
Hooves, they are called hooves…