Irrigating your garden with an opamp: The circuit, list of materials by diy_bloke
Contest WinnerFeatured
opamp14.JPG
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 (chose your color)
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)


- 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)
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

Step 1: Irrigating your garden with an opamp: printing the PCB

741pcb.JPG
P1040287.JPG
P1040289.JPG
P1040293.JPG
To facilitate construction, I have made a PCB, although you could also build this on veroboard or stripboard. You will find the PCB design here for download. (Note There is a new printdesign here) The design for the printed circuit is orientated to make it suitable for direct toner transfer. That means that the printed side will have to go against the copper.
The design as you see it on paper is as if you would be looking at it from the component side, so if you want to use this design for any other method than toner transfer, keep that in mind.

Though this is not a tutorial on how to make your own printed circuit boards, I will quickly lead you through the steps of how I did it. The pictures I use are not specifically from this board but from another board but the method is the same:

-Print the PDF on glossy paper in a 1:1 scale, and cut it out. This can be special photopaper but just printed paper from a glossy magazine do well. Some people use paper that is normally used in baking

-Thoroughly clean a piece of PCB of about 4x5 cm, use steelwool. (picture 2)
-Heat up a regular flat iron on its highest temperature (setting for linnen or cotton). (picture 3)
-Put the printed design, face down on the copper and hold it in place with your fingers
-Take the tip of the hot iron and put it on a spot neer the center and hold it there for a few seconds, while you still hold the paper in place.
-This should have fixated the design to the board so it won't move anymore.
-Now put the flat iron, completely on the paper and press it down
-Hold that for about 30 seconds, while presing firmly.
-Now use the tip of the iron to rub down every part of the paper.
-Throw it in some water (watch it, probably very hot) and leave it there for about 10 minutes. Dont forget to switch off your iron
-After 10 minutes, peel of as much paper as possible, use your thumbs to really rub hard.
-Throw it in water again to let is soak and then take off more paper
-Repeat this till all the paper is gone
-You will probably be left with a final very thin layer of paper that is hard to remove. Use a soft tootbrush to remove that.

Your PCB  now has its mask and is ready for etching . (picture 3)

Just one remark: the design you will download is very slightly different from the one you see below: I moved the position of the diode that protects the transistor from the relay, to make it easier to mount
biochemtronics says: May 6, 2013. 11:17 AM
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) says: May 7, 2013. 7:05 PM
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
biochemtronics says: May 8, 2013. 8:54 AM
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) says: May 9, 2013. 8:38 PM
I will see if I can find some
eldwin says: May 6, 2013. 2:22 PM
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) says: May 7, 2013. 7:03 PM
Thanks for your input and the kind words
jarce diaz says: Oct 30, 2012. 10:27 PM
a video will be cool! :D
diy_bloke (author) says: Oct 30, 2012. 11:52 PM
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.
biddingsites says: Jun 14, 2012. 11:52 PM
nicely,neatly done project. gonna apply this at home.very easy to follow.thanks
diy_bloke (author) says: Jun 15, 2012. 12:12 AM
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
stumitch says: May 17, 2012. 8:02 AM
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) says: May 17, 2012. 9:05 AM
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
indiantinker says: May 17, 2012. 8:36 AM
Extremely Great Project and very well documented!
Cheers!
diy_bloke (author) says: May 17, 2012. 9:04 AM
Thank you!
diy_bloke (author) says: May 14, 2012. 7:28 AM
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)
mpilchfamily says: May 16, 2012. 8:34 AM
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) says: May 16, 2012. 9:18 AM
Thanks yes it is in Gardening and make it Challenge :-)
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!