Solar-Powered Bird Repellant System with Arduino and Servo Motors
View and Edit Project In Cirkit Designer
Solar-based Bird Repellant System Documentation
Summary
This system is designed to deter birds using a combination of sound and motion. It employs a passive buzzer to emit a frequency that deters birds and uses servo motors to create motion, further enhancing the deterrent effect. The system is powered by a solar panel and a 12V battery, with a step-down converter providing 5V to the components. A PIR motion sensor detects the presence of birds and triggers the deterrent actions.
Component List
Servo Motor MG996R
- Pins: PMW, VCC 5V, GND
- Description: High-torque servo motor used for creating motion.
Passive Buzzer
- Pins: S output signal, +VCC, GND
- Description: Emits a frequency to deter birds.
HC-SR501 PIR Motion Sensor
- Pins: Output, Ground, Power Supply
- Description: Detects motion to trigger the deterrent actions.
LED: Two Pin (green)
- Pins: cathode, anode
- Description: Indicates system status.
LED: Two Pin (red)
- Pins: cathode, anode
- Description: Indicates bird detection.
Resistor (200 Ohms)
- Pins: pin1, pin2
- Description: Current limiting resistor for LEDs.
Arduino UNO
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
- Description: Microcontroller used to control the system.
Battery 12V
- Pins: -, +
- Description: Provides power to the system.
Solar Panel
- Pins: +, -
- Description: Generates power from sunlight.
Charge Controller
- Pins: Solar Positive, Solar Negative, Battery Positive, Battery Negative, Load Positive, Load Negative
- Description: Manages power from the solar panel and battery.
12V to 5V Step Down Power Converter
- Pins: VIN 9v-36v, VIN+, VIN-, USB OUTPUT 5V, 5v OUTPUT, GND
- Description: Converts 12V to 5V for the components.
Wiring Details
Servo Motor MG996R (1)
- PMW: Connected to Arduino UNO D10
- VCC 5V: Connected to 12V to 5V Step Down Power Converter 5v OUTPUT
- GND: Connected to Arduino UNO GND
Servo Motor MG996R (2)
- PMW: Connected to Arduino UNO D9
- VCC 5V: Connected to 12V to 5V Step Down Power Converter 5v OUTPUT
- GND: Connected to Arduino UNO GND
Passive Buzzer
- S output signal: Connected to Arduino UNO D8
- +VCC: Connected to 12V to 5V Step Down Power Converter 5v OUTPUT
- GND: Connected to Arduino UNO GND
HC-SR501 PIR Motion Sensor
- Output: Connected to Arduino UNO D2
- Ground: Connected to Arduino UNO GND
- Power Supply: Connected to 12V to 5V Step Down Power Converter 5v OUTPUT
LED: Two Pin (green)
- cathode: Connected to Arduino UNO GND
- anode: Connected to Resistor pin1
- Resistor pin2: Connected to Arduino UNO D6
LED: Two Pin (red)
- cathode: Connected to Arduino UNO GND
- anode: Connected to Resistor pin1
- Resistor pin2: Connected to Arduino UNO D4
Arduino UNO
- 5V: Connected to 12V to 5V Step Down Power Converter 5v OUTPUT
- GND: Connected to 12V to 5V Step Down Power Converter GND
Battery 12V
- -: Connected to 12V to 5V Step Down Power Converter VIN-
- +: Connected to 12V to 5V Step Down Power Converter VIN+
Solar Panel
- +: Connected to Charge Controller Solar Positive
- -: Connected to Charge Controller Solar Negative
Charge Controller
- Battery Positive: Connected to Battery 12V +
- Battery Negative: Connected to Battery 12V -
- Solar Positive: Connected to Solar Panel +
- Solar Negative: Connected to Solar Panel -
12V to 5V Step Down Power Converter
- VIN+: Connected to Battery 12V +
- VIN-: Connected to Battery 12V -
- 5v OUTPUT: Connected to Arduino UNO 5V, Servo Motor MG996R VCC 5V, Passive Buzzer +VCC, HC-SR501 PIR Motion Sensor Power Supply
- GND: Connected to Arduino UNO GND, Servo Motor MG996R GND, Passive Buzzer GND
Code Documentation
/*
* Solar-based Bird Repellant System
* This system uses a passive buzzer to emit a frequency to deter birds and
* moves servo motors to create motion, further deterring birds. The system
* is powered by a solar panel and a 12V battery, with a step-down converter
* providing 5V to the components. A PIR motion sensor detects bird presence
* and triggers the deterrent actions.
*/
#include <Servo.h>
// Pin definitions
const int pirPin = 2;
const int buzzerPin = 8;
const int greenLEDPin = 6;
const int redLEDPin = 4;
const int servoPin1 = 9;
const int servoPin2 = 10;
// Servo objects
Servo servo1;
Servo servo2;
void setup() {
// Initialize serial communication
Serial.begin(9600);
// Initialize pins
pinMode(pirPin, INPUT);
pinMode(buzzerPin, OUTPUT);
pinMode(greenLEDPin, OUTPUT);
pinMode(redLEDPin, OUTPUT);
// Attach servos
servo1.attach(servoPin1);
servo2.attach(servoPin2);
// Initial state
digitalWrite(buzzerPin, LOW);
digitalWrite(greenLEDPin, LOW);
digitalWrite(redLEDPin, LOW);
servo1.write(90); // Neutral position
servo2.write(90); // Neutral position
}
void loop() {
// Read PIR sensor
int pirState = digitalRead(pirPin);
if (pirState == HIGH) {
// Bird detected
Serial.println("Bird detected!");
triggerRepellant();
} else {
// No bird detected
stopRepellant();
}
delay(100); // Short delay to avoid rapid triggering
}
void triggerRepellant() {
// Activate buzzer
digitalWrite(buzzerPin, HIGH);
// Blink red LED
digitalWrite(redLEDPin, HIGH);
delay(500);
digitalWrite(redLEDPin, LOW);
delay(500);
// Move servos
servo1.write(0);
servo2.write(180);
delay(1000);
servo1.write(180);
servo2.write(0);
delay(1000);
servo1.write(90);
servo2.write(90);
}
void stopRepellant() {
// Deactivate buzzer
digitalWrite(buzzerPin, LOW);
// Turn off red LED
digitalWrite(redLEDPin, LOW);
// Blink green LED
digitalWrite(greenLEDPin, HIGH);
delay(500);
digitalWrite(greenLEDPin, LOW);
delay(500);
// Reset servos to neutral position
servo1.write(90);
servo2.write(90);
}
This documentation provides a comprehensive overview of the Solar-based Bird Repellant System, including a summary, detailed component list, wiring details, and the embedded code used to control the system.