It Takes a Tough Man to Make a Tender Chicken

The Pandemic of 2020 turned my family into chicken tenders. We presently have about two dozen chickens, down from a peak in the low 40s.

Many pets are troublesome when you want to be away from the home for more than the day. Chickens, especially so — I’ve been shocked at how many people I know who are scared of chickens. Our main chicken coop is a place for them to sleep that’s reasonably secure from predators, not a living space complete with food and water, so it is challenging to leave them mostly unsupervised for days when their care instructions are “Open the coop as close to sunrise as you can, come back to close them up very soon after sunset, and we’re pretty sure the rooster is harmless but watch him and don’t worry that we’ll be mad if you have to beat him to death.”

Thankfully, technology exists to help with this.

There are many automatic chicken coop doors. The one I chose is from a company called Omlet, as theirs is the only one I believe reasonably trustworthy to not maim a chicken — it has a kill switch along the entire side of the door frame and can otherwise detect that the door is obstructed, presumably by monitoring the motor current. Many other doors just use a beam sensor.

Universally, the controllers on automatic chicken coop door allow operation by time or light level. This is… Not Great. The light control on the Omlet doesn’t really work on my chickens’ schedule. Going by time sucks because I need to regularly adjust the schedule based on the length of daylight.

And in general these controllers suck because they’re not Wi-Fi or Zigbee or Z-Wave so I can’t control them remotely or verify their state. The Omlet will eventually give up and display an error if it can’t open or close. Some others aren’t even smart enough to detect that they’ve failed at their task.

Since I bought the Omlet a couple years back, I’ve found three newer doors that sport Wi-Fi and have cloud dependencies. One charges for their cloud, one does not (so far), and neither of them has public information about whether they can integrate with any home automation platforms. The 3rd is Tuya-based, which is probably a plus as far as owning cloud-dependent devices from random small companies goes, but this is a product class where I want official local control and no Cloud.

Since I can’t buy what I want, and I’d dismissed the idea of going full DIY back when I originally bought the Omlet, my plan has been to make the Omlet door smarter. Others have gone before me, usually by taking an ESP-based relay board and connecting the relays to the button leads on the controller board. I found one person who replaced the controller entirely but is naively operating it via relays with a timer for how long the motor should run. In either scenario, they’re using their home automation platform to control it.

I decided on a more comprehensive approach. I want to completely replace the Omlet controller, without losing anything that it does in operating the door — the crush switch needs to work, and the motor’s current needs to be monitored. I want my controller to integrate with my home automation platform but be operationally autonomous, so it needs a real-time clock module with backup power — you’ll find “RTC” in the datasheets for all those boards with common Wi-Fi microcontrollers, but that is just a clock that will reset when power is lost. And I want to do something to sense that the door is fully opened or closed — possibly add a pair of reed switches or a distance sensor. I don’t need a light sensor as sunrise/sunset can be calculated based on the time and latitude/longitude.

I’ve named my project Frittata. As of today, I have a proof-of-concept prototype using a Pico W running CircuitPython with an INA219 current sensor and DRV8833 motor driver. That leaves plenty more to do, and I’ll probably throw all the prototyping work away in favor of using an ESP32-based board and ESPHome or the Arduino framework, but despite this being the most complicated thing I’ve done with a microcontroller by a wide margin it is hardly rocket surgery. I think another 10-20 hours work gets me to something I’m comfortable unleashing upon my flock.

Leave a Reply

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