Building an automatic chicken coop door opener
iotforall.com
iotforall.com
Now the problem is to separate the sick ostriches from the healthy ones. So the thinking is you connect the ostrich camp with a narrow passage to another camp, and put out food in the other camp and as the ostriches move to the new camp you capture and divert the sick ones.
Turns out that when you put out food in the new camp, only the healthy ostriches will move to the new camp and the sick ones will stay behind because they are in any case not interested in food.... which negates the need for engineer and his sensor in the first place :D
https://userweb.cs.txstate.edu/~br02/cs1428/ShortStoryForEng...
I don't believe this story
2.Put fan there to blow empty boxes: now defects == 0
I don't see the problem.
I used a normal (non-stepper) motor with some gearbox I found in an old cassette player. The door limits are detected using reed switches.
It is solar powered, with a 12V lead-acid battery. I've had to replace that twice over the 5 years because winter tends to kill it. Since then I've added a winter trickle charge wire from the nearest outbuilding.
The solar panel voltage into an ADC provides the daylight reading. An Arduino Nano provides the main control functions. It spends a lot of time in sleep mode, waking every 5 minutes to check light levels, and at night sleeps until a preset time when it makes sense to start checking for daylight again.
It also has an XBee radio link to a Raspberry Pi which sends me email updates, keeps the Arduino's clock accurate (obviating the need for an RTC), and alerts me of any mechanical problems with the door mechanism. A common one is straw and other mess getting jammed in the door runners, and once a broken door mechanism.
Over the years I've tweaked the opening/closing times to account for the hens' habits, and for predators. I've learned that the dawn/dusk opening technique is not enough on its own, it needs to know the time of day also.
It opens at 6:30am or first light, whichever is latest. Too early in the summer and you're asking for fox trouble, and also the neighbours used to complain the cockerel would crow when it opened too early (sunrise can be before 4am in midsummer).
My hens go to bed very early, so it closes before dark, and again at least by 7:30pm in the summer because foxes can be active by then.
We live in the country and almost everyone near me has hens, but they rely on manual opening. They have all lost their entire flocks to foxes at least once in the time my automated door has been operational, but thankfully we have not. I have seen scratch marks on the sliding door indicating interested predators, but I think my timing is right to keep the coop closed when foxes are about.
We live on a very small island of private property inside a huge expanse of open space / wilderness and thus have very heavy predation on any animals we raise.
In the case of our chickens, I just kept adding hot wires to the fence until nothing could get into the run. There are four hot wires now, two of which form a negative (back bending) slope. It is impossible for a thing to climb the fence now without touching (and holding) at least two hot wires. We've had our current flock for over a year with no losses, vs. losing every previous flock to raccoons and weasels every 2-3 months.
I wonder if you would comment on this (seemingly successful) strategy - you seem to know what you're doing...
They say you need as much fence under the ground as you have above it.
Your problem with being really isolated is that the predators will not be afraid to come out in daylight. If I were going for a tech solution I might start thinking about detection systems...
Or maybe just dogs?
I guess it comes down to how much hassle it will be for you if you need to replace the ESP8266.
It's bidirectional where you need a proper level shifter. But you can get really small cheap ones. I've used them a lot on I2C interfaces. If you're careful you can design the entire system around I2C and then you only need a single level shifter.
But I've not built many things around ESP8266 just yet. Still learning about it. It's an incredibly cheap and powerful platform though.
NiCad batteries handle 'trickle charging' much better than NiMH ones, which usually degrade significantly with overcharging. So NiCads are still used in places like alarm backups, power tools, or off-grid applications where they might be connected to a charging circuit for long periods of time between discharges.
And 18650 cells are great, but I would think carefully about using li-ion or li-po chemistries in areas where they will be exposed to the elements and unsupervised.
Nice. Slack is great for this sort of things and adds additional mute channel functionality for normal events. There is the odd service (eg Freshping) that will check it can ping your Pi, even when on your on a dynamic IP, and alert you to outages. Results also sent to Slack but not muted. I hope you have all the bad puns configured for your notification. “Chick in”, “chicken out”.
https://blog.garble.org/arduino-chicken-coop-hardware/
https://blog.garble.org/arduino-chicken-coop-hardware/
I've installed a few of these now and love em
I think we should question whether tech as a whole is moving in the right direction when the first question for building a time-controlled, battery-operated chicken door opener is "how do I connect it to the internet?"
(Sorry for the sarcasm, otherwise, it's a really cool project though)
It opens at daylight, closes at dusk. Adjustable tolerances in either direction which I need to adjust occasionally but not often, like after DST changes to allow the door to stay open longer while the chickens get used to the shorter days, ensuring they can get inside before the door shuts, with darkness falling earlier. Small solar charger and battery keep it operational.
I understand the impulse of the author to design something complicated, but practically speaking there is no need to remotely control the opening of the coop door over the internet, especially if you have a photoresistor already to detect daylight.
Needs to be battery operated and last for at least two weeks (14 days): UNOs are notoriously power-hungry. It's highly unlikely that 4 AA batteries can power an Arduino UNO full-time AND open/close the coop door. Maybe with some advanced deep-sleep-cycle, but I'd love to know more about this.
I also fail to see why he didn't use a cheap ESP-board. They're usually cheaper than Arduinos (as in: below 5 bucks), have an onboard WiFi chip and they run Arduino code just fine. You get a couple of pinouts less, but since he's only using a sensor and a stepper motor this won't be a problem.
If I were to make this, I'd go with a nodeMCU and a cheap solar charging setup. Probably would fit in the budget, too.
The naive Arduino code has two basic functions setup() and loop(). Putting your main code in loop results in a busy wait that spins up 100% of the CPU all the time. It's also running all the peripherals all the time.
You want to use "avr/sleep.h" and "avr/power.h" to put the processor to sleep with peripherals off (except the one which will wake up the processor). See http://www.gammon.com.au/power for a nice tutorial. Opening these headers and their source in the avr-gcc libraries and comparing to the documentation on the processor is a good exercise in getting right down to the metal of how the processor manages power.
You also want to get rid of the ancient 7805 regulator; many clones use a better LDO voltage regulator to alleviate the problems with high standby current.
Of course I'll do the googles too.
Once you've spent a while doing that you should be in a good place to start on more complex projects - there are a few robot kits designed to have a Raspberry Pi mounted on them to make them programmable, or maybe look at ESPHomelib[1] to do some home automation.
What's the key metric here? The chicken coop opens and closes at the appropriate time of the day? How does IOT help solve that objective? There's some great parallels here to an MVP in the software world.
As for my two cents, an alternative and more robust solution, could be put together with something like an aliexpress ambient light switch, limit switches, a recycled car battery, a trickle charge solar panel, and some relay logic.
Skipping the occasional visit doesn't work either - they need to get out both for general happiness and foraging, and if you don't close the door, creatures kill your chickens. (This has happened to us twice, and we're in the middle of suburbia, albeit the Seattle variety with more wildlife than the average cul-de-sac)
> The chicken coop opens and closes at the appropriate time of the day?
It's closed sometime after chickens have entered for the night, which tends to go off of sunlight, and opens early enough that the chickens aren't literally cooped up when they want out. That's rough, but the machine doesn't have to be perfect, it just has to do as well or better than we humans do.
As for what value does IOT add? Well, it can help confirm when it is/isn't working, but mostly it's that the cost is almost the same, at least for those of us without extensive electronics experience. Your alternative (I'm not sure how it's more robust) solution LOOKS cheaper, but I wouldn't know how to connect the parts and would likely screw up the amps/watts enough to break stuff and require replacement parts. For me, spending an extra $50 on parts is worth the saved time and effort - even as the $250 version that has no options for customization of behavior/interactions is NOT worth the saved time and effort.
Probably - it should be noted I've been researching this topic (along with any way to ensure the chickens ARE all inside - if they get broody they may nest elsewhere, which ends poorly) for the past year but so far we're still doing it manually. I expect this to change over the holidays.
> There's some great parallels here to an MVP in the software world.
Only in the vague "is this adding enough value to be worth it?" sort of way, but as the answer is "it depends" I'm not seeing the great learning opportunity you're implying.
The point is, almost all maker projects jump straight to let's throw an Arduino at it, with no consideration to the tradeoffs at all. This can be quite a disservice.
There are tradeoffs, eg. power management? (those batteries aren't going to last at all), fault tolerance? (arduino crashes due to condensation shorting out the timing crystal), maintenance? can you instruct an untrained individual to perform any meaningful repair work (eg. bend the arm on a damaged limit switch).
One benefit IOT can bring, is the detection of fault conditions etc (door took too long to open fully something stuck in the tracks), but implementing that kind of handling in a meaningful way is a complex problem.
These things rarely matter for a diy project, but you see this stuff everywhere. Consider whether a problem can be solved in an analog or mechanical manner, it's likely to lead to a simpler and more robust solution.
As for ensuring chickens are inside of a coop, that's a tough problem and I'm interested to hear your thoughts on that?
Eg. for the above chicken in coup problem, something as simple as a weight triggered switch on the ramp (or a push bar near the coop opening) is likely to out perform anything more complex.
My thoughts are definitely too complex. Currently I'm thinking of a camera that will turn on a light and take a picture (at a specified time || when door closes) and send that to our family Slack - someone will habitually look at any notification, and we don't have a large number of chickens so it's fastest to rely on human perception to see if someone is missing. Or just a camera that we can turn on remotely to check the feed ourselves.
That's the "simple" version - a more complex one would take a picture and compare to an empty sample to decide how many blobs there are, but that is hampered by (1) If chickens huddle, that becomes complex and (2) it's not a problem space I have any interest in, so the problems won't be fun to solve.
I know that in some contexts, RFID tags are used for livestock tracking. Don't know if they would comfortably work on birds though.
I've been playing around with Arduino and find the electronics easy but it's really hard to get good information about linear motion in terms of what parts to get and what wheels / accessories are compatible / needed with what tracks. Very few resources out there and I've ordered so many incompatible tracks, wheels, carriages, etc because I couldn't find any information on what mates with what.
Also, chickens are really fun animals, and they taste nice too.
Now I have to build an automatic door opener to prove my commitment. :D
My design was Raspberry PI -> sensor/power board -> battery powered drill. And an extra long usb cable to get the wifi dongle to the other side of the roost, because when the chickens were in the coop, they absorbed enough wifi signal to make it drop off the network.
Edit -- changed which twilight. Also, code here: https://github.com/wiredfool/coop-door
Unfortunately, schematics and physical door design are lost to several moves.
They were first in line for breakfast.