loading

I am building an automated irrigation system for my vegetable patch. This will be a system that monitors the soil moisture level and then turns on a pump to send water to my garden according to the detected moisture level.

The water is coming from our rainwater tank, there is also an overflow on the tank that I've redirected to the garden (both the vegetable and ornamental gardens) so that water isn't just sluiced off into my neighbors property. It's been doing that since before we bought the property.

This instructable is about one fairly simple part of the project, the soil moisture monitor.

For this instructable, you'll need:

  • 1 x Hygrometer (I bought mine from eBay)
  • 1 x Arduino (I'm using a UNO)
  • 3 x LED (Red, Green, Blue)
  • 3 x 220 ohm
  • 1 x 10k ohm resistor
  • jumper wires

Step 1: Wire It Up

There are three bits that are important in this project.

Connect the Hygrometer to Analog 0 (A0) on the Arduino, it doesn't matter which side of the Hygrometer is connected to A0.

This connection also passes through the 10k Ohm resistor to 5V (we are splitting the load). It is the difference in load that the Arduino will detect on A0.

The other pin on the Hygrometer connects to GND on the Arduino.

If that's as far as you go ... you'd be done, of course you wouldn't be able to see any blinky lights ... but that's OK.

If you want to have a visual monitor of the moisture level, then you'll be wanting some LED.

I've used pins 13 (RED), 12 (GREEN) and 11 (BLUE) in my sketch, you can use others if you want ... I won't oppress you.

Connect Pin 13 to the anode of the red LED (long leg)

Connect a 220 ohm resistor between the red LED cathode (short leg) and to GND

Connect Pin 12 to the anode of the green LED (long leg)

Connect a 220 ohm resistor between the green LED cathode (short leg) and to GND

Connect Pin 11 to the anode of the blue LED (long leg)
Connect a 220 ohm resistor between the blue LED cathode (short leg) and to GND

That's it ... you're all wired up.

Step 2: Arduino Sketch

The guts of the sketch simply reads the value on A0, works out if the value falls within a predefined range (0 - 400 = Dry, 400 - 700 = Moist and 700 + = Wet).

It also turns the appropriate LED on and off according to the same range.

Because I have grand plans of connecting the device to a controller at some later stage, I'm also sending the output to Serial.

The entire sketch is very simple ... even I can understand it :)

The video simply shows the monitor transitioning between states of Dry/Moist/Wet ... with my ham fists in the action.

Oh, yeah ... please excuse my colour blindness ...

<p>Is it measuring capacitance or resistance?</p>
<p>Hey gustavio101,</p><p>It measures Resistance ... the large exposed pads work like a variable resistor. When there is more moisture present, there is greater conductivity between the pads and will result in lower resistance.</p>
Ok! Thanks for the reply. I'm looking for a way of making a sensor which measures capacitance rather then resistance since a resistance meter will rust and there's no way of isolating it. <br><br>Do you how to do that with Arduino, let's say by using lm555. Those are easy to find.
<p>Well, you don't need a 555 to measure capacitance. This article is pretty good &quot;<a href="http://www.circuitbasics.com/how-to-make-an-arduino-capacitance-meter/">How to make an Arduino Capacitance Meter</a>&quot;.</p><p>It's true that the probe will eventually rust and that means that it's ability to measure will be attenuated. However, it works for a long time :)</p><p>What you are suggesting is a good alternative, but you will still be pushing ions around and that will cause oxidization ... won't it?</p><p>Cheers</p><p>Baelzabubba</p>
Once again thank you very much for the well written reply. I need a capacitance meter since I will be measuring water and I don't want any oxidization since I will use that water.
<p>Nice one, please post an update when you finish it! Or better, post an instructable!</p><p>Cheers</p><p>Baelzabubba</p>
<p>An instructable it is, here's the link:</p><p><a href="https://www.instructables.com/id/Capacitance-Meter-With-TM1637-Using-Arduino/" rel="nofollow">https://www.instructables.com/id/Capacitance-Meter-...</a></p><p>Cheers</p><p>Gustavio</p>
<p>Just tested the meter and with some calibration I managed to get accurate readings from 1 uF to around 2000 uF which is precisely what I have been looking for.</p><p>Cheers </p><p>Gustav</p>
<p>Hey Gustav,</p><p>That's great news! Well done, and you're welcome. It's always gratifying to help someone along the way. To quote &quot;If I have seen further, it is because I have stood on the shoulders of giants&quot; (not suggesting that I'm a giant, at all).</p><p>Cheers</p>
<p>Also what about the commercial Arduino hygrometer? </p><p>http://www.ebay.com/itm/Soil-Hygrometer-Detection-Module-Soil-Moisture-Sensor-For-arduino-Smart-car-/400364471802</p>
<p>Well gustavio101 ... it looks pretty much the same to me :) except you get a moisture detector and probe, whereas I'm just using the probe and voltage splitting to analyse the resistance. However you wanna cut it ;)</p>
Thanks you for this instructable!
<p>You're welcome tchapple1</p>
thanks for the instructable, planning on making an automated flower watering system soon
<p>Excellent, that's pretty much what this circuit is designed for. Keep me posted on your progress! For smaller installations, simply using a gravity fed water reserviour and a solenoid is all that you need.</p>
That's actually the route I wanted to go. Much easier and simpler
would you want to switch the resistance on the red led since it has a lower voltage drop?
<p>Sure, you can switch the resistance if you need to. I tend to use 220 ohm for the LED that I have and, typically, different LED from different manufacturers have different forward voltage. 220 is a pretty safe resistor for most applications.</p>

About This Instructable

7,446views

69favorites

Bio: I have been working in IT since the mid 1980's. Most of that has been database and application development. I've been working on ... More »
More by baelza.bubba:Simple Breadboard Switchable Power Supply L293D Motor Direction Control for under $2.20 12V NE555 PWM Controller Under $3 
Add instructable to: