MoistureMate-Smart Plant Hydration System

Published Aug 04, 2024
 14 hours to build
 Intermediate

This automated system uses a soil moisture sensor to precisely water your plants, ensuring they receive the right amount of hydration exactly when they need it, so your plants thrive with minimal effort.

display image

Components Used

LED 3mm
LED 3mm
1
2222A NPN Transistor
2222A NPN Transistor
1
Diode 1N400x
Diode 1N400x
1
Resistor 1 kOhms
Metal Film Resistors - Through Hole 1K ohm 1/4W 1%
1
MOTOR
A motor is included to rotate the spinner part of the project in order to whisk the fluid present in the container to find its viscosity.
1
Description

Gather Your Materials:

  • Arduino microcontroller 
  • Soil moisture sensor
  • Motor
  • Power supply (battery or adapter)
  • Jumper wires
  • Water container/reservoir
  • Resistor, Diode and LED
     

Assemble the Circuit:

  • Connect the soil moisture sensor to the Arduino following the pinout diagram provided with the sensor.
  • Connect the water pump to the Arduino. You may need to use a relay module if the pump operates at a higher voltage than the Arduino can handle.
  • Power the Arduino using the power supply.

Program the Arduino:

  • Write a program (sketch) for the Arduino that reads the soil moisture sensor's values.
  • Set a moisture threshold value in the program. This will determine when the pump should be activated to water the plant.
  • Program the Arduino to control the water pump. When the soil moisture level drops below the threshold, activate the pump to water the plant for a specified duration.
const int sensorPin = A0; // Soil moisture sensor is connected to analog pin A0
const int transistorPin = 8;   // Transistor base is connected to digital pin 8

int sensorValue = 0;      // Variable to store the value from the sensor
int threshold = 300;      // Threshold value for dry soil (adjust as needed)

void setup() {
  pinMode(sensorPin, INPUT);
  pinMode(transistorPin, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  sensorValue = analogRead(sensorPin); // Read the value from the soil moisture sensor
  Serial.print("Soil Moisture Value: ");
  Serial.println(sensorValue);

  if(sensorValue < threshold) {
    digitalWrite(transistorPin, HIGH); // Turn on the transistor (LED ON, pump ON)
    Serial.println("Soil is dry. Pump is ON.");
  } else {
    digitalWrite(transistorPin, LOW);  // Turn off the transistor (LED OFF, pump OFF)
    Serial.println("Soil is wet. Pump is OFF.");
  }
  delay(1000); // Wait for a second before reading the sensor again
}

Test the System:

  • Upload the program to the Arduino.
  • Place the soil moisture sensor in a pot of soil and connect it to the Arduino.
  • Fill the water container/reservoir with water and connect it to the water pump.
  • Power on the system and observe its behavior. Ensure that the pump activates when the soil moisture level is below the threshold.

Install and Deploy:

  • Once tested, install the system in the desired location near your plants.
  • Place the soil moisture sensor in the soil of the plant you want to water.
  • Position the water container/reservoir above the plants, ensuring the tubing can deliver water to the soil.
  • Secure all components in place and tidy up any loose wires.

 

Codes

Downloads

schematic Download

Institute / Organization

St Josephs institute of technology
Comments
Ad