Smart Irrigation System by Arduino UNO

Smart Irrigation System using Arduino UNO

Hello everyone, we are back with a new project and we hope you all are doing well. In this article we will discuss a project named Smart Irrigation System using Arduino UNO. We will use different sensors to measure the environmental and crop parameters which are responsible for good production. We will also make the water pump system automatic which will open the water valve automatically according to soil moisture of the crop.

We will discuss all points and concepts briefly in this article and also provide a Proteus Simulation to observe how it will work in the real world.

Complete fully explained code and simulation is also provided below as you go ahead in this article. You can download it from there.

For any queries and doubts, you can contact -

Contact - Tushar Gupta

Email - tushartg600@gmail.com

Let’s start from Introduction.

Introduction

In late decades, there has been a quick advancement in Smart Agricultural Systems. Show that agriculture has great importance worldwide. Indeed, in India for example, about 70 % of the people rely upon the vital sector of agriculture. In the past, irrigation systems used to be dependent on the mills to irrigate the farm by conventional methods without knowing the appropriate quantities of these crops.

These old systems are a major cause of the waste of large quantities of water and thus destroy some crops because of the lack of adequate quantities of water. However, with the recent technological developments, there have been innovative systems for irrigation without the farmer interfering in the irrigation process. We will discuss it in brief below.

We will do simulation on Proteus 8 Professional Software.

Working

The working of this project is like, we will use a Soil Moisture sensor for measuring the moisture of Soil according to which water valves are controlled. When the moisture level gets below a threshold value, valves will open with the help of a relay or solenoid till the soil is well moisturised.

The BMP180 sensor will measure the Atmospheric Pressure.

The DHT11 sensor will measure the Temperature and humidity of the climate.

The MQ135 sensor will measure the Air Quality Index of the environment.

LDR will measure the sunlight intensity.

We will use a 20x4 LCD Screen for displaying the data gathered from the sensors.

And the main thing, we will use an Arduino UNO microcontroller as the brain of the project.

In a used case, when the moisture level gets below a threshold value, valves will open with the help of a relay or solenoid for a required time interval.

Block Diagram -

Requirements for Project -

  1. Arduino UNO

The Arduino Uno is a type of Arduino board that is provided as an open-source board that uses an ATmega328p microcontroller in the board. The Arduino Uno contains a set of analog and digital pins that are input and output pins which are used to connect the board to other components.

  1. BMP180 Sensor

BMP180 is one of the sensors of the BMP XXX series. They are all designed to measure Barometric Pressure or Atmospheric pressure. BMP180 is a high precision sensor designed for consumer applications. Barometric Pressure is nothing but the weight of air applied on everything. The air has weight and wherever there is air its pressure is felt. The BMP180 sensor senses that pressure and provides that information in digital output. Also the temperature affects the pressure and so we need temperature compensated pressure reading. To compensate, the BM180 also has a good temperature sensor.

  1. DHT 11 Sensor

DHT11 is a low-cost digital sensor for sensing temperature and humidity. This sensor can be easily interfaced with any micro-controller such as Arduino, Raspberry Pi etc… to measure humidity and temperature instantaneously.

The DHT11 humidity and temperature sensor is available as a sensor and as a module. The difference between this sensor and module is the pull-up resistor and a power-on LED. DHT11 is a relative humidity sensor. To measure the surrounding air this sensor uses a thermistor and a capacitive humidity sensor.

  1. LDR Sensor

An LDR or light dependent resistor is also known as a photoresistor, photocell, or photoconductor. It is a one type of resistor whose resistance varies depending on the amount of light falling on its surface.

When the light falls on the resistor, then the resistance changes. These resistors are often used in many circuits where it is required to sense the presence of light. These resistors have a variety of functions and resistance. For instance, when the LDR is in darkness, then it can be used to turn ON a light or to turn OFF a light when it is in the light. A typical light dependent resistor has a resistance in the darkness of 1MOhm, and in the brightness a resistance of a couple of KOhm

  1. MQ135 Gas Sensor

MQ135 Gas Sensor module for Air Quality with Digital as well as Analog output. Sensitive material of the MQ135 gas sensor is SnO2, which has lower conductivity in clean air. When the target combustible gas exists, The sensor’s conductivity is higher along with the gas concentration rising. The MQ135 gas sensor has high sensitivity to Ammonia, Sulphide and Benze steam, also sensitive to smoke and other harmful gases. It is low cost and suitable for different applications.

  1. Soil Moisture Sensor

A Soil Moisture Sensor is one kind of low-cost electronic sensor that is used to detect the moisture of the soil. This sensor can measure the volumetric content of water inside the soil. This sensor consists of mainly two parts, one is Sensing Probes and another one is the Sensor Module. The probes allow the current to pass through the soil and then it gets the resistance value according to the moisture value in soil. The Sensor Module reads data from the sensor probes and processes the data and converts it into a digital/analog output. So, the Soil Moisture Sensor can provide both types of output: Digital output (DO) and Analog output(AO).

  1. 20x4 LCD Display

We will use a 20x4 LCD screen for displaying the data.

We will use a PCF8574 remote 8-bit I/O expander for the I2C bus. It will make the display I2C compatible. We can control the LCD by only 2 pins with the help of this by I2C protocol.

  1. PCF8574 remote 8-bit I/O expander for the I2C bus

The PCF8574 is an I2C bus to 8-bit parallel bus IO expander IC. It provides GPIO expansion for many microcontrollers in a simple and cost-effective method. The interface for this IC is I2C (or I2C) using SDA (Data) and SCL (Clock) lines.

  1. Breadboard

  2. Jumper wires (Male to Male, Male to Female, Female to Male.)

