Smart Irrigation System

Smart Irrigation System

Irrigation systems are essential for providing water to crops and plants in an efficient and controlled manner. Traditional irrigation systems are often wasteful and inefficient, as they do not take into account weather conditions or the needs of individual plants. In contrast, a smart irrigation system uses technology to monitor soil moisture levels and adjust watering accordingly, resulting in more efficient use of water and a healthier, more productive garden.

Smart Irrigation System

The smart irrigation system using Arduino is a low-cost and easy-to-implement solution for automating the watering of your plants. The system uses an Arduino micro-controller to control a pump or valve that provides water to your plants. A number of sensors, such as moisture sensors, are used to monitor the soil moisture levels, and the Arduino adjusts the amount of water being supplied based on this data.

One of the key benefits of using an Arduino in a smart irrigation system is the ease with which it can be programmed. The open-source nature of the platform means that there are a huge number of resources available online, including code examples, libraries, and tutorials. This makes it simple for even those with limited programming experience to get started with creating a smart irrigation system.

Another advantage of using an Arduino in a smart irrigation system is the flexibility it provides. By using a range of sensors and other components, it is possible to create a system that can be tailored to the specific needs of your garden. For example, you can set up a system that only waters when the soil moisture level is below a certain threshold or one that takes into account the amount of sunlight and temperature in your area.

To build a smart irrigation system using an Arduino, you will need the following components:

  • Arduino Uno or similar microcontroller
  • Relay module
  • Moisture sensor
  • Power supply
  • Water pump or valve

The basic principle of the system is as follows:

  1. The moisture sensor is placed in the soil to measure the moisture level.
  2. The data from the moisture sensor is read by the Arduino and processed.
  3. If the soil moisture level is below a certain threshold, the Arduino sends a signal to the relay module to turn on the water pump or valve.
  4. When the soil moisture level reaches the desired level, the Arduino sends a signal to the relay module to turn off the water pump or valve.

 

Smart Irrigation System

 

The code for the smart irrigation system using an Arduino

#define SENSOR_READ_DELAY 86400000 //This is the loop delay for sensor reading. Its in milli seconds. set it to 86400000 for once a day.
#define FULL_MOISTURE_READING 290
#define NO_MOISTURE_READING 595
#define CUT_OFF_MOISTURE_PERCENATGE 50
#define PUMP1_WATERING_TIME 2000 //This is millis
#define PUMP2_WATERING_TIME 2000 //This is millis
#define PUMP3_WATERING_TIME 2000 //This is millis
#define PUMP4_WATERING_TIME 2000 //This is millis

int pumpPin1=2;
int pumpPin2=3;
int pumpPin3=4;
int pumpPin4=5;

int inputSensorPin1=A0;
int inputSensorPin2=A1;
int inputSensorPin3=A2;
int inputSensorPin4=A3;

void setup() 
{
// put your setup code here, to run once:
pinMode(pumpPin1,OUTPUT);
pinMode(pumpPin2,OUTPUT);
pinMode(pumpPin3,OUTPUT);
pinMode(pumpPin4,OUTPUT);

digitalWrite(pumpPin1,HIGH);
digitalWrite(pumpPin2,HIGH);
digitalWrite(pumpPin3,HIGH);
digitalWrite(pumpPin4,HIGH);
}

void getMoisturePercentageAndWaterIt(int sensorValue, int outPinNo, int wateringTime)
{
sensorValue = constrain(sensorValue ,FULL_MOISTURE_READING, NO_MOISTURE_READING); 
int moisturePercentage = map(sensorValue, FULL_MOISTURE_READING, NO_MOISTURE_READING, 100, 0);

if (moisturePercentage < CUT_OFF_MOISTURE_PERCENATGE)
{
digitalWrite(outPinNo, LOW);
delay(wateringTime);
digitalWrite(outPinNo, HIGH);
}
}


void loop() 
{
// put your main code here, to run repeatedly:
int inputSensorPin1Value = analogRead(inputSensorPin1);
getMoisturePercentageAndWaterIt(inputSensorPin1Value, pumpPin1, PUMP1_WATERING_TIME);

int inputSensorPin2Value = analogRead(inputSensorPin2);
getMoisturePercentageAndWaterIt(inputSensorPin2Value, pumpPin2, PUMP2_WATERING_TIME);

int inputSensorPin3Value = analogRead(inputSensorPin3);
getMoisturePercentageAndWaterIt(inputSensorPin3Value, pumpPin3, PUMP3_WATERING_TIME);

int inputSensorPin4Value = analogRead(inputSensorPin4);
getMoisturePercentageAndWaterIt(inputSensorPin4Value, pumpPin4, PUMP4_WATERING_TIME);

delay(SENSOR_READ_DELAY);
}

Circuit Diagram Smart Irrigation System

Smart Irrigation System

In conclusion, a smart irrigation system using an Arduino is a low-cost and effective solution for automating the watering of your plants. By using technology to monitor soil moisture levels and adjust watering accordingly, you can save water, improve the health of your plants, and make gardening more efficient and enjoyable.

Add a Comment

Your email address will not be published. Required fields are marked *