Episode: 1892
Title: HPR1892: my chicken coop
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr1892/hpr1892.mp3
Transcribed: 2025-10-18 10:52:08

---

This is HPR episode 1892 entitled Magic in Cube.
It is hosted by Genre and is about 10 minutes long.
The summary is Genre Blam about the block block house.
This episode of HPR is brought to you by An Honesthost.com.
Get 15% discount on all shared hosting with the offer code HPR15.
That's HPR15.
Better web hosting that's honest and fair at An Honesthost.com.
My name is Jezre.
Hello HPR listeners, I'm going to talk to you today about my chicken coop.
Now life is nothing but problems and solutions.
So I had a problem.
I don't have chickens and my solution was to build a chicken coop and put some chickens
in it.
Now you might be asking yourself why would someone want to raise chickens?
And I'm going to say I've got multiple reasons.
One, I like eggs for breakfast and two, I've got some tall grass on my property and grass
gets ticks and ticks bring Lyme disease.
And I don't want Lyme disease so the birds, which I let free range on my property, keep
the tick population down.
And I also like to just watch those little critters while I'm sitting in my coffee in the
morning.
So when it comes to building a chicken coop, one should have a design.
And yeah, who needs it?
So my plan was to build a coop and that was basically the only plans I really had.
Honestly, I just kind of winged it.
And in hindsight, a bit of planning would have alleviated some problems.
But if I didn't have the problems, I would not be recording this episode of HPR today.
Here's the first big problem that I encountered.
My coop is a four foot cube and it sits underneath an extension I built onto my shed that is
eight foot by eight foot.
On one end of the coop is a one foot nesting box.
And there is a human access door into the coop that is entire four foot side.
This means that when the coop is underneath a shed extension, the access door cannot open
all the way.
In fact, it can't really open much at all.
So my solution was to make a goal wing door, similar sort of to a delorean.
And so my door horizontally has an extra hinge in it and it is hinged at the top.
And so it sort of just folds up like a going sweet.
The next problem I encountered was that some of the birds could not get up the little ramp
to go through the door into the chicken coop.
And the easiest solution there was to extend the length of the ramp so that the angle of
the ramp is not so steep.
And I added some extra little footholds too.
This allows birds from the size of a bantum chicken, which is basically a half size chicken,
up to a turkey, guinea hen, and duck to access the door to get into the coop.
Another problem I had was that just outside of the bird door to the chicken coop, there
was a flat landing platform.
I put this there so that birds could come out of the coop, stand on the platform, maybe
stretch out, and then go up on about their day.
Unfortunately, this caused a problem of chickens trying to roost on the platform in front
of the door.
And if a bird came up to roost on that platform, none of the other birds could get into the
chicken coop.
So I just removed the platform.
Problem solved.
So let me tell you a little bit about the door itself.
And my desires and needs for having a chicken coop door.
I wanted a chicken coop door that would open automatically and close automatically at
certain times in the day.
Now commercial versions of such a contraption can be purchased for around $200.
They are light activated, and there's something you need to know.
Raccoons have opposable thumbs.
They can pick shit up.
They could easily pick up a flashlight, point it at the light sensor, open the door, get
into the chicken coop, and eat all the eggs and the chickens.
No, no, my friend.
I would have no such thing.
I then decided to build my own chicken coop door, and it came in at about $100 in components.
Oh, dude, shut the fuck up, I'm trying to record over here.
So what I ended up with was a 12 volt car antenna, a 12 volt power adapter for a computer,
three relays, and a beagle bone black.
The chicken coop door slides open horizontally, and it, as I said, is powered by a 12 volt
car antenna.
The beagle bone that powers the chicken coop door, or I should say controls the chicken
coop door, has a cron script that runs at 3.30 a.m.
This cron script queries ares weather API to find the civil and nautical twilight times
for the following day.
Civil twilight is defined as the sun being 6 degrees below the horizon.
Nautical twilight is defined as the sun being 12 degrees below the horizon.
At civil twilight, when the sun is 6 degrees below the horizon, a human being can go out
and about and do their business without having any artificial light source.
So what I decided to do was open the door at civil twilight.
And close the door at 9 degrees below the horizon, which is halfway between civil twilight
and nautical twilight.
That way it would be dark enough for all the chickens to be in, but light enough for
nocturnal predators to not be out yet.
And I tested all of this by sitting in my hammock that is near the chicken coop door,
back in a cold one sitting back in a relaxing and watching and waiting for the sun to set
and the chicken coop door to close.
The chicken coop door controller script has a main loop that runs as follows.
Check a plain text file to see if there is an open or closed command, sleep for a little
bit, and then continue the loop, and that's all it does.
There is an open door script and a closed door script, and all they do is write to the
controller text file either open or closed.
And then when the controller sees that it should open or close, it performs that action.
When the chron script runs to determine when the door should open and close, the at command
is then used to at open time run open door script at closed time run closed door script.
And as this gets added to the at queue, everything gets done at a very specific time.
Magnetic switches in the door detect if the door has closed or opened properly, and there
is a timeout on the opening and closing of the door.
Once the opened or closed event is recognized, the main controller script runs either door
open or a door closed script, and passes if a timeout is hasn't.
Are you done?
There are magnetic switches in the door to detect if the door has closed or opened properly,
and there is a timeout on the opening and closing.
Once the opened or closed event is recognized, the main script runs either the door opened,
script or a door closed script, and passes to that script whether a timeout has occurred.
Both scripts are nearly identical in that they will email me when the door has opened
and closed, and if there is an error, they will run another script that will send me a text
message.
The final problem, well, I shouldn't say final, but the next major problem I had is that
there was no way for me to manually open or close the door.
I just couldn't do it, and technically I still can't do it.
However, the computer that controls the door opening and closing is connected to my home
network.
So I wrote an extremely simple Python WSGI web app to display the door state, the open
and closed time, and provide a button to open and close the door.
So now I have a web accessible chicken coop door that I can control with any device on
my network with a standard compliant browser.
Since the door is web accessible, I can also use Blather to control the door with voice
commands.
Boo-yah!
And that my friends is my chicken coop door in a nutshell.
Thank you for listening, and catch you on the flip side.
There, at some dried maggots.
Yeah, you like those, don't you?
Oh yes, something I missed.
When I first created my chicken coop, there was a problem with getting the chickens into
the coop at night.
It wasn't just navigating up the ramp that was a problem for the chickens.
It was actually knowing that they should go in there at all.
So on the side of my chicken coop, I drilled two small holes.
And over those holes, I glued two broken solar powered lights.
Basically, the kind of light that you would see in your yard or someone's yard, the
little solar panel up top, light detector up top, LED on the bottom.
And when I placed that in the side of the chicken coop, as the sun passes overhead during
the day, it charges up the battery, and then once you get stark enough, the light shines
on the inside of the coop.
And the chickens, seeing that it is light inside of the coop, know to go towards the light.
Yeah.
You've been listening to Hecropublic Radio at HecropublicRadio.org.
We are a community podcast network that releases shows every weekday, Monday through Friday.
Today's show, like all our shows, was contributed by an HPR listener like yourself.
If you ever thought of recording a podcast, then click on our contributing to find out
how easy it really is.
Hecropublic Radio was founded by the digital dog pound and the Infonomicon Computer Club,
and is part of the binary revolution at binrev.com.
If you have comments on today's show, please email the host directly, leave a comment
on the website or record a follow-up episode yourself.
Unless otherwise stated, today's show is released on the creative comments, attribution,
share a life, 3.0 license.
