Lifeboat Farm

A chicken waterer for chicken feed
November 10, 2011, 4:39 pm
Filed under: Menagerie, Water

We’d been looking for a while for a good solution to keeping the chickens well supplied with fresh, clean water. Constant access to fresh water is a big factor in chicken health and egg laying. Delivering them water is one thing, but if you’ve ever kept chickens, you’ll know how messy they can be. Their natural scratching behaviour tends to foul up any water container with dirt, poo and anything else they can get their talons on.

We’ve used refillable chicken waterers in the past but they have a few limitations: you have to refill them every day or two, they need regular cleaning, and most of them are translucent so you get algae growing in them eventually.

So I wanted something that I could plumb in to the regular farm water system that feeds all our troughs to avoid refilling, but that would also stay clean and algae-free.

Enter the water box.

I’d seen this design for sale on the internet for upwards of $80 and to my mind it just looked like a plastic box with a trough valve and holes. Given that I had almost all the parts in the workshop, I just needed to buy a big plastic box from The Warehouse. Price; $15.

I drilled a hole and attached a spare trough valve so the water level would end up about 3/4 full and hooked it up to the water supply. When it had filled, I marked the water level, and just above that, I drilled the three large holes with the biggest hole saw I had – it just has to be big enough to fit a chicken’s head through. And that’s it.

I left the lid off for a day so the chickens got used to drinking out of it (both out of the top, and through the holes). Now the chickens use it all the time. After a month’s test, the water is still pristine and algae-free. The high walls keep out all the grit and the solid plastic keeps enough light out that algae can’t grow.

This easy project is proof that you don’t always have to spend a lot of dosh to solve farm problems.



The finished Arduino wireless water sensor
June 20, 2011, 11:21 pm
Filed under: Technology, Water

Back at the end of 2009 I started playing about with an Arduino solution to monitor the water level in a water tank about 300m from the house. The tank isn’t visible from the house so a standard visual tank indicator wouldn’t work. In a nutshell, this sensor measures resistance through an array submerged in the tank to determine the water level, then sends that data back to a server in the house for humans to read. I covered the prototype and the first iteration of the sensor in this post.

There were a few more steps beyond the prototype required to make it really useful and along the way I discovered some issues with the first model which I’ve improved on, but that’s why you call it a prototype.

Here is the Arduino with an added WiFly shield – an add-on that gives the Arduino the ability to (mostly) seamlessly communicate over the farm’s existing 802.11 WiFi network. Arduino shields piggy-back on top of the board, and in this case the WiFly shield has a handy prototyping area – perfect for projects like this where you need to add a few components to a solution. The red and black leads you can see here connect to the water level sensor in the tank. The whole thing is mounted on an aluminium bracket I made up to fix it securely in the project box.

And here’s the whole assembly in the waterproof (IP66) project box. It’s designed to sit out in all weather, diligently saving me endless trips to the tank to manually check the water, so it needed a good enclosure. The battery taking up most of the box is a bog-standard sealed 12v motorcycle battery. I’ve tried to keep as many components as possible off-the-shelf to keep costs down and make future maintenance easy. The external antenna for the wifi is at the bottom left of the enclosure and the 4-way connector on the right is for signal from the sensor and solar power to come in.

The close up shows it’s a pretty snug fit in there. The Arduino is mounted on an angle so the USB port on the right hand side is accessible without unpacking everything. I learned from version one that there will always be lots of tweaking before it works well, so I wanted to make future software changes easy.

The enclosure mounted on a post just above the water tank. The 4-way connector makes it easy to connect up without taking the lid off (important if the weather is rubbish) or take the whole thing back to the workshop when I need to make physical changes.

The sensor array of resistors and an earth return wire lie inside the plastic pipe. The whole thing is submerged in the tank. Originally I had joined the string of resistors together with soldered nichrome wire but after a few months some corrosion (and what seemed to be electrolysis) was starting to look unsightly. I replaced the connections with plain light gauge insulated lead-out wire and it seems to be fine now. The sensor sends 5v DC through the water for a few milliseconds to take a reading so I don’t expect too many problems long term (the tank and all its fittings are plastic). The original post has photos of the array being built.

