psu logo back to main page

Jump to:

Photos

Design Overview

Pumps, Flow Rate and Battery Sizing

Watering Schedule Control

Master Control Circuit

Soil Moisture Sensors

Useful Links and Resources

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:

  • Charles R-R for encouragement and a good memory for CMOS 4000 logic part numbers

system sketch
My sketch of how the system would fit together. The greenhouse does not actually lean at that angle. Honest...

    

Photos + Quick Links

Photos

control box with lid off
battery and charger
View of the control box with the lid off showing all the major system components. Pumps go on the base, control and battery on the lid (in case of leaks the electronics don't get flooded)
Battery and charger evaluation board.
   
main control pcb - top
main control pcb - bottom

Main control PCB top side showing switching FETs (top left), control and timing (left) and power filtering / switching (bottom right). Top left is a not yet implemented MPPT controller circuit.

Main control PCB bottom side. Power supply connections made with tinned copper wire, other connections made with enamelled copper wire (transformer wire). Note D2PAK transistor for switching the power rail.
   
control panel
connectors for sensors and alarmrear panel connections
The control panel end that will be visible in the greenhouse. Dial of timing pot marked in 0.5l increments to 2l. Force watering button and power switch. LED indicators to show which pump is active and if the control circuit is powered. At the other end of the case, a 15-way D-type connector forms the connection to the alarm clock. 3.5mm stereo jack sockets form the connection to all 8 soil moisture sensors as well as the solar panel.
   
 
   

Photos to add:

Installation + happy plants

 

Quick Links

Design Overview

Some Design Criteria

  1. Water the plants with the right amount of water at the right time (at the end of the day)
  2. No mains electricity supply
  3. Use water from the two butts by the greenhouse

So I made the folowing design choices:

Version 1 (current development)

  • Pumps and control electronics powered by a 6V Sealed Lead Acid (SLA) battery
  • Solar panel used to provide power to re-charge the battery
  • Switchmode intelligent battery charger to correctly charge the battery
  • Alarm clock to control watering start time
  • 555 timer to control watering time length with a pot for adjustment
  • Car windscreen washer pumps used to move water

Features for version 2

Possible future features

  • Microcontroller to control main functionality of plant watering system including sleep mode to save power
  • Real time clock IC for micro wake up control and multiple alarm options for steadier delivery of water. Either that or buy more alarm clocks :-/

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.

pump rates 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.

pump voltage vs battery usage

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.

battery sizing table

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

Version 1

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.

Version 2

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

Version 1

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.

alarm clock interface

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

timing table screenshot

This is a screenshot (31kB, PNG) of the spreadsheet that I used to calculate the 555 timer components (using the formulae from here) and also all of the divider ratios for the two ripple counter stages.

Screenshot, 31kB, PNG

You can download the spreadsheet here (Microsoft Excel .xls, 24kB)

master control schematic

This is the master control circuit schematic but it does not cover the solar powered battery charger.

Schematic, 97kB, JPG

The schematic is divided into sections:

Power Filtering

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.

Power Switching

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.

Frequency Dividers

Q7 (divide by 256) from the first CD4020 (datasheet, pinout only) ripple counter is the clock signal to the second CD4020 and is also to silence the alarm via the "OPTO A" and "OPTO B" lines.

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.

Pump Selection

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