DIY ESP32 based chicken coop door. Control based on time, light or via app
github.com
github.com
* Pi for timing/wifi/status/webserver.
* Opened at 8am, closed at civil twilight. Or whenever I hit the button on the webserver, or the switch board.
* Limit switches.
* Mechanical swing lock for raccoon protection
* Electric drill + rope for the vertical sliding door
* Relay for direction, power mosfet for the drive controller.
* Intermediate board between the 3.3v controller and the 12V power board.
* Lead acid battery + charger for the power.
The door was pretty hefty, and was _solid_. 1/2 or 3/4 ply IIRC. The drill wound up being a mistake, because the power was too high, managed to fry some relays before I got everything worked out. The limit switches were generally pretty good, but they were also pretty well protected by the door design.
The best bug was that the wifi worked really well during the day, but not at night. Turns out that the LOS between the wifi dongle and the AP went through the roost, and chickens absorb enough wifi signal to drop it off the net. So one 3m usb cable later, and the dongle was on the other side of the roost. Solid networking from then on.
Sadly I left it in the coop when moving out.
That sounds like a chicken motion detection system to me.
I tell you the bugs you see when deploying something in the real world...
I know nothing about chicken coops.
But turns out, chickens just naturally go into the coup at sunset and it's completely unnecessary.
But barring that situation, chickens always go in the coop. I can tell it's 15 minutes to sunset when the chickens start ambling up the ramp.
Didn't ever lose one at night, but there were definitely daytime predators that were an issue. (mainly raptors)
The device itself has no WIFI, bluetooth, or a radio of any kind. To program the device, you push a button to put it into a programming mode, then hold your phone up to its photo sensor, and it will flash the screen in a sequence of black and white to relay the encoded settings.
Really clever piece of engineering on the programming mode for sure.
Figuring out how to build a low-energy version is challenging, but necessary since the whole system runs off small solar panels and a 12v battery.
In the end I always closed the coop at night manually and let the auto coop door open in the morning, that way I could sleep in in the summer.
Next level of coolness would be a full coop monitor with non-chicken intruder detection. Alas, all my chickens have passed on by now so it'll remain a fantasy.
- Arduino compatible
- platformIO supported
- very cheap
- they are usually tiny
- great wifi and Bluetooth
- gpio pins for the different protocols (i2c etc)
- easy to power (tolerance and options in usb and pins)
- lots of exciting new models and active development like the esp32c3, the D1 minis and different models with integrated oleds are cool
- community resources. there are massive amount of blogpost and YouTube videos for esp32 (and Arduino in general)
cons are few;
- 3.3v signal is a hassle quite often in practise
- the amount of different esp32 devboards models can get confusing
- the pins are sometimes shared-purpose and it's not always clear which you can use
- China. Both practical for delivery time, and politically
That way the software can be nearly stateless:
1. Check time and determine desired state (open or closed) 2. Compare desired state against limit switches and run motor until the limit switch is hit (or it times out which is an error)
On the other hand, a turn-counting strategy can lose power in the middle of opening or closing and "forget" where it is in the process.
Commercial versions of this can measure motor load (via current), but still require manual calibration. I wonder if they thought they could get away with manual calibration, but couldn’t make it reliable.
I think these people are the market leaders:
Note that the commercial version latches the door shut, so raccoons can’t open it from the bottom (they would have to learn to pull the string, and then also stick a hind leg or something in the bottom to wedge it open after the string was released).
The new 2023 model replaces the string with what appears to be a high tolerance gear system. That auto-calibrates once, then remembers the set points.
I think it's also possible to design it such that both upper and lower limit switches are placed higher up on the edge of the door, rather than strictly at the top and bottom, which should help with the fouling.
Practically though, any automated system will be vulnerable to fouling/blockage and require regular maintenance to keep the mechanism clear and clean enough to avoid premature corrosion (chicken poop being pretty acidic). In my opinion, it's a pipe dream to have a fully automated coop in a backyard setting and not eventually/occasionally have failures that require manual intervention or lead to neglect and losses due to predation. Better to think of such systems as tools to relax the timing requirements for manual care. Instead of doing all the work at the right times, one can confirm that the animals are out/fed/watered/in/etc as part of doing the normal morning/evening rounds/chores.
The tracks will get warped over time if exposed to moisture. I don't live in a particularly wet place, and it's partially covered, but the wooden tracks warped, and the door would get jammed.
The string will get tangled and quickly finish off the batteries if the door is jammed or the batteries get low.
Modifications made:
I routed a painted solid wood doorway to provide a wider track to prevent the track from warping, and to improve tolerance to dirt, leaves and twigs, which has eliminated door jams.
Battery replacements every 6 months are now on my calendar.
I did have to disassemble it and untangle the string from the spool and motor once after initial setup.
But just once, I'd love to see a hobby project from somebody who already knows what they're doing, but is using this to try out some ridiculously inappropriate software technique.
Forget Arduino on an ESP32, I want to see somebody do this with FreeRTOS.
It's been on my todo list for a long time. Unfortunately, we have too many predators in our area to let the chickens roam free unsupervised (I lost 5 last year to the same coyote, and I can hear the bald eagles squeaking most clear days), so its a solution in search of a problem.
Second would be adding a good lock to the door -- raccoons are very crafty, and love stealing eggs
and chickens.. in my experience
You should be able to accomplish similar with a yaml configuration file.
We and many other people we know are using the Kerbl (not related to KSP) chicken coop door which is quite expensive (around 120 Euro).
https://d3w207ykk8w4lq.cloudfront.net/public/thumbnail/33/a3...
You can see in the image it uses quite intricate mechanics with a lever and a spring. It's also supposed to detect a stuck chicken, however that has never happened to us (or we wouldn't have noticed because the Kerbl has silently resolved the problem).
Technically I could keep chickens as long as I keep five or less. Realistically my neighbors would hate me. Also, there's a lot of foxes in my area and I don't think that my five chickens would be around all that long.
As for foxes, you can use a mobile coop+run. Move it once per day to provide fresh grass and distribute the fertilizer byproduct.
I know that my neighbors down the street have chickens because I occasionally hear them, but their yard is completely fenced in. I only know them well enough for casual greetings when we see them in passing, and there's a language barrier preventing more in depth conversation.
I don't talk to them much besides "hello", as communication is difficult since they don't speak much English and I don't speak much (any) Swahili.
The coop is somewhere in here: https://i.imgur.com/t6FqF6G.png
Is that a specific chicken clause in a contract somewhere or a general head of livestock / pets clause.
5 chickens != 5 dogs != 5 horses
Also:
* I need to have a 1 acre parcel, and I have only a bit over 0.25
* It needs to be 25 feet from all property boundaries and fenced in, which limits placement options
So my options, for this plot, are nil.I don't recall the 1 acre limit when I looked before, so I'm wondering if this has been updated.
Seriously, though, I have to abide by the local ordinances.
https://ballotpedia.org/California_Proposition_12,_Farm_Anim...
So, 1/8 acre could hold 3,630 “cage free” chickens, in theory (I am not condoning this).
In you don’t need much space to keep chickens happy. However, they produce a lot of dust, and can’t be kept in a house.
This was actually the most surprising thing about first time chicken ownership. I was expecting the poop, I wasn't expecting the dust and the dust bathing. They will pick one or more parts of the yard and crater it and use it for their dust baths, meaning that soil will transport elsewhere and you'll need to replenish the sand. You can kinda suggest where they do it (they prefer overhung spots that don't get rain, so it stays dry and dusty) but like cats and cat beds, they decide where to do it. I intended the under-coop space to be used for this, but they decided they like under my gazebo-tent was preferable.
In the 9 years we have had the hens, no one has complained. However many people bring their kids by to watch them through the fence.
Cheap linear actuators from Amazon with built in limit switches are the way to go IMHO: https://www.amazon.com/ECO-LLC-Actuator-Mounting-Brackets/dp...