Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Solar-Powered Bird Repellant System with Arduino and Servo Motors

View and Edit Project In Cirkit DesignerImage of Solar-Powered Bird Repellant System with Arduino and Servo Motors

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

  1. Servo Motor MG996R

    • Pins: PMW, VCC 5V, GND
    • Description: High-torque servo motor used for creating motion.
  2. Passive Buzzer

    • Pins: S output signal, +VCC, GND
    • Description: Emits a frequency to deter birds.
  3. HC-SR501 PIR Motion Sensor

    • Pins: Output, Ground, Power Supply
    • Description: Detects motion to trigger the deterrent actions.
  4. LED: Two Pin (green)

    • Pins: cathode, anode
    • Description: Indicates system status.
  5. LED: Two Pin (red)

    • Pins: cathode, anode
    • Description: Indicates bird detection.
  6. Resistor (200 Ohms)

    • Pins: pin1, pin2
    • Description: Current limiting resistor for LEDs.
  7. 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.
  8. Battery 12V

    • Pins: -, +
    • Description: Provides power to the system.
  9. Solar Panel

    • Pins: +, -
    • Description: Generates power from sunlight.
  10. Charge Controller

    • Pins: Solar Positive, Solar Negative, Battery Positive, Battery Negative, Load Positive, Load Negative
    • Description: Manages power from the solar panel and battery.
  11. 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)

Servo Motor MG996R (2)

Passive Buzzer

HC-SR501 PIR Motion Sensor

LED: Two Pin (green)

LED: Two Pin (red)

Arduino UNO

Battery 12V

Solar Panel

Charge Controller

12V to 5V Step Down Power Converter

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.