Smart Phone Operated Chicken Coop Door 🐔

by codemakesitgo in Circuits > Arduino

4608 Views, 14 Favorites, 0 Comments

Smart Phone Operated Chicken Coop Door 🐔

Automatic Chicken Coop Door

This project will allow you to open or close your chicken coop door from anywhere and allows you to check the status on the door using a smart phone app!

So what does that mean for you??

Well for one, you can setup a schedule to open and close the coop door automatically and\or open and close the door remotely. In addition to this, your phone will tell you if the door is open or closed and notify you when it does open or close from.


Basically it means you can sleep in late and stay out late and your birds will be ok! 😁


A lot of people, since the pandemic, have started a chicken coop at home. I'm sure there are a bunch of people who do not want to open the coop door at 6am every day or remember to close it every night. If you are one of these people, this project is for YOU!

This project uses an Arduino Nano. I used a inexpensive smart garage door controller to handle the smart phone and Alexa integration. All we have to do is make the controller think the chicken coop door was a garage door. In addition, you can buy the automated coop door at my store!

www.codemakesitgo.com 👍


There have been some updates since the video. So this Instructables may not match exactly as shown but the video is still entertaining and close enough to get the main idea how to build this.

Supplies

71sdqejlvvL._AC_SL1500_.jpg
Screenshot 2021-10-29 220325.png
61JAjYzklDL._AC_SL1000_.jpg
711TmwKHYgL._AC_SL1500_.jpg
71lcfjTFZKL._AC_SL1500_.jpg
718kICELv4S._SL1500_.jpg
51fcWvTdIzL._SL1200_.jpg
41XcoO489EL._AC_.jpg
  1. 5V USB WiFi Smart Garage Door Controller
  2. Arduino Nano
  3. DC 12v 5Amp Power Supply
  4. DC 5V 2 channel relay module
  5. DC 3v - 40v Voltage Regulator 
  6. 8" Linear Actuator (225lbs)
  7. Project Box
  8. Cable Glands

Smart Phone App

Quick Connect to Smart Garage Controller
20201213_171836000_iOS.png
20201213_222202000_iOS.png
20210117_195612846_iOS.jpg
20210117_195609002_iOS.jpg
20210117_195628059_iOS.jpg
71sdqejlvvL._AC_SL1500_ (1).jpg
P1030760.JPG

First step is to ensure that your garage door controller is working with your network and smart phone.

Depending on the garage controller you purchased, and there are quite a few, the app maybe different. I bought the controller and it said to install "Smart Life" then next time I purchased it said to use "eWiseHome". Both apps had the same features and functionality.

In general, you will follow the instructions that came with your garage controller. The video is a quick overview of the process to connect the controller to your phone and network. It is very easy and essential for this project.

Typically these controllers cost about $25 - $30 and come from variety of manufacture names.

Program Arduino Nano

2021-10-31.png

Here is an Instructables on how to get started with your Arduino Nano

https://www.instructables.com/Arduino-Nano/


But, assuming you already know how to program your Arduino, download the chicken coop code from GitHub. I've also attached the current version to this instruction as of writing, but the latest will always be on GitHub.

https://github.com/CodeMakesItGo/ChickenCoopDoor/blob/main/chicken_coop/chicken_coop.ino


Downloads

Flashing LED

LED Sketch_bb.png

Next we are going to ensure the Arduino Nano is running the application. The application has a heart-beat indication. This just blinks an LED at 1Hz to let you know the program is running and it is "alive".

  1. Connect an LED to D5 on the Nano and a 220ohm resistor in series. The resister can either go on the ground side connecting the LED to ground or in between the D5 pin and the positive side of the LED. As a reminder, the negative side of the LED will be indicated by the flat side of the LED bulb.
  2. Connect the USB cable to the Nano, if the LED is blinking, the application is running.

At this time, you should also connect the Door sensor LED to pin D6 (as indicated in the diagram). This LED will indicate when the door is closed and will help prove the door sensor is working at a later step.

12v and 5v Power

Power Sketch_bb.png
71lcfjTFZKL._AC_SL1500_.jpg
61JAjYzklDL._AC_SL1000_.jpg
Screenshot 2021-10-29 220325.png

Typically, you will be using a power supply with at least 2amps. I used a 5amp power supply just to make sure I had enough current for the actuator.

  1. Split the 12V cable so that it can go to the relay board (next step) and the power regulator. This might be easier than is sounds if you have screw terminals on the 12V output. Alternative is to use the screw terminals on the relay board.
  2. For this project, I used an adjustable power regulator. If you did too, connect the 12v to the regulator input and adjust the output until it is at 5V before connecting it to the Arduino. You will need a volt meter to do this.
  3. Once you have the regulated 5V output, connect it to the 5V input pin on the Arduino as shown in the diagram.

At this point, when you plug in the 12V power supply, the Arduino should power on and the LED should start to blink.

Relay Board

Relay Test Sketch_bb.png
711TmwKHYgL._AC_SL1500_.jpg

