Arduino Moisture Detection in Soil

by RaghavMehta in Circuits > Arduino

320 Views, 3 Favorites, 0 Comments

Arduino Moisture Detection in Soil

IMG-20210721-WA0004.jpg

This is a project used to reduce water wastage while watering plants.

Components Required

aruino.jpg

  1. Relay (x1)
  2. Arduino Uno (x1)
  3. Soil Moisture Sensor (x1)
  4. Motor (x1)
  5. Female to Female Jumper wire (x2), Male to Female Jumper wire (x6)

Connections

IMG_20210722_220414.jpg
IMG-20210721-WA0005.jpg
  1. Connect the two parts of the moisture sensor with each other using 2 female to female jumper wires.
  2. Connect three female to male jumper wires to the arduino:
    1. Connect 1 of the wires to the Ground slot of the arduino
    2. Connect another to V1n under Power slots.
    3. Connect the last wire to ~6 slot in Digital(pwm~)
  3. Connect the arduino with the relay using 3 male to female jumper wires.
    1. Connect the ground port on the relay with the ground port on the arduino
    2. Connect In2 of the relay with ~3 port under DIGITAL(pwm~) on the arduino
    3. Connect Vcc port of relay with 5v port under Power on the arduino
  4. Connect the wires of the motor in each slot of the relay.

Code

int w;
void setup() {

pinMode(3,OUTPUT);

pinMode(6,INPUT);

}

void loop() {

w= digitalRead(6);

if(w==HIGH)
{

digitalWrite(3,LOW);
} else {

digitalWrite(3,HIGH);

}

delay(400);

}

Process: How It Works?

Once the device is placed and switched on

  1. The soil moisture sensor detects the moisture in the soil.
  2. If it does not detect any moisture then, it sends a signal to the Arduino Uno.
  3. The Arduino Uno processes the signal and sends another signal to the relay.
  4. The relay switches on the motor to release provide water to the soil.
  5. Once the soil moisture sensor detects moisture, it sends signal back to Arduino to switch off the motor.
  6. The process repeats.

Results

Watering Plant using Arduino