Automating a Chicken Coop Door Using Arduino

A DIY Chicken Coop Gone Digital

Automating a Chicken Coop Door Using Arduino

When we designed our chicken coop, automating our chicken coop door was a necessity. There was already so much to consider, from the design and quantity of nesting boxes to roosts and space. But, since we both work full-time jobs, an automatic chicken door had to be considered too.

We had seen plans for automated chicken coop doors. In fact, there are ready-to-purchase devices out there which will accomplish the mission of securing your birds. These products are rather expensive, especially given a significant design flaw: They rely on a timer to open and close the chicken coop doors. We didn’t like this idea because, as sunrise and sunset times change, the timer needs to be adjusted. If forgotten, there was a good chance the birds could be locked out of the coop. This was not acceptable.

Technology Arrives on the Farm

Last winter we attended the Northern Michigan Small Farm Conference and Trade Show. One of the workshops discussed ways to automate your farm and focused on greenhouse automation and data collection. We don’t have a greenhouse, but we listened intently as the speakers discussed the technology available to make life simpler for farmers. This was our introduction to the world of Arduino, which is basically a platform of hardware and software working together to accomplish just about anything you want.

We determined that Arduino could be used to create the perfect chicken coop door design. The only major roadblock was that we aren’t programmers. Fortunately, we have a close friend who is a programmer. We collected the hardware while he programmed and the end result is an automatic chicken coop door, which works reliably and lets us live our busy lives without always being home to let the birds in or out.

So What’s the Difference?

Through programming, we don’t need to periodically adjust the timer to keep up with the ever-changing sunrise and sunset times, ever. Our programmer incorporated a table of sunrise and sunset times by date, based on our location, into the program for our door along with a delay on sunrise and sunset times. We needed this delay to force our ducks to lay their eggs inside the coop before they head to the pond and because at night our birds aren’t quite ready for bed when the sun is setting. Our chicken coop door has a battery backup, too, so it will still open and close during a power outage. If you decide to use our plans and your coop does not have electricity, you’ll need to add a solar panel to keep the battery charged.

What You Need to Make Your Automatic Chicken Coop Door

Building this automatic chicken coop door requires some basic carpentry skills and tools, a general understanding of electricity and a little tech savvy. If you know how to build a chicken coop from a garden shed and create a Powerpoint you should be able to build this door. Here’s what you’ll need:

  • Arduino Uno microcontroller – The brains of the operation; it stores the program and tells the door when to open and close; found all over the internet for $10-15 shipped; make sure your Arduino comes with the USB cable and power cord like ours did.
  • Arduino DS3231 AT24C32 clock – Keeps accurate time for the Uno; it will require a watch battery most likely not included; also found all over the internet for $5 or less.
  • Jumper wires – Small wires with finished ends which connect the Uno to the relay board and the clock. This is also known as DuPont wire. Order a small bundle with different ends.
  • Relay Board – A circuit board with relays (electric switches) for controlling the linear actuator; we purchased one on Amazon for $12 
  • Linear Actuator – This physically opens and closes the chicken coop door; we purchased ours on Amazon for $68.
  • Battery backup – Powers everything and is nice insurance to have if you ever experience a power outage; we also purchased this on Amazon for $18.
  • Battery charger – Any inexpensive “trickle charger” will do; we purchased one from Harbor Freight for $9. If you don’t have electricity at your coop you’ll need to substitute a solar panel to keep your battery charged.
  • Electrical box – holds all the electrical pieces and Arduino; we had an electrical box on hand, but take a moment to think about where you are going to mount your box, and if it’s possible the box could get wet, look for a weatherproof enclosure at least 12×12” (our box is 16×16″); we took a scrap piece of plywood and glued it inside our box to mount the Uno, clock and relay board.
  • Wire, staples, connectors, wire nuts, etc.
  • ¼” x 5” Carriage bolts and nuts (x2)
  • 1”x10”x8’ board for cutting your pieces; we used PVC board so it wouldn’t rot
  • 1-1/4” and 1-5/8” wood screws
  • Table saw with fence
  • Drill
  • Laptop
chicken-coop-door
Here’s the info tag on the linear actuator we used.

Step-By-Step: Making the Door

The chicken door measures 11.5”x 12”; however, the track for the door and the linear actuator require more headroom, so you’ll need free space measuring at least 13”x 40”. You also need to find a spot for the electrical box. After you’ve determined the location of the chicken coop door, lay out your lines and cut the hole for the door.

Cut all your pieces first. You’ll need:

  • 7.5”x 13” for the threshold
  • 4.5”x 26” (x2) for the rails
  • 5-7/8”x 14” (x3) to make the door
  • 3”x 4” (x2) and 2”x 4” (x2) to mount the actuator to the door

