To design and implement a Techno Scare Crow that enhances agricultural efficiency and productivity through automation. The system will utilize various sensors and actuators controlled by an Arduino to monitor and manage key environmental and soil conditions.
Component Required:
- Arduino Uno: The microcontroller that forms the brain of the system, processing input from sensors and controlling actuators.
- Ultrasonic Sensor (HC-SR04): Used for detecting the presence of humans.
- Servo Motors (2x): One for rotating a module and another for roof control.
- Rain Sensor: Detects rain to control the roof mechanism.
- Light Dependent Resistor (LDR): Measures ambient light to control night lighting.
- Buzzer: Provides an audible alarm when the ultrasonic sensor detects a human.
- Soil Moisture Sensor: Monitors soil moisture levels for irrigation purposes.
- Water Pump: Used to irrigate the crops based on soil moisture sensor readings.
- Relay Module: Controls the water pump by interfacing it with the Arduino.
Components and Functionality:
Ultrasonic Sensor (HC-SR04) with Buzzer for Human Detection:
- Purpose: To detect human presence near the farming area and sound an alarm.
- Operation: The ultrasonic sensor measures distance, and if a human is detected within a predefined range (e.g., 50 cm), the buzzer is activated.
Servo Motor for Rotating Module (360 degrees):
- Purpose: To control a rotating mechanism, which could be used for various tasks such as spraying or monitoring.
- Operation: The servo motor is programmed to rotate a module 360 degrees continuously.
Rain Sensor with Servo Motor for Roof Control:
- Purpose: To automatically open or close a roof structure based on weather conditions to protect crops from rain.
- Operation: The rain sensor detects precipitation, and the servo motor adjusts the roof position (open or closed) accordingly.
Light Dependent Resistor (LDR) for Night Lighting:
- Purpose: To control lighting in the farming area during nighttime.
- Operation: The LDR senses ambient light levels, and if the light level drops below a certain threshold, it turns on a light source.
Soil Moisture Sensor with Water Pump:
- Purpose: To monitor soil moisture levels and automate irrigation.
- Operation: The soil moisture sensor checks the soil’s moisture content, and if it falls below a set threshold, the water pump is activated to irrigate the crops.
Circuit Diagram is given below:
Working Principle:
Human Detection:
- The ultrasonic sensor continuously monitors for any human presence. If a human is detected within a predefined distance, the buzzer sounds an alarm to notify the farmer.
Rotating Module:
- A servo motor is programmed to rotate a specific module 360 degrees, which can be used for tasks such as spraying pesticides or monitoring crops.
Rain-Based Roof Control:
- The rain sensor checks for precipitation. If rain is detected, the servo motor closes the roof to protect the crops. When the rain stops, the servo motor reopens the roof.
Night Lighting:
- The LDR monitors ambient light levels. When it gets dark, the LDR triggers a lighting system to illuminate the farming area.
Automated Irrigation:
- The soil moisture sensor constantly checks the soil’s moisture levels. If the soil becomes too dry, the Arduino activates the relay module, which turns on the water pump to irrigate the crops.
Code is given below:
#include <Servo.h>
Servo servoRotatingModule;
Servo servoRoof;
const int trigPin = 9;
const int echoPin = 10;
const int buzzerPin = 8;
const int rainSensorPin = A0;
const int ldrPin = A1;
const int soilMoisturePin = A2;
const int waterPumpPin = 7;
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(buzzerPin, OUTPUT);
pinMode(rainSensorPin, INPUT);
pinMode(ldrPin, INPUT);
pinMode(soilMoisturePin, INPUT);
pinMode(waterPumpPin, OUTPUT);
servoRotatingModule.attach(3);
servoRoof.attach(5);
Serial.begin(9600);
}
void loop() {
// Ultrasonic Sensor for Human Detection
long duration, distance;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration / 2) / 29.1;
if (distance < 50) {
digitalWrite(buzzerPin, HIGH); // Human detected
} else {
digitalWrite(buzzerPin, LOW); // No human detected
}
// Servo motor for rotating module
for (int pos = 0; pos <= 180; pos += 1) {
servoRotatingModule.write(pos);
delay(15);
}
for (int pos = 180; pos >= 0; pos -= 1) {
servoRotatingModule.write(pos);
delay(15);
}
// Rain sensor and roof control
int rainSensorValue = analogRead(rainSensorPin);
if (rainSensorValue < 500) { // Adjust threshold value based on your sensor
servoRoof.write(0); // Close roof
} else {
servoRoof.write(90); // Open roof
}
// LDR for light control
int ldrValue = analogRead(ldrPin);
if (ldrValue < 300) { // Adjust threshold value based on your sensor
// Turn on light (e.g., digitalWrite(lightPin, HIGH);)
} else {
// Turn off light (e.g., digitalWrite(lightPin, LOW);)
}
// Soil moisture sensor and water pump control
int soilMoistureValue = analogRead(soilMoisturePin);
if (soilMoistureValue < 300) { // Adjust threshold value based on your sensor
digitalWrite(waterPumpPin, HIGH); // Turn on water pump
} else {
digitalWrite(waterPumpPin, LOW); // Turn off water pump
}
delay(1000); // Delay for a while before next loop
}
Benefits:
- Increased Efficiency: Automation means less manual work is needed.
- Resource Conservation: Uses water and energy more efficiently.
- Crop Protection: Shields crops from bad weather and human interference.
- Enhanced Productivity: Provides the best growing conditions, leading to more crops.
Conclusion:
Techno Scare Crow is an innovative solution designed to revolutionize agricultural practices by integrating advanced automation and sensor technology. By leveraging the capabilities of an Arduino microcontroller, this system aims to monitor and manage key environmental and soil conditions, thereby enhancing agricultural efficiency and productivity.
Application:
Automated Pest Control: Reduces the need for human intervention in pest control.
Crop Protection: Minimizes crop damage and loss due to pests.
Sustainability: Utilizes solar power, making it environmentally friendly.
Data Collection: Provides insights into pest activity for better farm management.