PERSONAL PROJECT · EMBEDDED SYSTEM · APR 2025
Automatic chicken coop door
Daylight controls a drawbridge-style door. A geared motor drives a winch, cables move the door, and a limit switch detects closure.
Project at a glance
- Context
- Personal project: automating a drawbridge-style chicken-coop door using ambient light.
- Timeframe
- April 2025
- Team
- Personal project · Aurélien Capron.
- My role
- Building the mechanism, electronic controller and embedded program.
- Technologies
- ATmega328P · C++ / Arduino · light sensor · relays · geared motor
- Outcome
- Working motorised door controlled by light levels, with a closed-position switch and timeout.
On this page
Moving the door
The door pivots like a drawbridge. The geared motor turns a metal shaft to wind or unwind the cables, converting motor rotation into movement of the door.
Sensing light and driving the motor
A photoresistor provides an analogue reading to the ATmega328P. One relay switches motor power and two others select its direction. A separate input reads the limit switch.
View the system diagram
Deciding when to move and when to stop
At startup the controller uses the current light reading as its threshold and assumes the door is open. Its opening and closing thresholds differ by ten analogue counts, reducing repeated switching when light fluctuates near the threshold.
During closure the motor stops when the limit switch activates. If the switch does not activate, power is cut after 38 seconds. The software then marks the door closed in either case, so the physical position is unconfirmed after a timeout.
Local control of the drawbridge
One button requests movement according to the current door state. The other sets the threshold to the current light reading when polled during movement or the following pause.