To power the sensor, I’ve used a 10W solar top-up charger with a built in charge controller. It’s a standard item from most automotive suppliers. At such low power it’s difficult to over charge a 12v battery but having the charge controller adds a bit more margin for error. This panel provides more than enough power to keep the battery topped up. The Arduino draws a tiny amount of power, but the WiFly shield does use a bit of power when it’s transmitting. The ideal angles for a solar panel are: facing due North (in the Southern hemisphere) and inclined to an angle from the horizontal equal to your latitude (about 42 degrees here). I had to cope with the curved surface of the water tank so it’s a best-guess effort.

The distance back to the house is over 300m. We have a fairly powerful wireless access point attached to the outside of the house so small wifi devices can connect to the network pretty easily if they have line of sight.

Back in the house, we can visualise the data, thanks to some great work on the server software from our friend Dave. Making this prettier and adding some smarts like alarms will be the next phase of this project.

The Arduino code is still a work in progress, but I’m more than happy to share it if anyone might find it useful. The software is quite modular so it can be fairly easily adapted for other sensors. We use it for several temperature sensors around the farm and I’m currently working on another sensor to record wind data at a remote site we are thinking about putting some wind turbines on.

Update November 2011 – Triumph!

After a few more tweaks to improve reliability and error tolerance I’m happy to publish the code. I’ve just started playing with Fritzing, so hopefully soon I can put up a proper schematic for the project.

While the sensor worked well most of the time, when you’re dealing with a device a long way from the house that needs to just work, “most of the time” isn’t quite good enough. The problems I had with the WiFly shield were the reliability of communications and recovery from errors.

The code supposedly resets the WiFly client for each data-gathering cycle, but every now and then (from 1 hour to 1 week) it would fail to initialise properly and hang. This would hang the Arduino entirely. From the research I did, and asking people smarter than me, it looked like the WiFly shield wasn’t properly shutting down or clearing its buffers. I’d noticed that it always worked first time, just after a power reset. To replicate that I connected the power to the WiFly shield via a small relay, controlled by the Arduino. Now I have the ability to cut power to the WiFly shield at the end of each data-collection cycle, and power it up each time. This seems to have solved the comms problems and has the added advantage of not wasting power on the WiFly shield between transmissions.

The second problem was the Wifly shield’s fairly fragile handling of errors. If for example, the wifi network or remote server were not available to connect to, the WiFly shield would hang. No retries, no resets, just hang. After much playing around I came across the documentation for the watchdog timer, that allows you to define a reset clock in the code that will reset the Arduino if certain points in the code aren’t reached in a timely manner (ie it has hung). So now, if for any reason, the WiFly can’t post data to the remote server, it resets and tries again (and will keep resetting until it has successfully completed a data post).

The basic function of the sensor is: Take sensor reading > join Wifi network > sent http GET request to remote server > wait >repeat

The Code:

It’s in three parts; the main .pde file, the settings file, and the water level reading function in it’s own file – just put all three in the same place. To use it you’d need to change any settings specific to server and wifi network settings to suit you. There is also a serial printout of the sensor data and comms status so you could easily modify the code to send data somewhere else, print to LCD, write to an SD card etc.

I appreciate this isn’t exactly a comprehensive how-to. This project (and documentation) has been evolving over a year and a half. If there’s interest I can put some time into making this more of an “instructible” to make replication a bit easier.



Ram pump maintenance
October 7, 2010, 8:46 am
Filed under: Water

The ram pump had stopped working so I went to investigate. With all the torrential rain we had through Winter, the reservoir had completely filled up with debris washed down from the surrounding paddocks.


A bit of spadework soon sorted that out. Luckily, the filter on the end of the intake pipe (inside the reservoir) had stopped the 30 metres of drive pipe filling up with soil and grit – that would have been a much less fun job to correct.


