Instructables

Irrigating your garden with an opamp: The circuit, list of materials

FeaturedContest Winner
Picture of Irrigating your garden with an opamp: The circuit, list of materials

In an earlier instructable, presenting an automatic garden watering project with an Attiny, I mentioned it could also be done with an op amp. So, let me put my money where my mouth is and present you one. It has an option to use a regular relay, or a solid state relay

Here is what you need:
1 Opamp UA741 (or LM741, or other '741 'type')
1 LED (red or green, for LED's with a high voltage drop, like blue, you may want to adapt R2)
1 resistor of 10-200k (I'll get back to that in the text)
1 resistor of 10-100 Ohm (whatever you have lying around)
1 reed switch (The small ones in a glass) if you can't find one, try a door contact
1 magnet
1 8 pins DIL IC foot
1 electrolytic capacitor 220uF 16-25 V (optional)
1 small submersible pump (I use a 5 W pump that pumps 430 l/h that is about 7 liters a minute) (Garden centers, eBay)

- if you chose to build the thing with a solid state relay add the following:
1 resistor 220 Ohm
1 solid state Relay (I use a 39MF22)
1 8 pins IC foot
1 resistor of 100 Ohm (optional)
1 capacitor of 100 nf 400 V (optional)

Note. I have chosen the 39MF22 solid-state relay because it is rather cheap. If you cannot find
it in your area, choose the mechanic relay. If that is no option consider replacing the solid state relay by an optocoupler with TRIAC. If you have a low voltage DC pump, consider switching it with a FET or transistor, or the mechanical relay


- if you chose to build it with a mechanical relay, add the following
1 resistor 1k
1 NPN transistor such as BC547
1 diode 1N4001
1 relay (make) voltage 5-18 Volt (depending on your situation)

Furthermore
A large bucket (DIY stores, I use one that is used to mix cement)
Tubing/Hose (DIY stores, garden stores)
Soldering iron
Double cable low voltage
110-220 V cable suitable for outside use (DIY stores)
2 galvanized nails or a galvanized clothes hanger (DIY store, your mothers closet), or 2 carbon rods from an old battery
heat shrink tubing
blank PCB of about 5x5 cm
Hydrochloric acid (drugstore, diy store)
Hydroxyperoxide (drugstore)
screwdriver
A watertight wall socket for outside use (DIY store)
A wallwart PSU of 5-15 Volt (depending on your situation).

Total cost
That is very difficult to say as I had much of the stuff already available. The most expensive was I think the pump (14 euro's). The electronic components are really nickle and dime stuff. A 741 cost 25 cents (euro's), the 39MF22 was 1.80 euro.
I used a watertight wall socket that I had available, but I think these are about 3 euro's. Everybody must already have a wallwart PSU available somewher.
Mains cables for outside use are not really cheap (say a euro/meter) but often you can get it cheaper and if you are a gardener, you may have something left over from a previous installation.
I am not really counting the chemicals for etching either coz I had these for other projects as well, but also that is very cheap.

If I just count stuff that I had to buy especially for this project, it may have costed me 20-25 euro's, but I guess that if you dont have that much stuff laying around, it could be 35-40 euro's.

Steps
I will cover the following steps:
The electronic circuit (Intro)
Printing the PCB (step 1)
Etching the PCB (step 2)
Mounting the components (step 3)
Using a stripboard instead of a PCB (step 4)
Making a humidity sensor out of galvanized material (step 5)
Making an alternative humidity sensor out of gypsum (step 6)
Making a level indicator (step 7)
On overview of the finished project (step 8)
Seeing it in action (step 9)
Expansions (step 10)

The circuit
The circuit is quite simple. P1 is used to set the level where the pump should start pumping. In dry soil the resistance of the spikes is high and the voltage on the inverting pin of the opamp is low. If that is lower than the voltage on the non-inverting pin (set by P1) the output will go high. This will activate the solidstate relay (a 39MF22) and or activate the mechanical relay. The PCB allows for both. The value of R1 is depending on your humidity sensor and the type of soil you use. For me 10 K was a good choice. In Step 4, where I describe the humidity sensor. I will tell you how to choose a good value for this resistor.

The pump that I use is a small submersible pump, used for small pond fountains. It pumps water from a container into a drip line in my veggie bed. Submersible pumps do not like to run dry, so we need some way to measure the waterlevel and to stop the pump when the level is too low. That is where S1 and R5 come in. S1 is a simple Normally Open float switch. I use a reed relay attached to the outside of the container and a floating device with a magnet on the inside (more about that later. When the level in the container goes too low, the float switch closes.
The trick is that I connect the floatswitch via a very small resistor (10-100 R) to the same terminals that the moisture sensor is attached to. So if the water level is too low, and the switch closes, there suddenly is a very low resistance over the humidity spikes and the 741 Op amp is 'tricked' into 'thinking' that the soil is wet enough and will switch off the pump.

You could use other switches than a reed relay, but this one has worked for me (I will come with some suggestions later)

C2 is not really necessary. One can put it in to give a bit of a delay with switchin the relay's on or off and thus avoid jittering.

The voltage to feed the 741 op amp is not so critical. Mine works on 5 Volts (I would not go much lower) but depending on the type of 741 you use you may go as high as 18 or 22 Volts. If you do though, you may want to recalculate R2. The current value of R2 is 220 Ohm.
In calculating the resistor value for other voltages, take the following in consideration: The 39MF22 has forward voltage of 1.2 Volts. Current should be between 5 and 20 mA. Most green or red LED's have a forward voltage of 2 Volts. Therefore the value of R should be at least (Vcc-3.2)/20 (gives value in kOhm) and at most (Vcc-3.2)/5 (gives value in kOhm).
So for 5 Volts this would be 1.8/20=90 Ohm till 1.8/5=360 Ohm

This table will save you calculating the value of R2:
Voltage Minimal value Max value
5 90 360
6 140 560
7 190 760
8 240 960
9 290 1160
10 340 1360
11 390 1560
12 440 1760
13 490 1960
14 540 2160
15 590 2360
16 640 2560
17 690 2760
18 740 2960
Values in Ohms. Just chose one sort of in the middle of the range for your voltage

The snubbing network around C1 and R3 is optional and most likely not necessary as I understand solid state relays to be quite capable of handling inductive loads. If you use it, put it in the wall socket (more about this later)

 
Remove these adsRemove these ads by Signing Up
diy_bloke (author) 2 years ago
In case I did not make it clear: the pipe that contains the floater with the magnet is pop rivieted to the bucket (at the top only)
You can edit your instructable to add that bit of info where its needed. Nice job by the way. Have you entered it into any of the challenges yet?  You may not get it in the Plan it- build it but it can go into the Kit design challenge.
diy_bloke (author)  mpilchfamily2 years ago
Thanks yes it is in Gardening and make it Challenge :-)
IC39MF22 in not available in my area..plsz tell another number ic with the same function
diy_bloke (author)  vishnu20193 months ago

26mf12 (230 V only and no zero cross)
PR36MF22
AS0242
However, you will find most replacements fairly expensive. Have you considered using the transistor and relay?

Rather than paying top dollar for another solidstate relay you can also consider an optocoupler with Triac

knightswindler10 months ago
can i make this project with sim900D as my display for the temperature of the soil?

thank you inadvance for your help
diy_bloke (author)  knightswindler10 months ago
The Sim900D as far as i know is a gsm module. I do not know it as a display. Regardless, this circuit is based on an op amp and that opamp has no way to send info to a display, there is also no temperature sensor so it would be a totally seperate project
sameeradis1 year ago
Gypsum block sensors are a cheap method to make sensors for automated irrigation systems. Even though the problem is gypsum block polarization. Constant resistance values are cannot obtain. But according to papers & journals , gypsum block polarization can be reduced by using AC voltage. But unfortunately, most of the soil moisture sensor circuit is works using DC voltage.
Another matter is what is the best electrode can be used to gypsum block?. I used galvanized electrodes, aluminum electrodes and SS 304 electrodes (Stainless Steel). But all of materials not suitable for long time (I used only a week). Because positive electrode is subject to corrosion. But aluminium is not corroded. But aluminium oxide is deposited on positive electrode.
Anyone can please help me to find polarization removal circuit or proper method & how to select a proper material to make electrodes.

Thanks
diy_bloke (author)  sameeradis1 year ago
sameeradis, thanks for yr reaction. If you go through the comments you will see two suggestions: using the carbon rods from old batteries of usung conductive plastic. I have tried gypsum and was not really that happy with it.

If you are thinking of another circuit, check out my Attiny based irrigator: Corrosion can be prevented by switching the electricity through the elektrode only 'on' when you do the actual measuring, as I have described in the article. The software already provides for that. If you are willing to sacrifice another I/O pin of the chip, you can take the positive from the one and the negative from the other and create yr own AC. For the actual measurement it does not make that much difference, as long as you know at what moment you are measuring :-)
I love your idea and design. Simple and functional! Another cheap probe I have used in soil is the carbon rod from a really cheap carbon battery (AA, C or D cell). I just peel the outside label off and pull on the positive terminal on the top with some pliers to remove the carbon rod. Just be careful not to break the rod or pull it loose from the positive tab glued to its top. Soldering to the metal tab (the positive terminal of the battery) is really easy. When inserted in the ground only the carbon rods contact the soil and they won't corrode at all.
diy_bloke (author)  biochemtronics1 year ago
Actually that is a good idea. I remember using those carbon rods long time ago for making a field telephone. Got them out of the old 4.5Volt batteries. I may give your idea a try for the new season
An even better idea is to use disposable electrically conductive plastic. We use conductive pipette tips in the research laboratory where I work. I used them to make a soil moisture meter I several years ago and it worked great. I just drilled a hole in each one and attached a stainless steel wire (a fishing leader) with a stainless bolt. A lot of items including some electronic tools are also made of conductive plastic so something that will work should not be difficult to find.
diy_bloke (author)  biochemtronics1 year ago
I will see if I can find some
eldwin1 year ago
Don't mess with your pump location, leave it at the bottom. The water level changes the inlet pressure at the pump, it's still pumping the same differential head. Good instructable, thanks!
diy_bloke (author)  eldwin1 year ago
Thanks for your input and the kind words
jarce diaz2 years ago
a video will be cool! :D
diy_bloke (author)  jarce diaz2 years ago
yes it would :-) however I did not make on and as it is freezing now, I dismantled the set up.
Still, the only thing you would see on a video is water squirting out of a pipe :-).

I may add a video in the spring. I probably will have a complete new set up then as I am redesigning my garden.
nicely,neatly done project. gonna apply this at home.very easy to follow.thanks
diy_bloke (author)  biddingsites2 years ago
Thanks. Should be very easy to do. Just a tip: depending on your pump and your delivery system, you may or may not experience syphoning of the water even if the pump switches off, if the water container is higher than your delivery system.

Soaker hose does not seem to have this problem, nor do sprinklers. I used an electric conduit pipe with 2 mm holes and that has some tendency for syphoning.

keep your water container at a lower level and you will not have this problem
stumitch2 years ago
brilliant! thanks so much... i'll be building one for my garden for sure. all we need now is a machine to do the weeds... :-)
diy_bloke (author)  stumitch2 years ago
You may want to consider building one with a power supplu already on the PCB. I am sure there is an ibble somewhere on an automatic lawnmower :-)
If you have problems with the build, dont hesitate to ask
Extremely Great Project and very well documented!
Cheers!
diy_bloke (author)  indiantinker2 years ago
Thank you!