Вы находитесь на странице: 1из 5

instructables

Arduino Soil Moisture Sensor

by goks_lf

When you hear the word Smart Garden, one of the Soil Moisture Sensor.
things that pop up to your mind is the automatic
measurement of the moisture content of the soil. In this Instructable, I'll show you how to interface the
If you're building a Smart Garden that waters plants Soil Moisture Sensor to an Arduino Uno and read the
automatically and give you the readings of the values on a Serial Monitor.
wetness of the soil, then you will definitely need a

Arduino Soil Moisture Sensor: Page 1


Step 1: Components Required

For this project, you will need :

Arduino Uno
Soil Moisture Sensor
Hook up Wires
Bread Borad.

Arduino Soil Moisture Sensor: Page 2


Step 2: About the Soil Moisture Sensor

A typical Soil Moisture Sensor consist of two components. A two legged Lead, that goes into the soil or anywhere
else where water content has to be measured. This has two header pins which connect to an Amplifier/ A-D circuit
which is in turn connected to the Arduino.

The Amplifier has a Vin, Gnd, Analog and Digital Data Pins. This means that you can get the values in both
Analog and Digital forms.

Step 3: How Does the Sensor Work

Most soil moisture sensors are designed to estimate soil increases. This response is due to the fact that
soil volumetric water content based on the the dielectric constant of water is much larger than
dielectric constant (soil bulk permittivity) of the the other soil components, including air. Thus,
soil. The dielectric constant can be thought of as the measurement of the dielectric constant gives a
soil's ability to transmit electricity. The dielectric predictable estimation of water content.
constant of soil increases as the water content of the

Arduino Soil Moisture Sensor: Page 3


Step 4: Connections

Connect the two pins from the Sensor to the two pins on the Amplifier circuit via hook up wires.
Connect the Vcc from the Amplifier to the 3.3V pin on the Arduino and the Gnd pin to the Gnd pin
on the Arduino.
Now connect the Analog Data Pin to the A0 pin on the Arduino (Since I'm interested in Analog
Data).

Refer the Pictures and build the circuit.

Step 5: Code

For simply reading the values I'll be using the AnalogRead sketch from the Examples menu. You can modify the
code as per your requirements.

void setup() { // initialize serial communication at 9600 bits per second:


Serial.begin(9600);
}

// the loop routine runs over and over again forever:


void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// print out the value you read:
Serial.println(sensorValue);
delay(1); // delay in between reads for stability
}

Arduino Soil Moisture Sensor: Page 4


Step 6: Output

After verifying the code, upload it to the board and open the serial monitor. You will see the sensor data on the
monitor being changed when you dip the sensor leads in water and when dry. You can use these values as
threshold if you intend to trigger an action bases on these values.

That's All Folks !! Stay Tuned for More !!

https://www.youtube.com/watch?v=iT1rNi0LkrY

Arduino Soil Moisture Sensor: Page 5

Вам также может понравиться