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 the 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 are also provided below as you go ahead in this article. You can download it from there.
Let’s start with an Introduction:
In the 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 a simulation on Proteus 8 Professional Software.
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 moisturized.
- 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 20×4 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.
- Here’s the Block Diagram of Smart Irrigation System:
Here’s the list of components used in this project:
- Arduino UNO
- BMP180 Sensor
- DHT11 Sensor
- LDR Sensor
- MQ135 Gas Sensor
- Soil Moisture Sensor
- 20×4 LCD Display
- PCF8574 remote 8-bit I/O expander for the I2C bus
- 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.
- Power Supply
You can use a Battery, Adapter or any DC source of 5-8v(recommendable).
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.
These are the pin connections of all components.
|Pin Connections of Smart Irrigation System|
|1||Soil Moisture Sensor||Data – A0 (Arduino)|
|2||LDR Sensor||LDR-Resistor Junction – A2 (Arduino)|
|3||MQ135 Gas Sensor||Out – A1 (Arduino)|
|4||DHT11 Sensor||Data – D2 (Arduino)|
|5||BMP180 Pressure Sensor||SDA-SDA (Arduino)|
SCL – SCL (Arduino)
Arduino Libraries Required
You need to install these third-party Arduino Libraries, in order to interface sensors:
We have added comments in the 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.
Proteus Libraries Required
We will show you a demo of this project as a simulation. We are using Proteus 8 Professional Software for the simulation.
- 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
Proteus Simulation Connections
- 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.
- Download the Zip Files given at the start of this tutorial.
- Extract them in the LIBRARY folder. You will find it inside the Labcenter Electronics Folder.
- Go to Arduino IDE and open the code, go to Tools and select the board Arduino UNO.
- Go to Sketch and Click on Export Compiled Binary. It will create a compiled .hex file of the code which will be used as the main program in the simulation ahead.
- Open Proteus software and add components by searching like Arduino, DHT11, BMP180, 20×4 LCD, etc.
You can see the components listed here.
Note – We used a simple LED instead of the valve because the valve component is not available in the Software, simply replace the LED with a valve in a real project. Make connections according to the circuit diagram and add virtual terminals to Serial pins to see the readings and Data.
- Paste the Program File here for all the sensors.
- Paste the Compiled Binary File as a Program file of Arduino UNO.
- Run the simulation and you can see the readings by opening the virtual terminal.
Observations and Results
- In this simulation and project, you can see the sensor’s information first in the terminal.
- After that, we are getting well organized and easily understood data on the terminal by every sensor according to code.
- According to the code, when the value of the soil moisture sensor gets less than a threshold value, the LED gets on.
This means when the soil gets dry the valve will open and water will be provided to the crops.