IoT Coop Door Cares For Chickens, Tests Home Automation

Most chickens are pretty good at putting themselves to bed when the sun sets, and [Eddy]’s chickens are no exception. But they’re not terribly thoughtful about closing up after themselves, so he set about on a long-term project to automate the door of their coop.

An open door overnight leaves chickens and their food vulnerable to predation. Rather than handle the chore manually and risk one forgetful moment that could wipe out his flock, [Eddy] used a servo to power the door and an Arduino to control it. To keep track of bedtime and wakeup, a Raspberry Pi looks up the local civil dawn and twilight times online and tells the Arduino when the moment is at hand. The Pi cleverly caches the times for use the next day in case the WiFi connection is down, and also provides a web interface to check on the door’s status and manually override the cycle. Result: safe, happy chickens.

If all this seems a bit much for a simple job, [Eddy] agrees. But he’s using this as a testbed to develop a home automation framework that can be retasked at will. Sounds like he’s on the right track to us, but for more IoT animal husbandry tips, he’ll want to check out this small farm automation effort.

28 thoughts on “IoT Coop Door Cares For Chickens, Tests Home Automation

    1. This swinging door would easily be pulled outwards by any of the common predators – the hardware cloth (screening) provides purchase for claws to grab ; the servo – especially with the long arm providing leverage against the servo gearing – doesn’t stand a chance against a predator, the door itself doesn’t appear to have a lot of structural rigidity (thus allowing it to be bent outwards at the bottom even if somehow the top didn’t want to be pulled out), and predators have no qualms with a bit of digging – the threshold needs to prevent that.

      IMO, guillotine style doors are far more effective and reliable. On my coops, I use galvanized steel sheet, riding in a track (a simple groove, not some specialty hardware) mounted on the inside of the coop, the bottom edge of which runs past the bottom edge of the exterior opening, and without any perforations in the panel itself – a predator has nothing to ‘grab’, and it cannot be pushed inwards or pulled outwards. This is lifted and lowered using a small geared DC motor. Also, just as a matter of design preference, the automatic door is a chicken-appropriate opening mounted in the wall of the coop, separate from the full-sized door I use to enter for maintenance.

      No need for internet connectivity – it’s driven by a state machine implemented in an ATTiny85, monitoring light levels and going into sleep for 15 minutes between checks (well, many 4s cycles, but it wakes up and goes right back to sleep until the light check interval is up) so it doesn’t consume much power excepting when it opens in the morning and closes in the evening, and those events are pretty short. The entire thing is powered from a solar recharged battery, so the safety of the chickens are not reliant on AC mains either: internet connectivity isn’t the only thing that might go down. I’ve never needed to remotely secure the coop on demand so long as the automatic mechanism functions properly (and if there’s something wrong with that, on demand would surely be hosed). Because it senses ambient light levels and the trend towards lighter or darker, it automatically adjusts to the seasonal change, just like the chickens do.

      In this project here, besides a redesign of the door mechanism itself, there’s no reason the RPI couldn’t simply compute sunrise and sunset, negating the need for it to be able to communicate with the outside world. LAN operation/monitoring might hold some interest on the basis of home automation, but it shouldn’t be necessary for the basic function.

      I can see this as a learning process for its creator, but this should be viewed as rev 0.1 — not something that anyone should model a reliable automated door on – the survival of your poultry flock is at stake.

  1. Chickens aren’t legal in our city, but over the river they are. It’s nice to have them on civil time, some are in a tizzy as the time just changed. Now we are on Darklight Spending Time. Poor hens. It could cause an eggsplosion.

        1. I toyed with that idea too, but the coop is under a tree and I didn’t want to rely on something so fickle. Perhaps the RTC *plus* the light resistor would’ve been fine. But where’s the fun in that? ;) in any case, the RasPi grabs the perfect time to open/close right now throughout the entire year. No concerns for false positives.

      1. Daylight Savings Time doesn’t pose a problem. Neither the chickens nor their predators change their schedules just because the silly humans do. Just keep the clock synced to the local Standard Time zone or to UTC and it will always be right. (Unless you have a burning need to use the chicken coop’s RTC to tell time, at which point I’d suggest maybe a nice watch.)

        Formulae for predicting twilight have existed since the ancient Greeks; astronomical libraries have been a staple of electronic computer libraries since at least the 1960s. If you don’t feel like writing your own, you can always load up the Astral python module (or the appropriate library for your language.) They will deliver a lot more digits of precision than any chicken coop door actually needs. Then your only problem is knowing *where* your chicken coop is.

  2. Nice! Having had an automated coop door for over 10 years I know first hand it needs to be made fault tolerant. Mine’s a “dumber” door – with a light sensor (The goal is to close it some time after “dark” – why make it more complicated than it needs to be – DST who cares – the chickens don’t). It also has some fault detection and signaling if the door fails to open or close. Chickens are messy slobs and tend to poop on the door sill which sometimes prevents the door from closing. I’d also be interested to see how long that servo holds up to dust (and potential binding due to debris). My motor is a wiper motor/winch style door. Hasn’t killed a chicken yet and has held up to years of abuse in some pretty mixed weather conditions. Status is reported back via an LED. Slow fade – everything is OK. Rapid blink – something is screwed up.

  3. I built something similar with an arduino, though I didn’t hook it up to the internet. I used a light sensor to trigger opening and closing the door. My coop has a sliding door so I used a piece of threaded rod and a motor to open/close the door, plus a couple of switches to sense the state.

    Software part was trivial. The hard part was mounting it so that it was all straight. That and finding a gearbox that could increase the torque of the wimpy little motor.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

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