After a couple of years of (mostly) trouble free operation, the pump is starting to get a fine coating of lime from the spring water splashes. In another few decades it might need a clean.

Arduino water level gauge
December 28, 2009, 2:16 pm
Filed under: Technology, Water

A couple of months back I was lucky enough to win an Arduino starter kit from the folk at Mindkits. With the Christmas break upon us we’ve finally had some time to get our first project underway – a wireless water tank level gauge.

Our main water tank for the farm is out of view of the house so a visual water level gauge wouldn’t be much use. Most of the time we can only tell when the tank is empty the hard way, although I’ve added some plumbing to the tank so we always have some water in reserve.

The first task was to find a simple, robust way of physically measuring the water level. I got an idea on this blog about using a string of resistors on a pole that short out below the water level, giving you a variable resistance that can be read by the arduino. In theory, all you needed was a long enough string of resistors running down a substrate, with a return path for the current.


Here’s Dave with the first prototype to prove the concept – resistors soldered together and hot-glued onto a piece of polybutylene plumbing pipe. There is a piece of nichrome wire hot-glued on the back to complete the circuit.


Dave and I breadboarded this prototype and it worked! By worked, I mean we got varying numbers returned by the arduino as the gauge went up and down in the water. We still had to determine if the numbers meant anything, but I felt that part of the process sat more with Dave as the software guy than me as the fabricator 🙂 The arduino is the little PCB attached to the blue USB cable.


The next step was a full-size prototype (although it will probably become the actual gauge). Once the tank was measured I cut some aluminium channel to length and mounted a longer piece of polybutylene down the channel. 20 1k resistors got soldered together and hot-glued down the length of the pipe. This should give us 5% increments of water level. I added cable ties as a backup to the hot glue in case the water in the tank made it too brittle to stay attached. In this picture you can see the leads attached for easier testing.


The final step in the prototyping was to take the contraption outside to a water tank near the house to test and calibrate the gauge in a real situation.The resistance varied as the gauge was submerged more or less in the water. We collected values at 0%, 25%, 50% and 100% submersion and the resistance values that came back are very close to a linear relationship (close enough to assume it’s our measuring that’s out). This means we can interpolate a fairly granular level of  water measurement from the resistance levels returned.


There are a few more steps in the project now:

Wireless comms – we’re looking at using the farm’s existing 802.11 wireless network to send data from the gauge approx 200m back to the house.

Solar power – the arduino will happily run on 12v DC so a small solar cell and a car battery should keep it running 24/7

Software – Dave has volunteered to write a web app to present the data in a prettier form.

Phase 2: once we’ve got the gauge running well, we can look at future features that go beyond passive monitoring like alarms based on water level, auto-starting the water pump, calculating flow rate and tripping alarms or a shut-off servo if the flow is too high for too long (indicating a pipe break) – the possibilites are endless.

Water ram pump
March 17, 2009, 3:29 pm
Filed under: Technology, Water

We are very fortunate to have a prolific spring on the property that supplies all the water we need. While we currently use petrol and diesel-powered pumps to move the water around the farm, we have always planned on using more sustainable methods.The first step is the installation of a water ram pump.

Ram pumps work on the principle of harnessing the “water hammer” effect – when you suddenly stop a descending column of water, the force produced is much greater than the weight of the water alone. This force, when used in a cycle can pump water considerably higher than the level it starts from. Water flowing downhill is passed through the ram pump and most of it is returned to the flow downstream while a small amount gets pushed up the hill. It’s inefficient but a small flow of water 24/7 using no external energy is a pretty good deal. Our ram pump delivers a constant 4L/minute to a header tank 40m above the spring.


The ram pump before installation. It only has 2 moving parts (both valves) – one visible and one inside the base of the dome. Wikipedia has a good overview of the how ram pumps work. While there are plenty of references available online I was fortunate to get the original instructions with my ram pump.


The ram pump installed at the lowest point I could practically manage – about 4m below the point at which the water is collected. To the right of the pump is the path of the spring. Water that sprays out of the pump as waste will drain back into the stream. I still need to put a cement base under the ram – it will be in danger of hammering itself down into the bank otherwise.


