TechieYan Technologies

Smart Irrigation System Using GSM Module

smart irrigation system using GSM

Abstract

In this smart irrigation system using GSM project an automatic plant watering system based on Arduino has been developed. Multiple sensors are used like soil moisture sensors, which assist in the auto-detection of water requisition in the soil. The DHT11 is a humidity and temperature sensor that measures air temperature and humidity. Soil relative humidity, air temperature, soil temperature, and air relative humidity are all measured and the gsm module is used which will send a message to mobile to get an alert. A Servo motor is used to insert the seed into the soil. Through this project, one can improve the plan’s crop quality and health by increasing the performance measure. The development of an smart irrigation system using GSM module or Automatic Plant Irrigation System which is capable of detecting moisture loss in the soil is proposed in this project. It specifically uses the Soil Moisture Sensor to detect water content levels within the soil and provide appropriate system responses based on the detected condition

Introduction

Agriculture is the primary source of the Indian economy. The majority of clean water resources are used in agriculture. This smart irrigation system using GSM project aims to develop an automated irrigation mechanism that turns the pumping motor ON and OFF by itself and an automatic message is generated. Most farmers around the world struggle to keep their crops watered properly, but they are powerless to do so. This system will allow farmers to irrigate their land without the need for additional manpower. The system is user-friendly and has simple circuitry which will make the user operate the system easily. It is only necessary to connect the pump to the circuit and connect the circuit and sensors completely. The system will start to work immediately after powering up and will not require any triggers. The goal of the project is to use sensors to detect soil dryness and provide appropriate water to the plants whenever it is necessary and add seeds into the soil.

Components Required

Hardware Requirements

  • Arduino Uno : Arduino Uno is a microcontroller from the Arduino Family. It was developed by Arduino. cc and is based on the Microchip ATmega328P microcontroller. Uno has 20 I/O pins, of which  6 are analog and 14 are digital pins.

For more details,  pinout and datasheet, you can visit : https://docs.arduino.cc/hardware/uno-rev3

  • Dht11Digital Humidity and Temperature (Dht) sensor is used to find the amount of humidity present in the air.
  • Soil moisture sensor: A soil moisture sensor is used to find the amount of moisture present in the soil.
  • Motor: It is an electric machine that converts electrical energy into mechanical energy.
  • Relay:  used to operate AC devices like lights, fans, etc. it is basically a switch. It works on the principle of electromagnetism. It takes DC power as input and gives out AC power.
  • GSM module: global system for mobile communication (GSM) module is used to send and receive data/messages.
  • Servo motor (90): It is an electromechanical device used for rotatory purposes with precise precisions.

Software Requirements

  • Arduino Ide : Arduino IDE (Integrated development environment) is software that is used to dump the program into boards. Arduino- IDE’s major use is to build electronics-related projects. Arduino is an open-source platform simple and easy-to-understand platform for coding. 

HOW TO INSTALL ARDUINO IDE CLICK ON THE LINK :

https://techieyantechnologies.com/2022/10/installation-of-arduino-ide/

Block diagram

The block diagram of smart irrigation system using GSM system describes the relationship between the input devices and output devices. Here in this case input devices are a DH11 sensor, a soil moisture sensor and that sends the information to Arduino where the output is transmitted to the specific devices such as a relay to turn the motor on and off

smart irrigation system using GSM block diagram

Flow Chart

First the data is taken from the DHT sensor and soil moisture sensor. If the data is given by the sensors then the servo motor will be activated else it will not be activated and an alert message will be sent to the user.

flow chart of smart irrigation system using GSM

*website used to make Flow Chart and Block Diagram :  https://www.lucidchart.com/pages/

Pin Wiring

DHT11

The VCC pin of the DHT11 sensor is connected to the 5v pin of the Arduino. The data pin of the DHT11 sensor is connected to the D4 pin of the Arduino. The NC pin of the DHT11 sensor is not connected to any pin of the Arduino. The GND pin of the  DHT11 sensor is connected to the GND pin of the Arduino.

GSM

The 5v pin of the GSM module is connected to the 5v pin of the Arduino. The GND pin of the GSM module is connected to the GND pin of the Arduino. The VCC pin of the GSM module is connected to the 5v pin of the Arduino. The SIM_TX pin of the GSM module is connected to the RXD pin of the Arduino. The SIM_RX pin of the GSM module is connected to the TXD pin of the Arduino. The GND pin of the GSM module is connected to the GND pin of the Arduino. The RST pin of the GSM module is not connected to any pin of the Arduino.