Disclaimer: We built another chicken coop door using scrap plywood so we could take pictures for this article, but would recommend PVC trim boards as they will not rot.

Next make the track for the door in the rail boards. The track will be approximately 3/8” deep by 1” wide. After setting the blade depth on your table saw, set the fence 1.75” from the blade.

chicken-coop-door
A close-up of about how high the blade needs to cut into the rails to make the track, note the blade is set to half the depth of the board.

Start making cuts, moving the fence slightly with each cut, until your track is 1” wide. Do this to both rail boards.

chicken-coop-door
Making the first cut for the track.
chicken-coop-door
Track with two cuts.
chicken-coop-door
Track is getting wider with successive cuts.
chicken-coop-door
A finished rail with 1″ track. You’ll need to make two.

Construct the door by butting two of the three pieces you cut together. Use the third piece, centered left to right, to connect the two pieces, screw all three together with 1.25” wood screws.

chicken-coop-door

Next, attach the rails to the threshold. Place a mark 1.5” from the front of the threshold on both sides.

chicken-coop-door

Using this mark as a reference, position one of the rails perpendicular to the threshold and attach using 1-5/8” or larger wood screws. Pre-drill as needed. Repeat on the other side.

chicken-coop-door
Screwing the rails to the threshold

Test fit the door to make sure it doesn’t bind in the track.

chicken-coop-door
Test-Fit the door in the rails

If everything looks good, you’re ready to mount the actuator to the door. Drill a 5/16” hole through the center of your 3”x 4” pieces.

chicken-coop-door

The easiest way to find the center is to draw diagonal lines corner to corner with a straight edge.

chicken-coop-door

Using 1-5/8” wood screws, attach each 2”x4” piece to a 3”x4” piece to make an L-shaped bracket.

chicken-coop-door

Use 1-5/8” screws to attach the two brackets to the back of your door. They should line up with the edge of the piece used to secure the two halves of the door and the bottom of the L-shaped brackets should be approximately 1” from the bottom of the door.

chicken-coop-door

Use one carriage bolt and nut to secure the bottom of the actuator to the door. The top half will be secured to the coop once the door is installed. You are now ready to install the door in the coop.

chicken-coop-door
Completed door, ready to install in the coop.

Because of the vast differences in chicken coop construction, you’ll need to determine the best way to mount the door and the upper half of the actuator. Before we installed the actuator, we used the battery to fully extend it so we could determine the location of the upper bracket.

chicken-coop-door
A close-up of how we attached the top of the actuator to our coop.
chicken-coop-door
Door seen from inside the coop in the closed position.
chicken-coop-door
Door seen from inside the coop in the open position.

Step-By-Step: Wiring the Chicken Coop Door

With the door fully installed, it’s time to determine where you’re going to mount your electrical box and electronics. We decided it was best to mount our box in an area of the coop that is protected from the rain and snow. It may be easier to install the electronics before mounting the box in your coop. Using the listed schematic and jumper wires, connect the Arduino Uno to the relay board and clock board.

chicken-coop-door
Wiring Schematic

Do the same to connect your battery to the charger and the Uno. Mount your electrical box in the coop, plug in the battery charger (or solar panel) and run two wires from the relay to the actuator.

Step-By-Step: Installing the Arduino Program and Files

Download and install the Arduino Program to a laptop, the software is free.

After you’ve installed the software, download the following chicken coop door program files and folders, making a note where they have been saved on your computer.

  • ChickenDoor (choose the file that matches your time zone)
  • Step_One
  • Libraries
  • Timezone_master
  • Configuration step by step

Follow the step-by-step instructions in the configuration file you downloaded. Once the files are loaded, the chicken door should be operational.

Setting the Delay and Making Time Adjustments

Sunrise and sunset times are specific to your location; latitude and longitude determine those times. The program for this door was written specifically for our area which is Cincinnati, Ohio. To correct this, you will need to set the delay based on the sunrise and sunset times in Cincinnati. For example, let’s say sunrise in Cincinnati is 8 a.m. but you live in Denver. Your sunrise on the same day is at 7:23 a.m. If you want your door to open at sunrise in Denver you need to adjust the delay by -37 minutes or you can just leave it alone and the door will open at 8 a.m. Denver time.

Using the delay is optional based on your needs, if you do not want a delay, set the values to zero. Making this change is easy to do and is outlined in the step-by-step instructions. By default the sunrise and sunset delays are set to 70 and 120 minutes respectively. We found this website especially handy when trying to calculate the difference between sunrise and sunset times in Cincinnati versus other cities in the United States.

We hope this automatic chicken coop door will prove useful in protecting your hens, like it has done for us! If you’ve made your own automatic chicken coop door, let us know in the comments below.

Leave a Reply

Your email address will not be published. Required fields are marked *

9 + 1 =