top of page

Automated Chicken Coop Door

My family and I own pet chickens! Part of my daily chores growing up was to open and close the chicken coop door daily to prevent rats from eating eggs at night. As a personal project this year, I am currently working on an automated chicken coop door. Part of the reasoning is simply for a fun project to work on that my family can use, and also a need for a unique design due to the uniqueness of the chicken coop sizing, designed and built by my dad.

Design

​​​
Based on market research, my dad and I decided on a vertical sliding door, actuated by a motor and controlled by a microcontroller. The sensors on the door are NC reed switches (magnet and wire), and light level detection are through a photoresistor, all hooked up to the microcontroller with pull-up resistors.
 
We used an Arduino as our microcontroller, based on my previous experience working with it. The vertical design allows for a frame that easily sits inside the chicken coop.
​
My main focus was the code and electronics, first prototyping in TinkerCAD and then implementing on a breadboard. Note that the TinkerCAD model doesn't have a motor driver (not available in the workspace) but we use the Bojack L298 motor driver as shown in slide 2, which can power the arduino, only needing one power source for the whole design.

Screenshot 2026-01-08 at 5.45.40 PM.png
Screenshot 2026-01-08 at 5.54.13 PM.png

Electromechanics

Both reed switches and the photoresistor are interfaced using 10kΩ pull-up resistors to 5V.  Although the original schematic above showed the photoresistor hooked up to a 500K pull-up, the 10k allowed more sensitive count outputs to put a threshold in the code. We also switched to one magnet on the door to reduce accidental noise.

​

When the magnet is not near the reed switch, the input is pulled to 5V, reading as HIGH (1) as a digital output. When the magnet is close enough, the reed switch closes and shorts to ground, reading as LOW (0).

​

When the photoresistor reads a certain value below a given threshold, and the door is closed, the motor will spin one direction (opening the door) until the switch logic reads (0,1). This means the magnet at the bottom of the door closed SW1 and SW2 is open. The vice versa logic occurs for night time, closing the door and closing SW2.

​

In the second slide, the door is in the closed position with the magnet on the door. This was taken during our first automated test indoors with one light threshold.

​

Building Process

Using scrap wood from around the garage, we built the frame of the door using 2x4's and aluminum U-slats. Wooden dowels were used along with a flex coupler to gain motor transmission to the shaft. 

​

I used a circular saw to cut the wood, a hacksaw to cut the metal U-slat, and a drill press to drill precise holes for the motor mount.

​

One key issue we overlooked during design was the alignment of the dowel holding the rope for the door. As you can see in the slide 3 to the right, the weight of the door induced a bending force on the shaft, which would greatly reduce the lifespan of the rotating mechanism. This was exaggerated by the second flex coupler we had at the supporting end of the door frame.

​

To fix this, we added a T-shaped support (scrap part) to support the smaller dowel closer to the end of the main dowel. This helped ensure straight alignent and got rid of the need for the second flex coupler/metal support. Had we had a more careful design process for this project instead of a fail-fast system, this problem probably would have been anticipated.

IMG_8940.JPG
IMG_8939.jpeg

Next steps

I don't have access to this project while I am in Toronto, but this is far from done! One of the next steps is to hook up an independent power source; our goal is to use a solar panel with battery storage, so the system can run off-grid.

 

One issue we anticipate running into is the low-power operation of the Arduino. By design, the Arduino has extra parts that will continuously draw power, even on a sleep cycle. Another future revision may involve designing a custom PCB that only involves what we need, potentially making circuit design much neater in the long run. In the short term, I plan on soldering my current set up onto an Arduino shield before cleaning things up.

​

For the software, there is only one count threshold – I assume there would be a decent amount of noise in the photoresistor counts when outside, so I will need to add hysteresis to prevent rapid switching during the day-night transition.

​

At last, the inside of the chicken coop has a lot of dust and, well, chicken poop, so I will be 3D printing housing/covers for the electronics and motor.

bottom of page