smart irrigation system using GSM pin connection of GSM module to Arduino

Soil Hygrometer Sensor

The VCC pin of the Soil hygrometer sensor is connected to the 5v pin of the Arduino. The A0 pin of the Soil hygrometer sensor is connected to the A7 pin of the Arduino. The D0 pin of the Soil hygrometer sensor is not connected to any pin of the Arduino. The GND pin of the  Soil hygrometer sensor is connected to the GND pin of the Arduino.

smart irrigation system using GSM Module soil hygrometer to Arduino pin wiring table

Relay

The VCC pin of the relay is connected to the 5v pin of the Arduino. The IN pin of the relay is connected to the 3rd pin of the Arduino. The GND pin of the relay is connected to the GND pin of the Arduino.

Servo SG90

servo SG90 has three wires. connect the orange/yellow wire of the servo to D7 of the Arduino. connect the red wire of the servo to the 5v of the Arduino. connect the brown wire of the servo to the GND pin of the Arduino.

smart irrigation system using GSM module servo pin wiring table

Circuit diagram

Note: make sure to take proper precautions while connecting the components.

Circuit diagram to show components connection to Arduino for smart irrigation system using GSM module

Working

The working process of smart irrigation system using GSM module is as follows. The data taken by the humidity sensor and soil moisture sensor are first converted to electrical signals and sent analog data to the controller. When the amount of moisture in the soil and humidity decreases,  the motor will be turned on immediately with the help of a relay so that the plants can get water. Activation and deactivation of the motor will depend on the values given by the sensors. If the sensors are unable to get or send data to the microcontroller then an alert message will be sent to the user.

Conclusion

Hence, a Arduino bases smart irrigation system using GSM module has been successfully built. With this system plant watering has been automated.

Working Code

#include <dht11.h>                 //this will provide an easy and inexpensive way to get temperature and humidity measurements
#include<Servo.h>                  //Using the Arduino as the controller device,the library enables to control the servo motor
#define DHT11PIN 4                 //defineing the pin 4 is attached to arduino uno
#define soilmoisture A5            // defining the pin A5 is attached to arduino uno
#define relay 3                    //defining the pin 3 is attached to arduino uno                 

dht11 DHT11;
int value;
Servo Myservo;                      //initialize a servo object to control a servo
int pos;                            //initization position of servo motor 
int water;                          //random variable 
void setup() {
    Serial.begin(9600);
    pinMode(relay ,OUTPUT);         //output pin for relay board, this will sent signal to the relay
   // pinMode(A5,INPUT);            //input pin coming from soil sensor
    Myservo.attach(7);
}
void dht11()
{
  Serial.println();

  value = DHT11.read(DHT11PIN);

  Serial.print("Humidity (%): ");
  Serial.println((float)DHT11.humidity, 2);

  Serial.print("Temperature (C): ");
  Serial.println((float)DHT11.temperature, 2);

  delay(2000);

}


void loop() { 
  water = analogRead(soilmoisture);  // reading the coming signal from the soil sensor
  Serial.print(water);
  if(water == HIGH) 
  {
   gsm();
   digitalWrite(3,LOW);             // turn on the relay 
   for(pos=0;pos<=180;pos++){       // turn on the servo motor 
   Myservo.write(pos);
   delay(15);
}
  delay(1000);
  }
  else
  {
  digitalWrite(3,HIGH);             //high to continue proving signal and water supply
  for(pos=180;pos>=0;pos--){
  Myservo.write(pos);
  delay(15);
}
  delay(1000);
  }
  delay(400); 
}

//function for GSM 
void gsm()
{
  Serial.print("\r");                       // start the message 
    delay(1000);                            // 1 second delay
  Serial.print("AT+CMGF=1\r");              //sets the GSM modem in SMS Text Mode 
    delay(1000);                            // 1 second delay
  Serial.print("AT+CMGS=\"+91xxxxxxxxxx\"\r");  //replace x with the mobile number you want to send the message.
    delay(1000);                            // 1 second delay
  Serial.print("TechieYan Technologies\r"); // Message you want to send
    delay(1000);                            // 1 second delay
  Serial.println((char)26);                 // CTRL+Z is given to GSM to end the sms. So the ASCII value of CTRL+Z is 26.
    delay(1000);                            // 1 second delay 
  }

If You Face Any Issue Feel Free To Contact us Any Time.

+91 7075575787