The drive pipe heading down to the pump. It’s just over 30m of galvanised 40mm (inch and a half) steel pipe. There is a gentle bend in the pipe to get over some immovable rocks. The ideal is to have a perfectly straight, rigid pipe to minimise water friction but a gentle curve is better than sharp bends.


The reservoir at the top of the spring is made from a 200L plastic drum cut in half and lined with polythene. This ensures the drive pipe is always full and gives any sediment in the spring a chance to settle before the water goes to the pump. The inflow on the right is the overflow from the neighbour’s water catchment.

Here is a small video clip of the pump in action

Lessons from my installation

While I mentioned there are plenty of resources online regarding hydraulic ram pumps, most are related to theoretical performance and pretty diagrams of how the pumps work. Here are a few lessons I’ve learned from trial and error (and wish someone had told me before I started).

First up, and this is not a good thing to hear if you are considering “having a go” like I did, you have to set up the ram exactly as it’s going to be used in order to test it. As I will explain in the points below, there’s no dry runs, loose fits or shake-downs. Unless the ram pump is set up completely (and properly) it just won’t go. I spent a good number of frustrating hours trying to troubleshoot the operation of the pump before I realised this useful point.

The drive pipe – needs to be as rigid and straight as possible. It must be airtight for the pump to work. I did a loose fit test with everything assembled and air was getting in the pipe. Water does not compress but air does. Air in the drive pipe cripples the pump and you will get erratic cycling or none at all.

The reservoir – needs to have enough of a store of water to ensure air never gets in the drive pipe.

The ram pump – needs to be level for the valves to operate correctly and efficiently. Installing valves on both the drive pipe entry and the exit to the delivery pipe is a good idea to save you having to refill these every time you fiddle with the pump. The drive pipe valve acts as the on/off tap for the pump.

The delivery pipe – needs to be attached and be at the correct length and height. The reason for this is the weight of water in the delivery pipe, at the required height creates backpressure at the pump which balances the pressure of the water in the delivery pipe. Without the delivery pipe connected the pump will never cycle freely. My first instinct was to get the pump working, then attach the delivery pipe. This single tip would have saved me hours of cursing and tinkering and hopefully it will save you some time if you undertake a similar project 🙂

After all the planning, work (and a fair bit of swearing) I forgot to mention the absolute joy you feel the first time you see the pump cycling, delivering water with no external energy.

Accident-proof Water Tank
November 24, 2008, 11:13 pm
Filed under: Water

This is the main water tank for the farm troughs, gardens, trees etc. It holds 15,000 litres when full but when a horse or cow trips over a pipe it tends to hold zero water fairly quickly. After finding an empty tank last night it was time to fix the problem.

I needed a system to keep the tank usable, but limit the loss of water when the inevitable happens. Until all the fencing is finished, there will always be temporary plastic troughs floating around and they are easy to trip over or disconnect.

My trusty cordless drill made short work of the plastic tank side – drilling a hole half way up.

Here’s the tank fitting in the hole. Rubber gaskets seal it from both sides between the two halves. Thankfully, what you can’t see is me having to climb into the tank in my boxers to push the fitting through from the inside. Luckily the water was only knee-deep (thanks to the horses).

The finished job  – you can see we now have two exits for water, both with valves. If the bottom valve is shut then water can only drain as far as the halfway point before running dry, but we still have half a tank safe in reserve for when the problem is fixed (and a few days of water in which to refill).

A Pond is Born
June 29, 2008, 2:25 pm
Filed under: Environment, Water

We’ve got a little dip near a new track we’ve put in. It looked like it might collect water but this is the first time I’ve seen it wet. The lie of the land makes me think it’s an important collection point for run-off from about half the front bowl so we might have to fence it off (and the wee crease leading to it) and do some wetland planting. My initial thoughts of just filling it in to make more paddock were probably not the best idea – the water will have to go somewhere if not here.