AUTOMATIC IRRIGATION SYSTEM - ARDUINO PROJECT
List of Components Used :
- Arduino Nano / Uno
- Soil Moisture Sensor
- 16 x 2 LCD Display
- Relay Module
- DC Motor Pump
- 9 V Battery
Circuit Diagram :
Check out the Video :
About the Project :
In this project we have done an Automatic Irrigation System. The main aim of the project is to water plants without manpower. After Setting up this project there's no need of watering the plant, the system will automatically water the plant if the moisture rate in the soil gets low and automatically stop watering, if the moisture rate goes high.
Code Explanation :
According to the code we have set the system in such a way that if the moisture rate is less than 50 % the motor will automatically on the motor which is connected to the relay. And if the moisture rate goes above 50% the motor will automatically off. The moisture rate and the condition of the motor is shown ithe 16x2 LCD display.
Source Code :
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 16 chars and 2 line display
int sensorValue = A0;
int output_value ;
void setup() {
lcd.init(); // Print a message to the LCD.
lcd.backlight();
pinMode(sensorValue, INPUT);
pinMode(8,OUTPUT);
digitalWrite(8,LOW); // Pin 8 connected to Relay (Motor)
Serial.begin(9600);
}
void loop() {
output_value = analogRead(sensorValue);
output_value = map(output_value, 550, 0, 0, 100);
Serial.println(output_value);
delay(1000);
if (output_value < 50)
{
lcd.clear();
lcd.setCursor(4,0);
lcd.print("MOTOR ON");
lcd.setCursor(0,1);
lcd.print("MOISTURE : ");
lcd.setCursor(11,1);
lcd.print(output_value);
lcd.setCursor(14,1);
lcd.print("%");
digitalWrite(8,HIGH);
}
else
{
lcd.setCursor(4,0);
lcd.print("MOISTURE");
lcd.setCursor(7,1);
lcd.print(output_value);
lcd.setCursor(10,1);
lcd.print("%");
}
}
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 16 chars and 2 line display
int sensorValue = A0;
int output_value ;
void setup() {
lcd.init(); // Print a message to the LCD.
lcd.backlight();
pinMode(sensorValue, INPUT);
pinMode(8,OUTPUT);
digitalWrite(8,LOW); // Pin 8 connected to Relay (Motor)
Serial.begin(9600);
}
void loop() {
output_value = analogRead(sensorValue);
output_value = map(output_value, 550, 0, 0, 100);
Serial.println(output_value);
delay(1000);
if (output_value < 50)
{
lcd.clear();
lcd.setCursor(4,0);
lcd.print("MOTOR ON");
lcd.setCursor(0,1);
lcd.print("MOISTURE : ");
lcd.setCursor(11,1);
lcd.print(output_value);
lcd.setCursor(14,1);
lcd.print("%");
digitalWrite(8,HIGH);
}
else
{
lcd.setCursor(4,0);
lcd.print("MOISTURE");
lcd.setCursor(7,1);
lcd.print(output_value);
lcd.setCursor(10,1);
lcd.print("%");
}
}
THANK YOU
SUBSCRIBE OUR CHANNEL FOR MORE PROJECTS : https://www.youtube.com/channel/UCk7q2iANcHsIOk_Lfu93q4g?view_as=subscriber
Comments
Post a Comment