Smart Drip Irrigation Using Sajilobot and resistive soil moisture sensor
Project Link: Smart Drip Irrigation.
In this article we are going to learn How to make Smart Drip Irrigation System Using SajiloBot, DC Motor Pump and Resistive SMC[Soil Moisture Sensor]
Materials Required:
1) SajiloBot[Needs cp2102 Uploader] or Arduino[Needs Motor Driver Module]
2) Soil Moisture Sensor
3) DC Motor Pump
4)Jumper Wires
5) Pipes and fittings
Working Logic:
When the soil is dry the value is High and if the soil is wet The value is low So we activate the Device when the value is High and Deativate When the Value is Low
Arduino Code:
/* CODE customized for SajiloBot
by MRS */
#define MP1 2 // Motor pin 1 connected to digital pin 2
#define MP2 3 // Motor pin 2 connected to digital pin 3
#define MEN 9 // Motor enable pin connected to digital pin 9
#define SP A3 // Soil moisture sensor pin connected to analog pin A3
void setup() {
pinMode(MP1, OUTPUT); // Set motor pins as outputs
pinMode(MP2 , OUTPUT);
pinMode(MEN , OUTPUT); // Set motor enable pin as output
}
void loop() {
int mL = analogRead(SP); // Read soil moisture level
if (mL /100> 5) { // If moisture level/100 is above 5
digitalWrite(MEN, HIGH); // Enable the motor
digitalWrite(MP1, HIGH); // Turn motor in one direction
digitalWrite(MP2, LOW);
} else { // If moisture level/100 is below 5
digitalWrite(MEN, LOW); // Disable the motor
}
delay(1000); // Wait for 1 second before next reading
}