Automated chicken coop - linear actuator control?

For a while (before I got into SmartThings) I’ve been working on automating my wife’s chicken coop. The main thing is controlling a linear actuator (something like For now it’s just controlled by an old 12v laptop power supply and a DPDT switch mounted out in the coop.

I have a Raspberry Pi with a relay controller & handful of other sensors (temp, humidity, ultrasonic distance sensors we may use for food/water measurement). I’ve got some rough Python code that will run the actuators (and measure the other stuff), but nothing polished at all, or implemented in a easy to use or secure manner.

Now that I’ve gone the SmartThings route & have it doing other things in the house (and running the lights out in the coop) I’m thinking about ditching the Pi & going with something that integrates with SmartThings. Any recommendations on relays or something else easily deployed to run the linear actuator? Not sure if I’d actually need any open/closed door sensors, but those are easy.

Basically I need to feed in +12v & ground and on command output +12v & ground or reverse that polarity, or leave an open circuit. The actuators have internal limit switches, so just sending them power for 30 seconds or a minute & letting the limit switches pop will work fine.

Will sticking a flood sensor in their drinking trough cause any problems with it being wet most of the time? Any good ideas for cheaply trying to measure the weight of a feeder or the height of the food inside (think roughly a 1 gallon jar size possibly hanging from a chain)?

I have seen but that is a bit expensive for my needs.

Mimo (dual relays) mimolite (single relay)

If you already have an actuator you can order the CoopBoss without it for just over $300. I know that is a lot more than a $50 dollar relay but I think you will end up adding more than that to get a fully functional system and it still may not be reliable.

I will be happy to help the best I can but here are a few things to consider in your solution:

  • Reliable and safe: As you said a linear actuator will run to its stop before it auto shuts off. If an object is in the path it will push up against that object until it either pushes through it and runs to its stop or burns out the motor or power supply. In either case when the actuator stops it mechanically locks in place trapping the object in its path. I would hate to have your wife come home to one of her hens trapped in your door. Or worse yet one of your neighbor’s kids.
    So to avoid this you will want to add some type of object detection. There are several options available the easiest wold be some type of beam sensor like you see at the bottom of your garage door. You will have two challenges with a beam sensor one will be false readings from debris in the door and the other will be how to hook it up to your $50 relay. I can’t see connecting your object detection circuit to the cloud it needs to be connected directly to your $50 relay. So now your talking about a custom circuit that not only detects an object and stops your actuator but reverses the motor to make sure you don’t trap the object. This can be done its not that big of a deal but you are talking more components and more cost and you still will have to go out and move straw and stuff out of the door’s path. (As a side note when you start and stop a motor with a switch you need to add a flyback diode to project your circuit). I can easily see you spending a considerable amount of time and money to do all this and still not have an optimal solution.
    The CoopBoss uses the current that runs the actuator motor to detect objects. If it detects a rise in current over the norm it immediately (with in milliseconds) will reverse the motor and open back up. The sensitive is settable with the SmartThings app to allow you to push through debris, but the SmartThings cloud has noting to do with the object detection circuit of the CoopBoss.

  • Automation: The whole reason the CoopBoss exist is to make sure the chickens are safe inside their coop with the door closed. After all we lost our hens because my wife and I both forgot to close the door one night . The door is closed based on sunlight level. It uses a locally attached photo sensor to measure the ambient light and close the door. The light that will trigger an auto close or auto open is settable with the SmartThings app but the SmartThings cloud has nothing to do with actually closing the door in the evening. Like the object detection circuit it is all built into the firmware of the CoopBoss.
    Since the auto door closing is based on a settable light value we can vary the close time easily with a slider in the smartphone app. Much to our surprise this was very useful when my wife introduced new hens to the flock. The new chickens were often chased out of the coop by the older hens in the evening. So we decreased the amount of light it would take to trigger an auto close to accommodate this. Once the new hens had worked there way into the flock we changed the light level back to the normal time. Now we have the auto open feature turned off as a coyote has been coming by in the morning. So we manually open the door to let them out after we scan and make sure it is clear.
    I share all this as I don’t think you will want to rely on the SmartThings cloud to determine when its time to close your coop door. You will most likely want to base it on some light value at your coop. That’s not a problem as there are several ZigBee based light sensors (for inside use) that you can use to trigger a close. But if your looking for a completely reliable solution you will want to hook the light sensor directly up to your $50 relay. So your talking about more custom circuits / code. I think at this point you would be well in to hundreds of dollars.

  • Convenience: So your out at your coop sweeping up and filling your feeders and you want to close the coop door. My wife has a road island red that has to get in my way every time I'm in "her" coop. I have to shut her out so I can sweep up, if I don't she starts squawking and that gets the rooster upset and then the real fun begins. It is sure nice to have a button that controls your coop door right there on the coop’s wall. So I think you will want to add a button to manually operate your door at the coop. One could make a case from a saftey standpoint you should have a local button to open the door just in case. That sounds simple enough right? Well to do it right so all you have to do is push a button and the door will open if it closed and close if it is open will require more custom circuitry. Keep in mind when you open the door locally a status report should be sent to SmartThings to update your $50 relay’s setting in the custom device type. This is all doable its just more custom circuits and code you will need to add.

I could go on there are several more features built into the CoopBoss I bet you end up adding. When it is all said and done I wouldn’t be surprised if you have 10 times the cost of that $50 dollar relay in your final solution.

1 Like

Thanks for the info. I’ve passed it on to my wife. I can afford to spend $50 & some time tinkering on HER chickens, but not $300+. She might though, especially after having to trudge through crotch high snow drifts to the coop a few more times. Hummm… might think about it for her Christmas present though… Unfortunately for me opening HER coop to let out HER chickens now falls to me, unless I want her to let out the rooster that has decided to hang out under the bedroom window & crow waking me up (she goes to work earlier than I do).

I definitely understand the development & feature cost & time commitments. I got things working with the Raspberry Pi, which was a decent bit of work, and have guess a how much work I have left to make it usable.

Right now I have a 12" actuator on a guillotine type door that goes to the chicken run. It doesn’t get used much & apparently the turkeys can’t get through hat door. The other door use to be a window & has a guilatine type door on it as well. My plan is to turn it into a drawbridge style door, as chickens often sit in the window in the evening. A drawbridge will dump them inside if they don’t move rather than squishing somebody. I have a spare 4" actuator I was going to try to use for the drawbridge, but haven’t been able to get the geometry right & may rob the 12".

Any guesses on how long until SmartThings certification? Not that beta or custom code scares me at all…

Any plans to add any features like controlling a 2nd door or food/water monitoring at all?

1 Like

What a good looking setup! You guys have a perfect place tons of space to let them move around. I love it! Look at that Tom he looks like a dandy! My wife had a wild turkey (hen) for about 4 months before she flew off and joined a flock that hangs out in our woods.

As for the certification I don’t have a clue how long it will take. My SmartThings cert guy has been responsive, I’m getting answers to my questions its just they can’t make any commitments. I think they have all hands working on stability these days.

Funny you ask about the feeder door. Our rooster got leg mites last spring. We think he got it form the wild birds that get in and eat the food in the coop. So I have been told I have to do something to keep the wild birds out. I don’t know if you have ever given a rooster a bath to kill leg mites but its not something you want to do often! I made a treadle feeder but only the younger hens figured out how to open it so it wasn’t a big hit with our older hens or my wife. So now I’m on to another version based on a peck sensor. I thought I would try it and see if the hens could make it work. The sensor was super easy I just used one of the SmartThing multi sensors that can detect a tap. I placed it in a wood box (our chickens love to peck on wood) and it triggers an auto dog feeder connected to a ZigBee plug. No custom hardware at all just had to write a SmartApp. Surprisingly the hens have figured it out in just a few short weeks. I started by putting some food on the wood box that sat right next to the feeder. The hens would peck on the box to eat the food and that triggered the dog feeder. Now they just walk up to the wood box and peck on it to turn on the dog feeder. I plan on writing it all up so anyone can build one once i get caught up. My next step is to replace the auto dog feeder with a feeder that has a door that opens when they peck on the wood box. I’m going to use a DC solenoid instead of an actuator to keep the cost down. It should work fine as the door will be light and have a spring to shut the door. The CoopBoss has two Aux ports on it and I plan on connecting the door with one of the Aux ports so the feeder will open with the coop’s door is closed or when a chicken pecks on the peck detector.

I will post my current peck detector SmartApp to my github site when I get a chance to clean it up. Thanks for sharing your coop picture! It looks like you have two turkeys, an Australorp, three Cinnamon Queens and the others I cant make out. How close was I? I bet my wife could name them all.

Good & bad news about that turkey… He tasted mighty good yesterday. It was our first critter we raised & ate (not counting the chicken eggs), will probably be doing some more broad breasted ones in the future. We have 3 bourbon reds (heritage turkeys) pestering the chickens now, 2 male 1 female. Here shortly the male that pisses us off the most is going to freezer camp.

We started off with 4 allegedly Ameraucanas, but turned out to be easter eggers & 4 buff orphingtons. We are down to 2 of the easter eggers & have acquired a pile of different color orphingtons. The 2 brownish ones are the easter eggers, the rest, including the dark brown fluffy one are orphingtons. Pretty sure the wife is going to be sticking with the orphingtons & a few turkeys from here on out. We have 3 roosters now, so I’m pretty sure the plan is to mostly grow our own flock a bit rather than buy more chickens.

Currently 14 degrees out here in Colorado, but the Turkeys don’t seem to care much. Chickens are less exited. The wife works today, but I don’t, so I got to go take care of em today. The Coop Boss is sounding like a better & better idea for Christmas. :-p

I know what you mean when it comes to snow and Chickens. We live in downstate Illinois and when we get snow our chickens will not come out of the coop. My wife sends me out to shovel a path for them after every snow fall. I was wondering if your Tom would make it through Thanksgiving. :grinning:

Any chance you have a coop boss lying around for sale… just finishing up my chicken coop now.

I ended up having some communication issues with my CoopBoss. Think the Zigbee radio in it or my SmartThings was having issues. John was great about support, but is going to be discontinuing the CoopBoss here shortly so I took a partial refund. I’d have stuck with the CoopBoss if he was going to.

I picked up the aforementioned MIMO2

Wire it up like the “DC Motor DIreciton COntrol using two SPDT relays as per” image on

No safety features, temperature or auto-open/close, but it’s a cheap replacement for the CoopBoss now that it’s going away. No manual button either, although I could probably figure out something as the MIMO2 has some input sensors to trigger on. I toggle the relays in SmartThings & set the routine on a schedule, which was my use case anyway. I just had to modify the open scheduled task as it appears to have stopped working at daylight savings time, but is now working again. I have a routine set to trip at 8am to toggle the relays to open & another one set for 45 minutes after sunset to toggle relays to close. So far it’s working pretty well.

At least 1 of the chickens is unhappy with the speed (she actually waited longer than usual), but that’s the linear actuator not the controller (this video was still on the CoopBoss when I had to hit the switch to open as it lost connectivity).

1 Like