
BACKGROUND
In case you’re not up on the latest home-scale farming trends, the big buzz these days is a thing called a Chickshaw. Think of this as a rickshaw for chickens. The basic function of this device is that of a mobile chicken coop. The idea is you move it to a new spot every few days so the chickens always have a fresh patch of grass to play on. At night, you tuck the chickens away inside so they don’t get eaten by coyotes, racoons or owls. In the morning, you let them back out. My buddy Dan from The Grass-Fed Homestead recently acquired one of these contraptions. And after a few weeks of closing the chickens up at night once it got dark, nearly 10:00 his time, he decided it needed an upgrade. And at that point, the seeds for a Chickshaw door controller were sown.

THE SOLUTION
Dan’s setup provided several big challenges. The first is that he has a lot of property, and most of it isn’t near an electrical outlet. This meant our solution had to be battery powered. Fortunately, he already uses a 12V battery and charger for some of his electrical fencing. So we decided to build the Chickshaw opener using the same type of battery. The other difficulty we encountered is that Dan’s chicken pasture isn’t WiFi enabled. This eliminated the option of using a Particle Photon. We briefly considered using the Photon’s cellular-based sibling, the Electron. And while he does have good cell coverage, we opted to go with a simpler, non-connected controller. This decision was driven partly because there wasn’t a compelling need for “remote” operation. The other factor is that while the cellular option is cheap (around $3/month), Dan didn’t want to hassle with a recurring bill. So at the end of the day, we decided on a version of the Arduino, known as a Micro.

The final obstacle we encountered was how to actually open and close the door. At first we toyed with the idea of using a small winch connected to the top of the door. This would have allowed us to raise and lower it. The tricky part with this approach would be stopping the motor when it reached its final positions. We could have used a magnetic “reed switch” at the top, which would work like the door sensor in a home security system. The switch would break the circuit and turn off the motor once the door was closed. Unfortunately, this approach wasn’t nearly as easy when we looked at the door in the open position. There just wasn’t a convenient place to mount the sensor.


Our next option was using a linear actuator. We considered mounting the motor to the existing door and surrounding frame. But there just wasn’t enough space. We also couldn’t get the geometry to work so the door would open all the way to the ground. I was starting to get frustrated, when suddenly inspiration hit. I had a flashback to the Millennium Falcon (from Star Wars) and how its loading ramp worked. Problem solved!


The last piece of the puzzle was how to generate the open and close commands. If our project was connected to the Internet, we could get data from one of many online weather services. These would alert us to the exact time the sun sets and rises in Dan’s part of the country. Since this wasn’t an option, I opted for a simple photo sensor board. These only run a couple of bucks, and can give you a nice clean on-off signal for the Arduino to read. These boards also have a manual dial that allows you to adjust the sensitivity of the photo sensor. Otherwise, you could run into situations where the door closes on a cloudy day.

Dan lives more than 2,000 miles away, so I wasn’t able to help him put things together. Instead, I pre-assembled the controller and mailed it to him. Fortunately, he captured some pretty cool videos to document the setup and installation.
HAVE FUN BUILDING!
PARTS
- 16″ Linear Actuator
- Photo Sensor Board
- Arduino Micro
- Relay Board
- 12V to 5V USB Voltage Converter
- Waterproof Box
- Breadboard
- 12 V Battery
- Speaker Wire
- Wire Strippers
- Butt Connectors
CLOUD SERVICES
- N/A
THE CODE
bool daylight = false; int lightReading = -1; // For more info on Arduino pin numbers, check out https://playground. // arduino.cc/Learning/Pins void setup() { pinMode(A1, INPUT_PULLUP); pinMode(2, OUTPUT); } void loop() { lightReading = digitalRead(A1); if (lightReading == 1){ daylight = false; digitalWrite(2,LOW); } else { daylight = true; digitalWrite(2,HIGH); } delay(1000); }
UPDATE: 9/7/17
For those interested in a door for a standard chicken coop, below is a vertical example. This works well for keeping racoons and possums out.