Next we will connect the relay board and test the output. The reason we need two relays is because the power will need to swap poles. Meaning it will need to switch from +12V to -12V in order to change the direction of the actuator.

  1. Disconnect power to the Arduino
  2. Connect D4 to one of the inputs to the relay
  3. Connect D7 to the remaining input to the relay
  4. Connect 5V power and ground to the relay
  5. Connect 12V to the NO (Normally open) side of the left relay, and NC (normally closed) on the right relay.
  6. Connect GND to the NC (Normally closed) side on the left relay, and NO (normally open) on the right relay.
  7. Nothing should be connected to the common terminal (center) on either relay at this point.
  8. Power on the Arduino and verify the 1hz LED is flashing.
  9. The power light on the relay board should also be on.

To test if the relay board is working, use a volt meter to measure the voltage across the common screw terminals of the relays (shown in the diagram).

Notice the voltage you are reading, it should be either +12V or -12V.

Now lets test the relay function. Use a jumper wire to connect the Arduino pin D2 to GND and hold it for 2 seconds then release. The output at the voltmeter should briefly read 0V then swap poles. At this point you should be reading the opposite voltage from your initial reading and you should have heard the relays 'click'.

Actuator

Actuator Sketch_bb.png
718kICELv4S._SL1500_.jpg

If the dual relay output is working as expected, you can now test with the actuator. Connect the actuator to the dual relay, it doesn't matter which way you connect it at this point. If the door moves in the wrong direction for your coop, you can swap the wires later.

Repeat the previous test with the actuator connected instead of the voltage meter. The actuator should change directions when you touch D2 to GND.

Garage Door Switch

Relay Toggle Sketch_bb.png
71sdqejlvvL._AC_SL1500_ trigger.jpg

Now on to the garage door controller. Assuming you bought the USB powered garage door controller, you can either use the power supply it came with or strip the USB cable and use the 5V voltage regulator to power it. Up to you.

  1. The garage door controller should be already setup from step one. Ensure that it still connects to your smart phone after you power it on.
  2. Connect the garage door toggle switch (two wires) to the Arduino. One wire will go to GND and the other to pin D2. It does not matter which wire goes where, it is simply just connecting D2 to GND the same as we did in step 5 to test the relay.
  3. Ensure everything is powered on and use your phone to toggle the relay direction by manually opening and closing the garage door on your app.

In the diagram, the garage door controller is not pictured but the connection is at the top right corner.

Garage Door Close Sensor

Feedback sensor connection.PNG
71sdqejlvvL._AC_SL1500_ sensor.jpg
Relay Sketch_bb.png

Almost done!

The final step is the trickiest. We have to read the door sensor so that the Arduino knows if we should be opening or closing the door in case we loose power. This step isn't 100% necessary but adds peace of mind if you happen to loose power during the night, the coop door doesn't automatically open when power is turned back on.

  1. With the garage controller powered on, measure the voltage at the magnetic sensor with the magnet away from the sensor.
  2. If it reads +3.3V, then the side that you have the negative probe on (usually black) will connect to pin D3. I know this sounds weird but just trust me.
  3. With the magnet away from the sensor, the door LED (D6) should be off.
  4. When the magnet comes into contact with the sensor, the door LED (D6) should be on.
  5. If the door LED is on all the time, you connected the wrong side. :-(

Test

20210110_202215315_iOS (2).jpg
5V USB Controller with 5V Relay.PNG
5V Relay Connections.PNG
Relay Sketch_bb.png

Once it is working, to test the entire system follow these steps.

Test 1:

  1. Open the door (actuator retracted) and make sure the sensor is not in contact with the magnet.
  2. Unplug or power off the Arduino.
  3. Power the Arduino back on, the door should start to close for 2 seconds then start to open back up.

Test 2:

  1. With the door closed (actuator extended)
  2. Unplug or power off the Arduino.
  3. Ensure the garage door sensor is within 1" of the magnet
  4. Power the Arduino back on, the door should stay closed

The idea is that the door will stay shut if you briefly lose power at night. And stay open during the day in the same scenario.


If everything is working, you are awesome! Congratulations! You now have a remote operated and schedulable chicken coop door. If things aren't working you can either email me, post a comment, or check out the next step. I'm here to help and interested in you getting this to work too.

Buy One!!

DSC00197.JPG
DSC00181.JPG
DSC00168.JPG
DSC00178.JPG

It's a bonus to make your life easier!


If the above steps seems a bit difficult or you are apprehensive about doing the wiring for this project, this will help you out immensely.


I've created the "Mother Clucker's Eggxit Door" connector board. Each board has been assembled and tested by me. It includes the programmed Arduino Nano, dual relays, power regulator, fuse, screw terminals, and USB connector for easy connections to the garage door controller, linear actuator, and power supply.

Do you need this board for this project?? Nope. But it will save you about ~4 hours of work and provide a cleaner, more reliable installation. No soldering, no splicing wires together, no programming, no frustration!


If interested, you can buy the automated coop door ready-to-go!

www.codemakesitgo.com 👍