The Smart Way to Protect Your Chickens from Predators
Did you remember to shut the chicken coop? Automate your flock’s safety with this ATmega1284P-powered system and never worry about it again.
Why did the chicken cross the road? I’m not sure, but if you don’t get it back in its coop before dark, something’s going to eat it. Chicken is exceptionally delicious, after all.
This is becoming a problem for more and more people all the time as the backyard chicken craze sweeps the nation. It gets worse with time, as well. What they don’t tell you at first is that two chickens quickly become a dozen. Then the family falls in love with them, and next thing you know, you’ve got a hundred chickens.
That’s the exact situation Vinnie Moscaritolo found himself in. While having lots of chickens can be a good thing (eggs make for a nice breakfast, and you can sell the leftovers), it also makes for a lot of work. Early-morning and late-night work, in particular, quickly grows tiresome. So Moscaritolo hacked together some hardware to automate it.
What began as a simple Arduino-based coop door evolved into a rugged, purpose-built system designed for real farm conditions. Today, his latest controller is a 12-volt battery-powered unit with optional solar charging, capable of running for extended periods without human intervention or Wi-Fi, even in the absence of reliable sunlight.
The core idea is to open the coop at sunrise and close it after sunset. But instead of relying on light sensors — which can be fooled by clouds, shadows, or headlights — the system calculates sunrise and sunset using latitude, longitude, and date. This ensures the door stays aligned with natural daylight cycles year-round, without constant adjustment.
The controller itself is built around a custom board using an ATmega1284P microcontroller and an integrated real-time clock. It spends most of its life in a deep sleep state, consuming only microamps of current, and wakes periodically to check whether the door should be open or closed. This ultra-low-power approach allows it to operate reliably in a mobile coop environment where power is limited.
Mechanically, the system avoids common failure points seen in commercial designs. Instead of a sliding door prone to freezing, it uses a vertical, gravity-assisted door. If power fails, the door simply drops shut. A linear actuator lifts it open, and a separate motorized latch locks it securely at night to keep predators like raccoons and coyotes at bay.
Rather than triggering actions at fixed times, the controller continuously evaluates what the door’s state should be at any given moment. This “state reduction” approach prevents failures during power loss or manual overrides—critical when a mistake could mean losing an entire flock overnight.
The system is designed to be configured in the field via a simple serial interface. Once set up, it runs autonomously, requiring no ongoing connectivity or cloud services.
Complete firmware, schematics, and PCB design files have been made available online. Go grab them if you’ve got some chickens of your own to keep safe.