Since we are designing a prototype of this project, we will use jumper wires instead of soldering.

  1. Power Supply

You can use a Battery, Adapter or any DC source of 5-8v(recommendable).

Circuit Diagram -

Since we are making a prototype of this project, we will make connections on the breadboard and avoid soldering the components. We will use male to male, male to female and female to female jumper wires.

Pins Connections

These are the pin connections of all components.

  1. Soil Moisture Sensor

Data - A0 (Arduino)

  1. LDR Sensor

LDR-Resistor Junction - A2 (Arduino)

  1. MQ135 Gas Sensor

Out - A1 (Arduino)

  1. DHT 11 Sensor

Data - 2 (Arduino)

  1. BMP 180 Pressure Sensor

SDA-SDA (Arduino)

SCL - SCL (Arduino)

  1. LCD Screen

SDA - SDA (Arduino)

SCL - SCL(Arduino)

Code

You can get the fully explained code for the link below. Click to download.

Here is the link…

Paste code link here.

Please must Install the Libraries for proper working of the code:

  1. Adafruit_BMP085.h
  2. DHT.h
  3. LiquidCrystal_I2C.h

We have added comments in code for better understanding so it can be understood easily.

Note - Change the Address of the LCD Screen while you run the code in Proteus, change it to 0x20 instead of 0x27 or anyone else. In the real experiment we can alter the address of the LCD by changing the configurations of A0, A1 and A2 pins of the PCF8574 module.

We can make eight different addresses by making different configurations of A1, A2 and A3 pins by making them either HIGH or LOW.

The configurations are:

Here 0 means HIGH, 1 means LOW.

Simulation Part

We will show you a demo of this project as a simulation,

We are using Proteus 8 Professional Software for the simulation.

Pre Requirements - Must install the Proteus Libraries of the required components from the given links below.

Proteus Software Download from here - Download Proteus - Try Proteus EDA Software - Labcenter Electronics

Soil Moisture Sensor Library for Proteus - Downloads - The Engineering Projects

Gas Sensor Library for Proteus - Downloads - The Engineering Projects

LCD Library for Proteus - Downloads - The Engineering Projects

Simulation Connections

Note -

  • This potentiometer defines the soil water content in the proteus simulation.
  • When the resistance is maximum at the test pin, the circuit shows zero volts across the voltmeter, which means the sensor is either in the dry ground or taken out of the ground, i.e. giving zero moisture value of the water content.
  • And when resistance is zero, the circuit will show the maximum voltage across the voltmeter which indicates the sensor is inserted in a wet ground i.e. water contents in the soil are too high.
  • This is important. We have attached the output pin with an LC filter. This filter is not required in real hardware implementation.
  • We are using it in Proteus Simulation only as Proteus gives the peak-to-peak value and we have to convert that PP value into Vrms.
  • If you are working on a real sensor then you don’t need to add this LC circuit.
  • Similarly for Gas sensor, as we increase the potentiometer, in simulation it means good air quality.

Steps for Simulation-

These are the steps for simulation. Follow them to create a fully working simulation.

  1. Download the Zip Files which are given above.
  2. Extract them in the LIBRARY Folder. You will find it inside the Labcenter Electronics Folder.

  1. Go to Arduino IDE and open the code, go to Tools and select the board Arduino UNO.

  1. Go to Sketch and Click on Export Compiled Binary. It will create a compiled .hex file of the code which will be used as a main program in the simulation ahead.

  1. Open the Proteus Software and make a new project, select the project location and click on Next until the project is created.

  1. Click here to add components.

  1. Add components by searching like Arduino, DHL11, BMP180, 20x4 LCD, etc.

You can see the components listed here.

Note - We used simple LED instead of valve because valve component is not available in the Software, simply replace valve with LED in real project. Make connections according to the circuit diagram and add virtual terminals to Serial pins to see the readings and Data.

  1. Paste the Program File here for all the sensors.

Paste .TEP files of the corresponding sensors.

  1. Paste the Compiled Binary File as a Program file of Arduino UNO.

  1. Run the simulation and you can see the readings by opening the virtual terminal.

Simulation

You can download the complete simulation from the link at the end of the article.Smart Irrigation by Arduino UNO.rar (174.4 KB)

Observations and Results

  1. In this simulation and project, you can see the sensor’s information first in the terminal.

  2. After that we are getting a well organised and easily understood data on the terminal by every sensor according to code.

  3. According to code, when the value of the soil moisture sensor gets less than a threshold value, the LED gets on.

Means, when the soil gets dry the valve will open and water will be provided to the crops.

You can see in the image below.

That is the end of the project. We hope you liked it. Thanks for reading this article.

Contact - Tushar Gupta

Email - tushartg600@gmail.com

For any kind of queries and doubts.Smart Irrigation by Arduino UNO.rar (174.4 KB)

1 Like

Nice works.

Found the connection diagram is a bit too small, can not really see the connections, such as what is the 2nd device at the bottom right?

Would you explain the work flow of the system a bit? At what condition will the system think the plant will need to be irrated? What is the air pressure sensor for ? Can the system predict weather?

1 Like

Please connect me on Whatsapp for more details and queries. I will send you the clear images of this project.
Contact - +918005791568
Thank you dear.

Thanks for it Tushar, I don’t use WhatsApp so unfortunately I can’t contact you through it.

But thanks anyway.