If you’re coming up with your own intelligent “GreenHouse”  with an facultative digital plant moisture sensor/water pump controller that lights an LED to alert the user once it’s time to water a potted plant, and/or activate a pump to quench the thirst, here is an Arduino Primer for you.

No doubt, an Arduino will convert your favorite pots into self-watering planters, keeping your plants from drying out and reducing the time you spend watering. Self-watering system is good for individuals often on vacation, and takes the idea out of watering. Plants draw up wetness as they have it!

Hardware

The hardware consists of an Arduino microcontroller (here an Arduino Uno R3) and a pre-wired soil moisture detector module. The soil moisture detector module, designed round the LM393 comparator, offers an active-low (L) level output once the soil is dry (determined by a pre-setted threshold value). This digital output (wet soil → L / dry soil → H) is routed to 1 I/O terminal (D2) of the Arduino microcontroller. Supported this input (at D2) arduino offers an active-high (H) output through D13 once soil is dry, and an active-low (L) output once soil is wet.

table

soil moisture sensor module

(soil moisture sensor module)

Software

This “demo” code here will simply be an equivalent as alternative consistent programs. This code controls the LED connected to pin D13 in reference to the input level on Pin D2. D13 output may be accustomed enable/disable a water pump/similar controller electronic equipment.

Hook Up Note

The +5V route (VCC) of the module is coupled to the 5V line of the Arduino. GND of the module is that the common (0V) affiliation. The digital signal output to be detected (usually marked as neutralize the module) is applied to D2 input of the Arduino. Analog output (marked as AO) from the module isn’t used here. Sensor-head of the module contains 2 probes in a very little metal PCB. Once the sensor-head is inserted in wet soil, moisture bridges the probes through a low-resistance path (when soil is dry, resistance between the probes is additionally high). A potentiometer is enclosed within the module for adjusting the soil wet/dry detection sensitivity in keeping with actual necessities.

AS-3

Analog Link

It is conjointly possible to read the number of moisture present within the soil (for deciding whether or not the soil is wet or dry) by linking the analog output (AO) of the module, to 1 analog input (A0) of the Arduino. Here is the test code that indicates the soil wet/dry conditions using simply 2 LEDs (green & red).

Zero – Arduino Try Out

From the circuit diagram of the module, it’s clear that, except for the module solely some external parts are required to make a relay-driver circuit. Yes, there’s an opportunity to understand one easy non-arduino project of a forgetful plant waterer! If you’re searching for this feature, digital output of the module should be connected to the tiny circuit shown below, and use an external 5V DC power supply.

AS-4

If higher current loads are to be driven a PNP semiconductor can be superimposed to the module’s digital output. Here the addition of 2N3906 semiconductor controls an electro-magnetic relay (RL1) for driving high-current/high voltage loads like pump motors through its N/C contacts (when soil is wet, relay remains in energised state).