If you keep chickens, you know the anxiety. You are halfway through dinner, it is getting dark, and you suddenly remember: did I close the coop door? Foxes are quick. Possums are relentless. One forgotten night can be catastrophic.
I got tired of running down the backyard in my socks at 9pm. So I automated it.

The Problem
Chickens are creatures of habit. They come out at sunrise and put themselves to bed at sunset. The door, though, is manual. A simple timer would work except that sunrise and sunset shift by over two hours between summer and winter in Sydney. A fixed timer means either leaving the door open too long on short winter days, or shutting the chickens out on long summer evenings.
The right solution: a device that knows the actual sunrise and sunset times for today, at my location, and opens and closes the door accordingly. With a web interface so I can check the status from anywhere.
The Architecture

The system splits responsibility between three components: an Arduino drives the servo motor that physically opens and closes the door. A Raspberry Pi handles the intelligence: WiFi, fetching sunrise/sunset times from the internet, running the automation logic, and reporting status. A CentOS VM inside the house runs a Flask web app for monitoring and manual override.
This split between microcontroller (physical I/O) and Linux computer (networking, logic) became my go-to IoT architecture. The Coopener was the first project to use it, but not the last.

The Result
It worked. The chickens got used to it within a day (the servo is quiet enough not to startle them). The door opens at sunrise, closes at sunset, and I can check or override from my phone. No more running down the yard in my socks.
The full build is documented across three posts covering testing, hardware, and source code:
- Part 1: Testing and Retrofitting
- Part 2: Hardware and OS Installation
- Part 3: Source Code and IoT Functionality
What’s Next
The Coopener has been running since 2016. If I were building Version 2 today:
- Solar power: A small panel on the coop roof with a charge controller and LiPo battery. No more running mains power down the yard.
- Camera integration: A Pi Camera or ESP32-CAM for live coop monitoring. Check on the chickens without leaving the couch.
- Predator detection: PIR sensor or basic ML on the camera feed to detect movement near the coop at night and send alerts.
- Weather-aware scheduling: Adjust door timing based on weather conditions (overcast days get darker earlier; the chickens go to bed sooner).
- Home Assistant integration: Replace the bespoke Flask server with Home Assistant for dashboards, automations, and notifications. The MQTT pattern from my RISC project would slot right in.
The chickens do not care about the tech stack. They just want the door to work. But I care; and the urge to over-engineer a chicken coop has not diminished one bit.