Solar bird scarer for crop fields
Build it step by step
0 of 7 doneSet the boost converter
Power the MT3608 from the cell and turn its trimmer until the output is 5.0 V.
Build the power chain
Solar panel to TP4056, cell to the TP4056 battery pads, TP4056 output to the MT3608, MT3608 to the 5 V rail.
Wire the electronics
PIR on D2, servo on D9, DFPlayer on D10 and D11, speaker on its pins.
Load the sounds
FAT32 card, files named 0001.mp3 onward.
Test at the bench
Wait 30 seconds for the PIR then walk in front of it. A sound plays and the flag waves.
Add the flag
Fix a bright piece of cloth to the servo horn so it waves in front of the crop.
Place it
Fix it on a post at crop height and move it every few days.
How do you build a solar bird scarer for crop fields?
A PIR sensor triggers a loud tone and a waving servo flag when birds land near a crop, running on a small solar panel. You need Arduino Nano, PIR Motion Sensor HC-SR501, SG90 Micro Servo, DFPlayer Mini MP3 module, Speaker 4 Ω 3 W, SanDisk microSD card 32 GB (A1, Class 10), Solar panel 6 V 1 W, TP4056 module with protection (USB-C), 18650 cell 2600 mAh (branded), Battery holder 18650 single, MT3608 Boost Module, Resistor 1 kΩ, Electrolytic capacitor 1000 µF and Jumper wires male to male (40 pcs, 20 cm). It takes 7 steps and about 150 minutes.
- Level
- Beginner
- Time
- About 150 min
- Parts
- 14
Parts list
- Development BoardsBuyArduino Nano × 1
- SensorsBuy
- Motors & ActuatorsBuySG90 Micro Servo × 1
- InterfacesBuy
- Motors & ActuatorsBuySpeaker 4 Ω 3 W × 1
- SBC AccessoriesBuy
- PowerBuy
- PowerBuy
- BatteriesBuy
- PowerBuy
- PowerBuy
- PassivesBuyResistor 1 kΩ × 1
- PassivesBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Solar panel | TP4056 IN+ and IN- | Charges the cell |
| 18650 cell in holder | TP4056 B+ and B- | Battery |
| TP4056 OUT+ and OUT- | MT3608 IN+ and IN- | Cell feeds the boost converter |
| MT3608 OUT+ (set to 5.0 V first) | Nano 5V, DFPlayer VCC, PIR VCC, servo + | 5 V rail |
| MT3608 OUT- | All grounds | Common ground |
| 1000 µF capacitor | Across the 5 V rail | Absorbs servo and speaker surges |
| PIR OUT | Nano D2 | Motion |
| Servo signal | Nano D9 | Waving flag |
| DFPlayer TX | Nano D10 | Data to the Nano |
| DFPlayer RX | Nano D11 through 1 kΩ | Data from the Nano |
| DFPlayer SPK_1 and SPK_2 | 4 Ω 3 W speaker | Sound |
Code
Arduino IDE, board "Arduino Nano" (processor ATmega328P, or ATmega328P (Old Bootloader) for clones). Install "DFRobotDFPlayerMini"; Servo comes with the IDE. Put sounds on a FAT32 microSD as 0001.mp3 to 0005.mp3, using recordings you made or sounds you have the right to use. Set the MT3608 to exactly 5.0 V on a multimeter before connecting the electronics. A cheap TP4056 board does not handle charging and powering a load at the same time perfectly, so check the cell does not drain overnight.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
#include <SoftwareSerial.h>
#include <DFRobotDFPlayerMini.h>
#include <Servo.h>
SoftwareSerial ss(10, 11);
DFRobotDFPlayerMini dfp;
Servo flag;
const byte PIR = 2, SERVO_PIN = 9;
const byte TRACKS = 5; // number of sounds on the SD card: 0001.mp3 to 0005.mp3
unsigned long nextAllowed = 0;
void setup() {
pinMode(PIR, INPUT);
ss.begin(9600);
dfp.begin(ss);
dfp.volume(25);
randomSeed(analogRead(A0));
delay(30000); // the PIR needs about 30 s to settle
}
void loop() {
if (digitalRead(PIR) == HIGH && millis() > nextAllowed) {
dfp.play(random(1, TRACKS + 1)); // a random sound each time
flag.attach(SERVO_PIN);
for (byte i = 0; i < 6; i++) { flag.write(30); delay(250); flag.write(150); delay(250); } // wave the flag
flag.detach();
nextAllowed = millis() + random(30, 121) * 1000UL; // wait 30 to 120 s so birds do not get used to it
}
delay(100);
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Walk in front | Random sound and the flag waves |
| Immediately again | Ignored for 30 to 120 s |
| Sunny day | Solar panel charges the cell |
| Dark night | Still runs from the cell |
If it does not work
No sound
SD card not FAT32 or the files are named wrongly.
Triggers constantly
The PIR sees waving crops. Aim it away or lower its sensitivity.
Resets when the servo moves
The supply sags. Check the 1000 µF capacitor and the cell charge.
Cell empty by morning
The solar panel is too small for the winter sun, or the PIR draws too much. Use a larger panel.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the solar bird scarer for crop fields?
Arduino Nano, PIR Motion Sensor HC-SR501, SG90 Micro Servo, DFPlayer Mini MP3 module, Speaker 4 Ω 3 W, SanDisk microSD card 32 GB (A1, Class 10), Solar panel 6 V 1 W, TP4056 module with protection (USB-C), 18650 cell 2600 mAh (branded), Battery holder 18650 single, MT3608 Boost Module, Resistor 1 kΩ, Electrolytic capacitor 1000 µF and Jumper wires male to male (40 pcs, 20 cm).
How long does the solar bird scarer for crop fields take to build?
About 150 minutes for a beginner maker, in 7 steps.
How do I know the solar bird scarer for crop fields works?
Walk in front: Random sound and the flag waves. Immediately again: Ignored for 30 to 120 s. Sunny day: Solar panel charges the cell.
No sound: what should I check?
SD card not FAT32 or the files are named wrongly.
Triggers constantly: what should I check?
The PIR sees waving crops. Aim it away or lower its sensitivity.
Resets when the servo moves: what should I check?
The supply sags. Check the 1000 µF capacitor and the cell charge.
Cell empty by morning: what should I check?
The solar panel is too small for the winter sun, or the PIR draws too much. Use a larger panel.
