In this project, we will make an automatic irrigation system using Arduino microcontroller. Automatic Irrigation system monitors the soil moisture and depending on set points turns on/off the pump which is connected to the relay. This way you can keep soil moisture to a set point.
This system automatically waters the plants when we are on vacation. As we are setting the soil moisture level, we need not worry about too much of watering and the plants end up dying anyway.
The project is designed to develop an automatic irrigation system which switches the pump motor ON/OFF on sensing the moisture content of the soil. This project requires Arduino board having inbuilt ATMega328
microcontroller.
An automated irrigation system will minimize the excess wastage of water and the labor and other overheads.
In the field of agriculture, use of a proper method of irrigation is important. The advantage of using this method is to reduce human intervention and still ensure proper irrigation.
Components Required for this Project
- Arduino Uno
- Soil moisture sensor
- 16×2 LCD
- 1K, 220E Resistors
- 12V Relay
- BC548 Transistor
- Switches
Automatic Irrigation System Circuit
Working of Automatic Irrigation System
Automatic Irrigation System Arduino Code
/*Automatic Irrigation System*/#include <LiquidCrystal.h>// initialize the library with the numbers of the interface pinsLiquidCrystal lcd (9, 8, 7, 6, 5, 4);const int LED_RED =10; //Red LEDconst int LED_GREEN =11; //Green LEDconst int RELAY =12; //Lock Relay or motor//Key connections with arduinoconst int up_key=3;const int down_key=2;int SetPoint =30;//=================================================================// SETUP//=================================================================void setup (){pinMode ( LED_RED , OUTPUT );pinMode ( LED_GREEN , OUTPUT );pinMode ( RELAY , OUTPUT );pinMode ( up_key, INPUT );pinMode ( down_key, INPUT );//Pull up for setpoint keysdigitalWrite ( up_key, HIGH );digitalWrite ( down_key, HIGH );// set up the LCD's number of columns and rows:lcd . begin(16, 2);// Print a message to the LCD.lcd . print ("studyelectrical.com");lcd . setCursor (0,1); //Move coursor to second Linelcd . print (" Irrigation ");delay(1000);lcd . setCursor (0,1);lcd . print (" System ");digitalWrite ( LED_GREEN , HIGH ); //Green LED Off digitalWrite ( LED_RED , LOW ); //Red LED OndigitalWrite ( RELAY , LOW ); //Turn off Relaydelay(2000);}//=================================================================// LOOP//=================================================================void loop (){double WaterLevel = ((100.0/1024.0) * analogRead ( A0 )); //Map it in 0 to 100%lcd . setCursor (0,0);lcd . print ("Water :"); //Do not display entered keyslcd . print ( WaterLevel );lcd . print ("% ");//Get user input for setpointsif( digitalRead ( down_key)== LOW ){if( SetPoint >0) //Not less than zero{SetPoint --;}}if( digitalRead ( up_key)== LOW ){if( SetPoint <99) //Not more than 100%{SetPoint ++;}}//Display Set point on LCDlcd . setCursor (0,1);lcd . print ("Set Point:");lcd . print ( SetPoint );lcd . print ("% ");//Check Temperature is in limitif( WaterLevel > SetPoint ){digitalWrite ( RELAY , LOW ); //Turn off water pumpdigitalWrite ( LED_RED , HIGH );digitalWrite ( LED_GREEN , LOW ); //Turn on Green LED}else{digitalWrite ( RELAY , HIGH ); //Turn on water pumpdigitalWrite ( LED_GREEN , HIGH );digitalWrite ( LED_RED , LOW ); //Turn on RED LED}delay(100); //Update at every 100mSeconds}//=================================================================






Comments are closed.