Being a keen, but slightly irregular allotment holder I suffer from the problem that I need my greenhouse to start my plants off but invariably work gets in the way and by the time I get there again my plants have died through lack of water. I have tried various drip feed systems but as they are not demand led they either soak the plants or don't drip enough to keep them growing. Not helped of course by the wonderfully intermittent English weather.
So I got to thinking. Was there a way that I could automate the watering system in a remote location so that it would keep my poor plants alive until I returned?
After thinking through the idea for a while and playing around with hardware and my arduino I have finally got it sorted. I now have an on demand system that will water when dry but not when wet, keeping my three growing areas just right.
The system breaks down into 3 parts. Firstly there is the power system. This is made up of a 12v Sealed Lead Acid battery (from an old house alarm) and a compatible solar panel and charge controller. Although with many functions, the charge controller is purely there to charge the battery and nothing else. The second part is the control system. This is made up of an Arduino nano with IO shield attached to a float switch and a relay output.
The third part is the watering system itself. This comprises of a 12v 240L/H pump with a float switch and a length of garden hose.
Step 1: Parts List
I would love to price these up and have a good idea but unfortuantely I don't.
- 10w 12v Solar Panel with charge controller (Solar panel max 17v @ 0.58A)
- 12v sealed Lead Acid battery (must be Lead Acid for charge controller but check what you buy)
- 12v 5w 240L/h oil/water pump
- 12v float switch
- 12v in line fuse holder and 5A resettable fuse
- 5m waterproof 12v cable
- Mini LED voltmeter
- Strip Veroboard
- LM7805 IC Voltage Regulator (5v)
- Arduino nano with IO shield
- 5v Optically Isolated relay
- Small vertical float switch
Step 2: Assembling the Power Supply
The solar panel and charge controller are used purely to keep the battery topped up. As the pump draws 5w and the panel is capable of delivering 8w it is perfectly possible just to use the solar panel and no battery. However I would (especially in the UK) advise against this as it's only going to work with a decent amount of sunlight.
The charge controller has various modes and so after following the instructions it can pretty much be left to its own devices. I have found even through the polycarbonate sheeting of the greenhouse it will still produce more than enough power for this function.
The other issue that I had was powering the Arduino. I wanted to use the 12v battery but was unsure of the stability of the supply given it was attached to the solar panel, albeit through the charge controller. After research I decided to make a simple voltage regulated circuit using the LM7805 IC Voltage Regulator that runs at a stable 5V, verify this with a voltmeter on the circuit and feed this into the Arduino. The results of which are shown below.
Interestingly, please check the leg configuration of your chip. I thought I had and they make a very good crackle and get very hot if you mistake the ground for the power in.....
Step 3: Setting Up the Arduino
Having a spare Arduino nano from an earlier project I decided to use this. My initial idea was to use 3 moisture sensors - one in each of the growing areas - and then trigger the watering if any of them reported dryness. After some deliberation I hit on the idea that all I would need would be a single sensor if I used capillary matting for the watering and monitored the reservoir for the matting. If the reservoir was empty then the water needed to flow.
I also needed to send power to the pump to set the water flowing. This was achieved with a 5V relay and a float switch mounted in the base of the reservoir. Having experimented with the moisture sensors available, this proved to be the most reliable method.
Once per hour the Arduino checks the moisture sensor to see if there is water present. If there is it does nothing and checks in another hour. If there is no water present, it runs the pump for 10 sec giving about 0.6L of water and then shuts down and waits for another hour to check again.
I have attached the script to this stage - although it is very simple indeed.
Step 4: Wiring the Pump
Although at the allotment I have a 1 cubic metre waterbutt, there is the possibility that in very hot times it could run dry. To prevent this, there is a float switch wired in series with the pump. The float switch is made for bilge water on boats so it is well suited to this job. Again it is a simple circuit - the power flows from the battery through the fuse to the pump and there is a break in the positive line to the pump that connects to the relay.
Step 5: Installed and Working.
And here it is - installed and working. So far so good. This is the culmination of trial and failure of certain parts. The float switch is by far and away the better way to control the reservior than moisture or rainwater sensors. The OI relay beats a normal one into a cocked hat.
Comments / ideas - I will be more than happy to hear from you.
Thanks for reading.