UPDATE: 9/8/17
Several folks have asked for a wiring diagram, so I’ve drafted one using a new tool (at least it’s new to me). So take a look and let me know if this helps. Here’s a link to the original file that you can zoom in on to see the details – chickshaw-wiring-diagram.png.
CAUTION: When assembling the 12V side of your project, don’t touch the black and red, or the two cyan wires together. If you do, you will short-circuit your battery, fry the wires and release the magical smoke genie contained within your electronics. If you want an example, go to the 6:17 minute mark in Dan’s Part II video above.

Very cool concept, thanks for sharing. Thing of doing something similar with a different function in mind.
What are you looking to do?
What size box did you use? The amazon link has four different sizes A, B, C, or D?
Box C works the best for this sized setup.
What would it cost me for you to build that little box and send it to me?
I know this would be overkill for the application, but I have the actuator for a lift chair. Could this be used instead of the 16″ Linear Actuator?
The answer to this is probably. The key things you’d want to make sure of: (1) does the voltage to match your battery, (2) is it the right length, (3) is it water proof and, (4) do you have compatible mounting hardware and/or can you rig something that works. To your point, I wouldn’t have any concerns over whether the chair lift component is powerful enough to work the door.
Instead of a battery is there an option for a small solar powered device?
Hi Joshua. Well, yes and no. For this project, you’ll always need a battery since the door opens and closes when it’s mostly dark. However, you can use a solar panel to charge this battery. That would eliminate the need for having to remove the battery for charging. If you decide to actually built this kind of setup, let me know and I can run some quick calculations on how big of a solar panel you’d neet.
I’ve ordered all my parts and would like to implement the solar panel for charging the battery…can you give me an idea on the size I would need?
So excited to get this up and running on my new eggmobile!
Hi,
This looks very cool. Our coup is built into our garage so I can use household power. How could I hook this up to a house hold outlet? Can I use this – https://www.amazon.com/DROK-Switching-Transformer-Converter-Wide-range/dp/B01LENMPUO/ref=sr_1_2?ie=UTF8&qid=1504295074&sr=8-2&keywords=120+v+to+5v+converter
Thanks,
Jeff
Yes, you can definitely hook this up using AC power. There are two different voltages you’ll need to provide: (1) 12V for the actuator and (2) 5V for the USB components.
The simplest solution for this would be to use a standard 12V power supply (http://amzn.to/2vRiEhF), a generic USB wall charger (http://amzn.to/2ew19Rp) and a micro USB cable (http://amzn.to/2wq4wza).
The big thing to look out for with the 12V power supply is you want to make sure it can supply enough current, which is why I’ve listed a 5 amp model.
Auto Chicken Door: The photo sensor method has too many false triggering scenarios with stray light from other sources at night because it is set to a high sensitivity to detect “really dark” after dusk. Any false triggering will open the door and a predator will get in and wipe out the whole flock in one night. Even a high rate of perfect function, one error event could destroy the whole flock. Too high of risk. You need a more precise and accurate means to sense day and night and make sure that the door is always closed at night, false triggers down to 1 in 100,000. Use an internal clock which compares to a sunrise and sunset database loaded into an EPROM.
Thank for the feedback! There are definitely multiple ways to tackle this project. One solution Dan and I explored was using a web-connected service available from various weather sites. These actually provide exact sunrise and sunset times based on your location and the time of year. We opted not to go this route because of the connectivity challenges at this location.
Great project
I’m in the uk and looking on the uk amazon website I cannot find the
Gowoops Micro Board for Arduino, Leonardo Mini Controller 5V 16 MHz ATmega32u4 Module
Is there something else on http://www.amazon.co.uk I could use or could you ship one to me?
Thanks
David
Thanks David!
You can actually use any Arduino compatible board for this project. Here’s a relatively inexpensive option:
https://www.amazon.co.uk/OSOYOO-Arduino-ATMEGA328P-Module-Micro-controller/dp/B00UACD13Q/ref=sr_1_5?ie=UTF8&qid=1504321086&sr=8-5&keywords=arduino+micro
Just make sure you get the right USB cable for it. This particular product listing doesn’t mention the type, but it looks like a USB Mini B.
Can you please post a schematic on the wiring of everything or do we need you to do it and we pay you for it.i really like this Idea and I’ve been looking for a reason to get into arduino projects.
Could I run this system off a 12 volt battery and also my electric fence charger that takes a 12 volt battery?
Sure, I can put together a wiring diagram and post it, no need to pay for that. 🙂
This is actually a good project to get into because there’s very little coding, but you do get the experience of using what’s called a “relay” to control higher voltage things (in this case the actuator). Once you’ve got that down you can move into to controlling anything electrical like lights, motors, fans, etc.
As for your question about 12 volt systems, what you’re describing is exactly what Dan Ohmann built. He uses an extra fence charging battery that he swaps out when it needs charging. The only parts of the system that don’t run on the 12V are the electrics, which is why I have the 12V to 5V converter module (http://amzn.to/2wwyscV).
Let me know when you think you’ll get started, and I’ll try to have a schematic put together by then.
Thanks for checking out the site!
Hi Elijah. I’ve drafted a schematic that shows how to connect the wiring for the system. Take a look and let me know if you have any feedback. It’s my first time using this kind of software to document a project, so I’m curious if it make sense and is readable.
I would also like to see a schematic. As soon as I saw this I wanted to buy everything and build it. My only hang ups were how to properly wire and how to program the code. Thanks in advance for posting! I can’t wait to build this!
Hi DJ. I’ve posted a schematic, which I hope helps. And here’s a link on the basics of getting an Arduino up and running with new code https://www.youtube.com/watch?v=64oEr1zTlOg. The only thing you’ll need to do different from the video is change the “board” to an Arduino/Genuino Micro (if you bought the one in my post), and cut and paste the code from above. I’m also going to spend some time working to create a simpler version of this control unit that won’t need any coding.
Thanks for putting a wiring diagram together. I really like this project, but Ardunio is new for me. I’m trying to understand relays and move into the physical world.
Thanks for putting this together! I’d like to use this but I only need to move a door vertically like a guillotine. Is a linear actuator still the best way to do this?
Hi Daniel. Yes, the linear actuator is definitely the best way to go for a guillotine-style door. That’s what I use for my duck house. The features I especially like about this setup are that it doesn’t require any special sensors to stop it at the top and bottom, and it’s impossible for racoons and possums to lift. I’ve added an image at the bottom of this post.
Any long term reports on this project? Does having the constant closed or open circuit sending power to the actuator have any negative effects?
Hi Nicholas,
Sorry for the slow response. I have a similar version of this working for a duck enclosure that has been operational for a couple of years. Actuators like these are pretty rugged and are designed to be opened and closed on a regular basis. The nice thing about them is they have built-in limit switches, which are built specifically to handle continuous power … i.e., they turn off the power to the motor internally once the rod is has been fully extended or contracted.
Hope that helps.
-Charlie
Are you a teacher? Your explanations and photos are so clear. I love it! When I build a chickshaw, I’ll come back to this. Thanks!
Thanks for the compliment, Martha! I’m not a teacher now, but I was a long, long time ago. 🙂
Would this type of battery with solar panel attached replace the battery alone?
https://www.amazon.com/dp/B000BWZB74/ref=cm_sw_r_cp_awdb_VeF5zbRX4HPWZ
IF you had these pre-made and programmed i’d buy one!!
Thinplacefarm@gmail.com
Just rewatched some of the video. Its VERY dark out when the door shuts. How long after dark is it before it shuts? Has this been addressed with the code?
Hi Jason. I’ll start with saying that there are multiple options when it comes building the sensor for this project. The one I describe in this post uses a little circuit board that has a tiny dial you can adjust with a screwdriver. This lets you change how dark it has to be before it opens/closes. I’ve also built a similar version that has a non-adjustable sensor, but aligns very closely with the light levels at dusk (http://amzn.to/2zEhKb6). And the final version, which is the one I use, has an internet connection to a weather channel feed that gets an alert at sunset/sunrise. This one is based on location and time of the year, rather than actual light levels.
My point being is there are definitely options that allow you to control the level of darkness that triggers the door.
If you’re interested, I could pre-build and program the control unit and ship it to you. What would be left for you to do would be the physical installation of the door, battery, actuator, and wiring. The cost of a base control box would be around $80 plus shipping. If you wanted a more advanced version with weather channel data (like I mentioned in my other reply), etc., that would cost more … but most people don’t need extra bells and whistles.
thanks for the reply and sorry i took so long to get back. I’d be interested in buying the system for $80, i’m just so busy it makes sense for me. Also, think someone else had asked this but no reply yet…can i use my Solar IntelliShock® 60 Energizer for this? I’m not really using it anymore so it has a battery and solar panel on it already. guessing not because not but let me know. If i’m going to make this more “self sufficient” i should go all the way! If i use another battery how long does it stay charged for based on your experience and how do you recharge it?
are you still able to prebuild and ship the control unit. If you are I am interested. Please send me the current price on this option.
Cdfairchild: I would like to take you up on the programming and wiring of everything. I am too busy to do it myself. Can you please e-mail so that we can work out a deal?
Thanks,
DJ
I am beginning to make my own chickshaw and I would like to purchase the chickshaw door controller… that Dan has… from you, please.
Chickshaw door controller… solar powered?
Ok, so I’ve built it. But I think I’ve done something wrong. I wired it up and it started opening, I couldn’t believe it. But, it won’t close. I’ve covered it, left it in pitch black for hours, but I’m starting to think I’ve done something wrong. Any suggestions on where I should start troubleshooting? Thanks in advance, I love this project.
I’m still wrestling with this. The IN1 and IN2 lights on the 4 relay module remain lit at all times. In the video it doesn’t seem like they are ever on. Can you let me know what that means?
Russell – I just wired this up and am having the same problem. Did you ever solve it? Thanks.
This is entirely too awesome, great stuff! How much work would it be to control the opening and closing of the door through a wireless router?
A couple years ago I got home late one night and we had lost all of our chickens before we could secure the coop. An automated door like the one you designed would help prevent loss.
I am in the process of building chickshaw been thinking about automatic door and I would like to purchase the door controller would you build one for me please
I wanted to install the door controller on the MiniMe version of the ChickShaw, but it appeared that I would need to continue to use the front door, since the Mini’s floor looked too small for the door to go there. Finding a geometry that worked was a little difficult, but did manage to find a setup that works.
See: https://bnordgren.org/files/ChickDoor03.mp4
If anyone wants to try this, I can help with figuring out exactly where to mount things.
Hi CDFairchild,
Could you build for me and ship? If so, please email me details. Thanks!! M
Hi Megan!
Sorry for the slow response … I haven’t been to my own site in almost 2 years, but I’m finally back. Let me know if you’re still interested in the controller unit, and I can check the latest pricing for the parts.
-Charlie
How would you put a 30-minute delay closing the door in the code using millis()?
Hi Ron!
For this simple application, I would use the delay() function, which stops the code for a number of milliseconds equal to the number you put in it. Below is some revised code you could use. Two things to note. The first is I’ve put in a 1.8 million millisecond delay, which is equal to 30 minutes, after which the digitalWrite function closes the door. Also, since the only time you want the code to be “paused” is when you’ve just transitioned from light to dark, I added an “if (daylight == true)” block of code. This allows you to skip the 30 minute delay if it was already dark.
bool daylight = false;
int lightReading = -1;
// For more info on Arduino pin numbers, check out https://playground.
// arduino.cc/Learning/Pins
void setup()
{
pinMode(A1, INPUT_PULLUP);
pinMode(2, OUTPUT);
}
void loop() {
lightReading = digitalRead(A1);
if (lightReading == 1)
{
if (daylight == true) /* This line checks to see if it was previously daylight */
{
delay(1800000); /* This line delays 1.8 million milliseconds, or 30 minutes */
daylight = false;
digitalWrite(2,LOW);
}
daylight = false;
digitalWrite(2,LOW);
}
else {
daylight = true;
digitalWrite(2,HIGH);
}
delay(1000);
}
i built a chickshaw and also automated the door with your base code, but also have it opening the door with the hinges on the top. The hens just jump in and out; this will work work with the mini-shaw. i also have added solar power as well. Using the arduino micro, but am looking at changing it out with the Particle Photon and also the Arduino Nano33 IoT. Will add battery power level monito and Temp/Humidity readings. I have a 3 gallon water bucket with to submersible pump and heater to circulate water on the water nipple drinker.
4 years later…I finally got around to putting this together but am having the same issue as Russell Glass above: Actuator extended, but does not retract. IN1 & IN2 relay lights are on continuously. I’ve tried everything I can think of to fix it with no success. Any ideas?