NodeMCU Controller for automatic chicken door

Automatic Chicken Door

The first version of the automatic chicken door worked pretty well.  It was certainly an interim version as it was operated simply by timers, and did not allow for any control relative to daylight and dark, nor did it have any remote control ability either.

As the mornings got earlier and the sunsets later, the timer settings needed to be adjusted, and a lot more than I initially thought would be needed.

The other thing I noticed,  the placement of the automatic pop door was wrong.  When I was at the coop doing routine chores such as gathering the eggs, fresh bedding for the boxes, feed and water, I saw the chickens always preferred using the door I used rather than going out the pop door, which was located on the west side of the coop.  It could be quite hot on that side, and there was a bit more of a step up and down for them.  Also their normal path around the garden fence was closer to the people door than the pop door.  I don’t know if that made any difference or was the reasoning for the chickens, but it was their preference.

Setting the timers also had me making my way through the roost side of the coop so it was a bit messy at times.  All this led me to relocate the automatic chicken door so it was part of the people door.  Moving it also made for very easy access as when the people door was opened, all the controls and pop door were right there on the door, easily accessible.

Automatic Chicken Door Installed
Arduino for an automatic chicken door
An Arduinio setup on a breadboard for testing and building an automatic chicken door

I started the automation of the door with an Arduino R3 board, and added an ethernet shield to connect it to the network for remote access.  An Arduino seemed the right choice, and a number of projects using an Arduino controlled chicken door could be found on the internet.  I downloaded a number of the sketches – programs for the Arduino – and tested, modified, and tried to get a version that suited me.  Using a breadboard setup made it easy to modify the wiring and test things.  I used LEDs, relays, photocells, reed switches, and motor control boards.

One of the things I found pretty quickly, I’m not much of a programmer when it comes to getting the sketches for the Arduino.  I was able to do quite a lot, and I could pretty well follow along with what others have done and make modifications along the way.

There is a lot to learn.  Mostly where I had my difficulty was in getting the communication part of it going across the ethernet.  I had some success.

While trying to make my way through all this I came across the NodeMCU ESP8266 board.  And then ESP Easy firmware.  And wow, I have been out of the loop for a long time.  The combination of the chip and firmware was the resolution I was looking for with the Arduino, with almost none of the programming.

It was an easy choice.  I already had gigabit network wiring to the chicken coop along with a wireless router and switch to connect up the video cameras in and around the coop.  Connecting it up to a MQTT server and Node Red panel made the whole project come together.  So the Internet of Things, home automation has arrived in the chicken coop.

I used Big Timer in Node Red to set the door to open at sunrise and close about 30 minutes after sunset.    Entering the latitude and longitude into Big Timer allows it to determine sunset and sunrise times for my location.

I am using magnet reed switch type sensors as digital inputs to the controller so it knows when the door is open or closed, and a couple of mechanical switches as limit switches in case it fails to read the sensors during an operation.  I have a time limit set for how long power is applied to the motor driving the door.

It has been in operation for almost two months and has worked well for what I want it do do.

Arduino vs ESP8266 NodeMCU
Arduino and Ethernet Shield vs ESP8266 NodeMCU
Node Red Layout for automatic chicken door
NodeMCU Controller for automatic chicken door

Recommended Posts

No comment yet, add your voice below!


Add a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.