|back to main page|
Automatic Solar Powered Plant Watering System
Every year, we grow tomatoes (and other fruit + veg) in our greenhouse in our back garden. Being an occasionally forgetful chap, I also often forget to water the plants every day. This can be a problem with tomatoes as irregular watering can lead to split skins which are unsightly and reduce the shelf life of the fruit - see here, here and here for info.
A couple of years ago, I proposed a solar powered watering system for the plants to water them daily from the water butts by the greenhouse. As with all my projects, this has been work in progress for a long time now, but I have picked it up again with the intention of completion!
As the greenhouse is halfway down the garden there is no mains electricity available nearby. Therefore the solution had to be independently powered.
Eventually I knocked together a prototype system which is ready to be installed for testing.
Credit goes to:
Photos + Quick Links
Photos to add:
Installation + happy plants
Some Design Criteria
So I made the folowing design choices:
Version 1 (current development)
Features for version 2
Possible future features
Pumps, Flow Rate and Battery Sizing
Some kind of low power water pump is required so I picked up a couple of generic windscreen washer pumps from eBay (much cheaper than Halfrauds). These are 12V rated, but judging by the power consumption they are not designed for continuous operaton.
To decide how big the battery needed to be, I needed to characterise the pumps performance. To do this I pumped a pint of water between two milk bottles, varied the voltage and measured the time taken for the transfer. Measurements are in the below table.
This is better shown in this graph below showing pump voltage vs the battery energy required to move the water. As you can see, a pump voltage of about 9V to 10V is the most efficient.
Of the battery technologies that are available, the best choice was Sealed Lead Acid (SLA) (info, more info) because of its low cost, high capacity, robustness and ease of charging. Weight was not a concern as this would be a static installation, not portable. In the end I selected a 6V battery because the lower power dissipation of the pump should increase long term reliability. Also, 9V SLA batteries are not commonly available.
I used the below table to size the battery.
I picked a Yuasa NP series 6V, 4Ah battery because the price and physical size were ideal. Also the excess capacity gives me a nice buffer in the event of poor charging and/or decreased battery life.
In reality, the amount of water required increases with the amount of sun so the battery will always be well charged on days when pumping requirements are higher.
Solar Powered Battery Charger
I've managed to get hold of a BQ2031 SLA battery charger evaluation board. I've reduced the maximum charge current by increasing the value of the current sense resistor on the board. This will trickle charge the battery when there is enough power on the input. Being a switchmode converter, efficiency will be better than a linear regulator - very useful for a solar application.
Solar panel efficiency can be greatly increased by using a maximum power point tracker (MPPT). This allows the maximum amount of useful power to be extracted from the solar panel - very useful in this application.
Measuring the charging current in the battery and the solar panel voltage gives the capability to maximise the power delivered to the battery. The intention would be to implement this using an Atmel ATtiny26 microcontroller as the MPPT controller.
This will be the first major upgrade to the system over the next winter.
Watering Schedule Control
To set when the plants were watered, I bought a solar powered alarm clock from Maplin that was reduced from £30 to £5 (code N70FU). It is a lot bigger than I thought (I didn't check the dimensions!) but you get a lot for the money. The clock is waterproof, is powered by a 5" x 3.5" solar panel which charges a 3.6V battery pack, has a backlight that turns on when the sunlight goes away, reports time, date and temperature too.
I took the back off, re-did some of the shonky Chinese wiring and played around with the alarm settings. The alarm is driven by a bipolar transistor, the base of which is driven with a 3V pulse through a 1k resistor. I'm using the output of the chip to drive the LED of a CNY17F-2 optocoupler through a 1k resistor. The output of this can then be used to trigger a timer to control the watering time.
Because the alarm sounds for 1 minute before shutting down, watering times under 1 minute are not possible without the timer re-triggering. The alarm can be reset by pressing one of the buttons. A second optocoupler connected across one of the buttons triggered once the watering duration timer has been triggered.
The schematic above shows how the connection of the optocouplers was made to the alarm clock. This trigger signal is then fed into the master control circuit.
Connection between alarm clock and control box was made using green insulated CAT-5 Ethernet cable with the coloured wires connecting to lines A, B, C and D. The striped wires were grounded at the control box only to provide some shielding for the signals.
Master Control Circuit
The schematic is divided into sections:
The pumps take lots of current, so there is plenty of filtering on the supply rails from the battery to prevent noise from the heavy current side making its way into the control electronics. The filtering consists of an LCL circuit for the pumps and switching transistors and another LCL filter for the control electronics.
Batteries are capable of providing lots of current which would "learn" any low resistance path between the terminals. To prevent damage in case of an over current event, the supply rails are fused with a T5A fuse for the the pumps and a T2A fuse for the control electronics.
This circuit ensures that the main controller circuit is powered off when not in use and is only turned on when the alarm is activated to indicate time to water.
The FQB47P06 P-channel MOSFET (datasheet - way overkill but I had some in my junkbox) is held off by the 1k resistor from gate to source. The only way for the circuit to turn on is for the alarm to go off (connection "OPTO C" and "OPTO D") or by pressing the "Force Enable" momentary push button.
This turns on the BC337 NPN transistor (datasheet) pulling the gate of the MOSFET low, turning it on and supplying power to the entire circuit.
When the alarm goes off, it is a series of bursts of pulses rather than a constant low. So to provide reliable triggering the transistor pumps the 100nF capacitor low which has to charge back up through the 1k gate-source resistor before the FET turns off.
The alarm is silenced by the frequency divider circuit so something needs to hold the FET on. This is achieved using a second opto which uses the switched power rail as a source and is controlled by the Q8 output from the pump selector circuit. When the "SHUTDOWN" signal goes high the BC337 turns off allowing the FET to turn off and remove power from the circuit.
Current consumption from the battery is sub 500uA (the meter I used just reads 0) when the switch is off.
Watering Time Generator
Based around my favourite IC - the 555 timer! - configured as an astable oscillator that is adjustable between 240Hz and 3.5Hz. This clock is divided down to give a watering duration between 17 seconds and 19 minutes. The frequency is adjustable using a 100k, single turn pot.
This is preferable to making a monostable using unstable, poorly toleranced electrolytic capacitors and large resistors. The astable circuit still requires a large-ish timing capacitor of 2uF but this is achieved using nice stable plastic film capacitors.
The second CD4020 uses the Q3-Q6 outputs to feed into the pump select and control circuit as a 4-bit signal to select the pump to activate. The Q3 output (LSB) is effectively the watering time clock frequency.
This combination of division ratios was selected because Q1 and Q2 are not available from the CD4020 and it also made selection of the 555 timer components easier.
All the logic ICs have a reset line driven from a small resistor-capacitor-diode network that ensures the power rail can establish before they activate to prevent any false counting.
Each pump takes 1.7A from the 6V supply rail when pumping water, so 8 pumps running simultaneously would draw 13.6A. This is a significant amount of current, so it is easier to switch the pumps on one at a time.
I needed a logic IC that only activates one output line at a time. I couldn't find any CD4017s that lying around as these would have been the first choice. I toyed with using a CD4015 SIPO shift register (datasheet, pinout only) to move a '1' along its 8 outputs but then Charles pointed me in the directon of the CD4514 (datasheet, pinout only) 4-to-16 line decoder.The first 8 outputs connect to the pump control circuitry and the 9th output provides the shutdown signal to the power switching circuit.
Pump + Soil Moisture Control
The pumps are then driven through a series of CD4011 NAND gates (datasheet, pinout only). The first gate has the enable pulse from the shift register as one input and the other input pulled high. This second input allows early termination of the pump running period by a soil moisture sensor pulling the line low. The second NAND gate is a straight inverter to allow the output to drive the gate of the MOSFET.
I found some STP20NF06 (60V, 20A, TO-220 - datasheet) MOSFETs in my junk box to drive the pumps with as these require lower current to drive than relays or bipolar transistors. These particular parts also have a low Vgs-thresh turn on voltage which means they can be driven from CMOS logic running at 6V. As well as activating the pumps, each transistor activates an LED to indicate that the pump is running.
Connections to the pumps made using 36 way ribbon cable with two wires for each pump -ve pin and the remaining wires used for the +ve supply. Each pump had a 1N4004 diode across the pump motor to catch any reverse voltage spikes when the pump is turned off.
Soil Moisture Sensors
Soil moisture can be gauged by measuring soil resistance. Gypsums blocks can be used to absorb water from the soil (or "growing medium" if you want to be posh) and provide a controlled medium to measure resistance through. This sounds like too much messing about, so I'll opt for a straight resistance measurement of metal contacts.
Measuring resistance with a DC current will start to electrolyse the soil, create gasses at the measurement terminals and possibly affect accuracy. Even though I'm looking for a simple dry / wet indicator without too much accuracy I'm going to opt for AC current measurement.
I've built a prototype to enable me to test the idea, more details to follow.
Useful Links and Resources