One of the difficult things about raising chickens is that you aren’t the only thing that finds them tasty. Foxes, raccoons, hawks — if it can eat meat, it probably wants a bite of your flock. [donutsorelse] wanted to protect his flock and to be able to know when predators were about without staying up all night next to the hen-house. What to do but outsource the role of Chicken Guardian to a Raspberry pi?
Object detection is done using a YOLOv8 model trained on images of the various predators local to [donutorelse]. The model is running on a Raspberry Pi and getting images from a standard webcam. Since the webcam has no low-light capability, the system also has a motion-activated light that’s arguably goes a long way towards spooking predators away itself. To help with the spooking, a speaker module plays specific sound files for each detected predator — presumably different sounds might work better at scaring off different predators.
If that doesn’t work, the system phones home to activate a siren inside [donutorelse]’s house, using a Blues Wireless Notecarrier F as a cellular USB modem. The siren is just a dumb unit; activation is handled via a TP-Link smart plug that’s hooked into [donutorelse]’s custom smart home setup. Presumably the siren cues [donutorelse] to take action against the predator assault on the chickens.
Weirdly enough, this isn’t the first time we’ve seen an AI-enabled chicken coop, but it is the first one to make into our ongoing challenge, which incidentally wraps up today.









The build is based on an ESP32 Lyrat development board. Unlike most devboards, this one has two 3 watt audio outputs and mics on board, making it perfect for a build like this one. The Lyrat was paired with some NeoPixel LEDs and a pair of Dayton Audio 1.5″ speakers to enable it to interact with the user both audibly and visually.