Help using a moisture sensor to trigger a device for set amount of time?

I need a little project guidance. I am a Boy Scout pack leader and am familiar with computers and basics. I am trying to setup a auto watering system for my pack. Since we dont meet all the time it is nice for this unit to do most of job. But I am having problems understanding if what I want can be done.

Most plant watering kits like the one I purchased below measure the soil moisture and when it drops outside of specifications it kicks on a pump to run till the sensor detects moisture within range again then the pump shuts off.

I am looking to program this unit so when it senses being dry and would normally turn on the pump. I would like it to turn on the pump but only for a set amount of time. Then I want it to shut off and wait till next time it detects soil is dry then repeat process. Is this possible with this unit below? I dont want to use there small pump but trigger another pump that is 110v like an ECOplus396.

Here is the kit I bought. But it seems to have a tiny little pump, and only kicks on and off based on moisture. http://www.manylabs.com/collections/kits/products/k0904

Another kit with better moisture sensor I would not mind using, also is using a standard pump, but kit seems a little intense. http://www.instructables.com/id/WATERING-SYSTEM-INTRODUCTION/

Is there an easy way for a newb to design or purchase a kit that will make this easy, and also be able to program a set run time?

Any help, design, or guidance in purchase and program is major appreciated.

You should be able to get a relay to turn on or off you bigger pump. There are quite a few designed for microprocessors.

Purely as an example:

http://moderndevice.com/product/relay-plug/

(That might not be powerful enough for your pump, you would have to check).

Some info here:

http://arduino-info.wikispaces.com/ArduinoPower

For measuring moisture, you might get away with shoving some probes (eg. cheap multimeter leads) into the soil and measuring the resistance between them. I'm not sure how accurate that would be, but you could try it.

I am looking to program this unit so when it senses being dry and would normally turn on the pump. I would like it to turn on the pump but only for a set amount of time. Then I want it to shut off and wait till next time it detects soil is dry then repeat process.

Given the kit you already have, this is “just” a matter of acquiring a suitable arduino and writing code. I’d suggest it’s worth doing so before you graduate to bigger pumps and relays - familiarity with the hardware and software will stand you in good stead to make a more serious version.

Just out of curiosity, I made up a simple probing circuit:

I pushed the probes into a pot plant (the probes were just tinned copper wire) about an inch apart.

The sketch can be anything that reads the analog input and outputs it somehow. I had some LEDs hooked up so I could see the reading "in the field".

In free air it read 1023, in other words, it was just getting 5V from the 5V pin.

However with the probes conducting (eg. in wet soil) it sets up a voltage divider which lowers the reading. In dry (slightly damp) soil I got a reading of around 700 (out of 1023) and then after watering it dropped down to around 50.

So with some experimentation you could work out what reading you get when the plants are too dry, and what you get when they are suitably wet.

You probably need to add some hysteresis, so that once you commit to turning the pump on, your run it for some time (eg. a couple of minutes). After that, the reading should indicate that you don't need the pump any more. If you want to add an extra delay, you could do that too (eg. 3 days).

I dont want to use there small pump but trigger another pump that is 110v like an ECOplus396.

What might be somewhat safer would be to get a submersible 12V pump (like a sump pump from a boating supplier). These are quite cheap (like, $50) and then you only have to switch 12V. Much less likelihood to have electrocuted Scouts then.

You could have a plug-pack plugged into a power point (always on) and then switch the 12V out of it using something like the small relay I linked above. That would be much safer, especially with kids around, showing their friends, and not understanding how lethal mains voltage can be.

I built one using the moisture-sensing approach that Nick Gammon describes. The moisture sensor consists of two stainless steel cooking skewers spaced half an inch apart using a 'chop block' electrical connector (which also connects wires to them). So that the readings don't get skewed by the conditions at the surface, I insulated the skewers with heat shrink tubing so that the readings are taken a few inches down. To avoid electrolytic effects I only powered the probe when I'm taking a reading, and power the probes in reverse for the same time that they are powered forward. To keep the component count and costs down I used a Baby Orangutan Arduino clone which has a small H-bridge integrated onboard - this provides enough current to operate the tiny water pump I use, and the whole thing is powered by a 12V smps wall wart.

I also use an nRF24L01+ transceivers for logging, but that is obviously optional.

The only issues I've found are that the water flow rate varies slightly with water level, and every six months or so I need to pull the skewers out and clean them to get a consistent reading.

That's an excellent idea about insulating most of the probe length. That way you get "deep" readings rather than surface moisture.

Also you might want to investigate protecting the input pin, Google "arduino input pin protection". A couple of diodes and a resistor could protect you from zapping the input pin while the device was being manhandled.

PeterH: two stainless steel cooking skewers spaced half an inch apart using a 'chop block' electrical connector (which also connects wires to them).

I think you mean a "chocolate block" connector. Named for its reference to a conventional Cadbury's block. XD

PeterH: To avoid electrolytic effects I only powered the probe when I'm taking a reading, and power the probes in reverse for the same time that they are powered forward.

Good idea - doubt the cheap "moisture sensor" devices "for Arduino" on eBay and such take this into consideration.

Reversing the polarity as well may be taking it to extremes. For short measurement times it should not matter, or - you could use a capacitor in series to null out the average current.

PeterH: The only issues I've found ... every six months or so I need to pull the skewers out and clean them to get a consistent reading.

Which is probably more important than providing current reversal.

You could probably power the sensor from a digital output pin (rather than the 5V pin) and only turn it on when required. The few milliseconds to take reading would not cause much electrolysis.

Paul__B: I think you mean a "chocolate block" connector. Named for its reference to a conventional Cadbury's block. XD

I suspect this is a bit like the etymology of duct/duck tape - both definitions have become so widely used that they are interchangeable and neither of them are more correct that the other.

Chop-block connectors are a type of plastic terminal block made in a strip that is designed to be cut (chopped) to length depending how many terminals you need. They're also known as choc block connectors, or connector blocks, or terminal blocks, or connector strips, ...

So yes, a "chocolate block" connector is another name for the same thing, but that's not what I choose to call it.

Wow. I'm amazed to wake up to so much info to review. I definitely am reading up on code and trying to learn this stuff. Very interesting. I also appreciate the diagrams and guidance. I see where running a 12v system would be easier and safer. But I cant use a small pump for the project. Would the marine 12v do somewhere around the same as household voltage pumps?

I wanted to throw a few points out on reason I was using the bigger pump. We are not going to be using a drip style system but using the larger pumps to flood tables that hold about 30 gallons of water. It keeps things fair as each scout has a net pot we will be sticking in the flood trays so they all get same supply= fair competition, no chance for one pot to get more nutrients then another. The Ecoplus396 is a standard submersible pump and easily available and the local garden supply recommended the store owner said it would flood the table in about 7 minutes. So my goal is when it senses dry, pump kicks on and runs for 10-15 minutes depending then shuts off till next time senses dry. The table will then drain back into reservoir.

I see its possible to use a relay, not sure what size to switch the larger pump. I also see Nick noted I can have it run for a certain time after turning on, which is great just seems like an en devour to get there. Any more help is appreciated I am open to buying any equipment needed to make this work whether full kit or parts. Any Arduino better for this project then others.

Thanks

LearningGap: Would the marine 12v do somewhere around the same as household voltage pumps?

I wanted to throw a few points out on reason I was using the bigger pump. We are not going to be using a drip style system but using the larger pumps to flood tables that hold about 30 gallons of water. It keeps things fair as each scout has a net pot we will be sticking in the flood trays so they all get same supply= fair competition, no chance for one pot to get more nutrients then another. The Ecoplus396 is a standard submersible pump and easily available and the local garden supply recommended the store owner said it would flood the table in about 7 minutes.

Luckily I still have the receipt for my bilge pump. It cost me $AUD 30 (about $US 29), runs from 12V and pumps 360 GPH (1360 LPH). Your Ecoplus396 does 396 GPH so it is basically the same rate.

Yesterday I pumped the water out of a half-barrel fish tank to refresh the water, and the pump pumped it out pretty fast. Put it this way, it pumped into a bucket faster than we could pick up the bucket and empty it onto the garden.

And that pump was basically the cheapest (and slowest) one they had.

Based on needing to pump 30 gallons, at 360 GPH you should be able to do it in 30/360 of an hour, namely 5 minutes.

Amazon in the US carries a number of 12V bilge pumps for cheap - similar spec to Nick's by the sound of it. Reviews are mixed - they don't seem all that reliable or long lasting, but seem ideal for your purposes assuming this is a short lived project. At ~$13 a pop, it might be worth buying two.