Jump to content

chicken coop door opener and closer

Daniboi

hi,

 

i am looking into making my own chicken door opener and closer. the idea is that at a time that is set by me the door shall open to let the chickens out. i have a general idea of what i am supposed to be looking for but i wanna ask to see if what i am trying to build in my head first and the parts needed is a good idea and if i have left anything out. so far my parts list would be:

 

a piston that is triggered by a raspberry pi or Arduino

a raspberry pi x2 one to set the device off and make it move and the other to poteinally run a web sever off so we can close it from anywhere

a method of powering the entire system that preferably is battery operated

 

after that i have i have no idea what would be used to make this project and was hoping to have someone point me in the correct direction. would this project be difficult to do? i am into electronics but havent studied it in about 3 year but i do still have an interest. where would be a good place to start?

Link to comment
Share on other sites

Link to post
Share on other sites

Oh EZ. So to clarify, you want the door to open at a certain time of day and close at another? if that's the case, I see 2.5 ways to do this. The first 1.5 ways is to use an arduino and a real time clock (RTC) of some kind. There are a bunch of different ones out there, usually they have a little coin cell battery to keep them powered even when the device isn't powered. The 0.5 idea is to use a cheap GPS module to get the precise time from the atomic clocks that orbit our planet. There's no kill like overkill, right? Next, your code will look something like this to actuate a linear actuator or maybe a pneumatic cylinder if you're feeling really spicy. 

Spoiler

while(openTime<currentTime<close time)
  digitalWite(gatePin, HIGH);
digitalWrite(gatePin, LOW);

 

Method 2 is very similar to method 1 and 1.5, but you would use an ESP32 or 8266 to get the time from a website, then use the same logic to control an opening device. Using an ESP exposed on an open port would also allow you to open the gate manually from anywhere with an internet connection, but I don't think that's a good idea. Maybe just keep it on the local network.

 

For power, you would really want to hardwire this into something so you don't forget to swap the batteries out or something.

ASU

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, Hackentosher said:

Oh EZ. So to clarify, you want the door to open at a certain time of day and close at another? if that's the case, I see 2.5 ways to do this. The first 1.5 ways is to use an arduino and a real time clock (RTC) of some kind. There are a bunch of different ones out there, usually they have a little coin cell battery to keep them powered even when the device isn't powered. The 0.5 idea is to use a cheap GPS module to get the precise time from the atomic clocks that orbit our planet. There's no kill like overkill, right? Next, your code will look something like this to actuate a linear actuator or maybe a pneumatic cylinder if you're feeling really spicy. 

  Reveal hidden contents


while(openTime<currentTime<close time)
  digitalWite(gatePin, HIGH);
digitalWrite(gatePin, LOW);

 

Method 2 is very similar to method 1 and 1.5, but you would use an ESP32 or 8266 to get the time from a website, then use the same logic to control an opening device. Using an ESP exposed on an open port would also allow you to open the gate manually from anywhere with an internet connection, but I don't think that's a good idea. Maybe just keep it on the local network.

 

For power, you would really want to hardwire this into something so you don't forget to swap the batteries out or something.

thank you so much, do you have any idea where i could but this all from? i probably would just use the rtc as that sounds to be the easiest method of doing this. would aliexpress be a good start?

Link to comment
Share on other sites

Link to post
Share on other sites

Lol, i thought of this a few years back but realized it was easier to walk out in the morning and open the coop and close it in the evening.  amazon has an assortment of automatic coop doors if you would rather just buy one.  If you plan on still building one definitely a purchase list and some pics.  Have fun and good luck.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Daniboi said:

 would aliexpress be a good start?

Yes. Assuming you're in the US, I've had very good luck with eBay for hobby electronics like this, often faster shipping too. The more I think about it, the more I like the local network ESP solution. ESP8266s can be had for $4.75 shipped from a US seller https://www.ebay.com/itm/NEW-NodeMcu-Lua-ESP8266-CH340G-ESP-12E-Wireless-WIFI-Internet-Development-Board/223494599672?epid=6025110158&hash=item340950f3f8:g:0EgAAOSwQKdcwiyN

ASU

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Hackentosher said:

Yes. Assuming you're in the US, I've had very good luck with eBay for hobby electronics like this, often faster shipping too. The more I think about it, the more I like the local network ESP solution. ESP8266s can be had for $4.75 shipped from a US seller https://www.ebay.com/itm/NEW-NodeMcu-Lua-ESP8266-CH340G-ESP-12E-Wireless-WIFI-Internet-Development-Board/223494599672?epid=6025110158&hash=item340950f3f8:g:0EgAAOSwQKdcwiyN

sadly my friend i live in the uk :(( but ebay is a great idea

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Beowulff83 said:

Lol, i thought of this a few years back but realized it was easier to walk out in the morning and open the coop and close it in the evening.  amazon has an assortment of automatic coop doors if you would rather just buy one.  If you plan on still building one definitely a purchase list and some pics.  Have fun and good luck.

I mean that is entirely true that you could just go and buy one but then where is the fun in that? thanks for the luck i will definatly need it :))

 

Link to comment
Share on other sites

Link to post
Share on other sites

When you're just running it from a clock, you might leave chickens outside or even squish them in the door (reallly unprobable but still...).

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, startrek03 said:

When you're just running it from a clock, you might leave chickens outside or even squish them in the door (reallly unprobable but still...).

so thats why i would like to be able to control it from my phone or the web sever, the idea is that we stand by the window and wait until they go in and then we close it

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, startrek03 said:

When you're just running it from a clock, you might leave chickens outside or even squish them in the door (reallly unprobable but still...).

Could bake in an ultrasonic sensor or laser trip wire (like a garage door) to check for chickens.

ASU

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Hackentosher said:

Could bake in an ultrasonic sensor or laser trip wire (like a garage door) to check for chickens.

Thought of that aswell, but you might not be able to count the chickens correctly because real life and stuff.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Hackentosher said:

Could bake in an ultrasonic sensor or laser trip wire (like a garage door) to check for chickens.

that sounds like a headache to sort out tho right? wouldnt it be easier to run an web sever that can be controlled remotely?

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Daniboi said:

that sounds like a headache to sort out tho right? wouldnt it be easier to run an web sever that can be controlled remotely?

Totally agree on that. Counting things or especially animals with just some simple sensors doesn't sound too easy.

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, Daniboi said:

that sounds like a headache to sort out tho right? wouldnt it be easier to run an web sever that can be controlled remotely?

Not really, If you have an IR laser diode always on landing on a photocell (assuming it can detect the wavelength of the laser of course), you would just monitor the state of the photocell. If it reads low, then it needs to invalidate the condition to close the gate. Something like

if(analogRead(tripWirePin)>500)
digitalWrite(gatePin,HIGH);

after you exit the while loop I described above. You'll have to play around with the value in the if statement, but that would be a way to do it. All of this would be in the loop function of an Arduino program, of course, so that once the tripwire pin goes over that value and the time is in the closed part of the day, the gate will close.

 

edit: whoops, missed the "leave chickens outside" bit. No problem, add a second trip wire. Then you can tell when a chicken enters or leaves based on which tripwire is toggled first. I would declare a global variable in the program keeping track of the chickens in the coup, and then use that variable as the control on whether its okay to close the gate. Something like 

if(restingHatchedEggs>=20)//or however many chickens you have, idk I'm an engineering student not a farmer
  digitalWrite(gatePin, HIGH);

 

ASU

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Hackentosher said:

Not really, If you have an IR laser diode always on landing on a photocell (assuming it can detect the wavelength of the laser of course), you would just monitor the state of the photocell. If it reads low, then it needs to invalidate the condition to close the gate. Something like


if(analogRead(tripWirePin)>500)
digitalWrite(gatePin,HIGH);

after you exit the while loop I described above. You'll have to play around with the value in the if statement, but that would be a way to do it. All of this would be in the loop function of an Arduino program, of course, so that once the tripwire pin goes over that value and the time is in the closed part of the day, the gate will close.

This solution doesn't prevent left out chicken, though, since it doesn't count and therefore doesn't know the number of chickens inside the coop.

Link to comment
Share on other sites

Link to post
Share on other sites

15 minutes ago, startrek03 said:

This solution doesn't prevent left out chicken, though, since it doesn't count and therefore doesn't know the number of chickens inside the coop.

Chickens naturally go back in their coop in the evening before dark.  As long as the door is set to close at dark there should be no chickens left outside. 

Link to comment
Share on other sites

Link to post
Share on other sites

13 hours ago, Hackentosher said:

Oh EZ. So to clarify, you want the door to open at a certain time of day and close at another? if that's the case, I see 2.5 ways to do this. The first 1.5 ways is to use an arduino and a real time clock (RTC) of some kind. There are a bunch of different ones out there, usually they have a little coin cell battery to keep them powered even when the device isn't powered. The 0.5 idea is to use a cheap GPS module to get the precise time from the atomic clocks that orbit our planet. There's no kill like overkill, right? Next, your code will look something like this to actuate a linear actuator or maybe a pneumatic cylinder if you're feeling really spicy. 

  Reveal hidden contents


while(openTime<currentTime<close time)
  digitalWite(gatePin, HIGH);
digitalWrite(gatePin, LOW);

 

Method 2 is very similar to method 1 and 1.5, but you would use an ESP32 or 8266 to get the time from a website, then use the same logic to control an opening device. Using an ESP exposed on an open port would also allow you to open the gate manually from anywhere with an internet connection, but I don't think that's a good idea. Maybe just keep it on the local network.

 

For power, you would really want to hardwire this into something so you don't forget to swap the batteries out or something.

If you were to go the pneumatic way surely you would need a valve and cylinder?

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, fdfdfdf said:

If you were to go the pneumatic way surely you would need a valve and cylinder?

Right, I was mostly discussing the control scheme as it seems like that’s what OP was having the most trouble with. 

ASU

Link to comment
Share on other sites

Link to post
Share on other sites

You could go solar powered, panel on the roof and a small battery. ?

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

My first thought was to something really basic like this :

 

image.png.5687e34729999ef50812688a71a1ca49.png

 

Basicaly, the door on a hinge at the top and a sliding lock on the side.

You can use a solenoid to pull out or push in (or slide in/out, whatever) the lever to lock the door.

You can add a sensor to detect when door is down all the way for example an infrared emitter (a led) on one side of door, infrared receiver on other side, or on each side of the bottom left corner) ... when door is down, the infrared beam is blocked by the door, when it's opened the receiver sees the infrared beam. If you put the sensor across the door you could also detect when a chicken goes through the door. 

You can have a motor of some sort on top (could add gears to reduce speed and improve weight lifting ability) that spins and wraps the wire on a spool raising the door. When you want to close, just loosen the motor and the weight of the door will keep the wire tensioned

 

Another concept would be using a system similar to the one on cd/dvd trays ... add rails with teeth on each side of door, screw two wheels on the sides of the door and a stepper motor can just lift up the door, or you go the other way and lower the door ... think like guillotine.

that's a bit risky as in you could catch a chicken right as it goes through the door and kill it if the door falls down too quickly, and it's also more annoying because you would have to periodically lubricate the wheels and teeth and make sure there's no crap so that door can slide up and down easily.

 

A simple esp something would be enough, connect it to your wireless network and you more or less can access it from anywhere (port forward the esp's wireless address on your router if you wish)

A motor to lift the door would need 12v, so a basic 7Ah lead acid battery for UPSes, or motorbikes would work if you don't have power or don't wish to have wires to the chicken coop. A solar cell panel and a voltage regulator to boost to ~ 13v to top up the 12v battery would work and would top up the battery fast enough while still giving the esp juice to work 24/7

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, mariushm said:

My first thought was to something really basic like this :

 

image.png.5687e34729999ef50812688a71a1ca49.png

 

Basicaly, the door on a hinge at the top and a sliding lock on the side.

You can use a solenoid to pull out or push in (or slide in/out, whatever) the lever to lock the door.

You can add a sensor to detect when door is down all the way for example an infrared emitter (a led) on one side of door, infrared receiver on other side, or on each side of the bottom left corner) ... when door is down, the infrared beam is blocked by the door, when it's opened the receiver sees the infrared beam. If you put the sensor across the door you could also detect when a chicken goes through the door. 

You can have a motor of some sort on top (could add gears to reduce speed and improve weight lifting ability) that spins and wraps the wire on a spool raising the door. When you want to close, just loosen the motor and the weight of the door will keep the wire tensioned

 

Another concept would be using a system similar to the one on cd/dvd trays ... add rails with teeth on each side of door, screw two wheels on the sides of the door and a stepper motor can just lift up the door, or you go the other way and lower the door ... think like guillotine.

that's a bit risky as in you could catch a chicken right as it goes through the door and kill it if the door falls down too quickly, and it's also more annoying because you would have to periodically lubricate the wheels and teeth and make sure there's no crap so that door can slide up and down easily.

 

A simple esp something would be enough, connect it to your wireless network and you more or less can access it from anywhere (port forward the esp's wireless address on your router if you wish)

A motor to lift the door would need 12v, so a basic 7Ah lead acid battery for UPSes, or motorbikes would work if you don't have power or don't wish to have wires to the chicken coop. A solar cell panel and a voltage regulator to boost to ~ 13v to top up the 12v battery would work and would top up the battery fast enough while still giving the esp juice to work 24/7

 

 

I'd use a reed switch instead of infrared dioded to detect, if the door is closed.

Link to comment
Share on other sites

Link to post
Share on other sites

Well, yeah, lots of things can be used. A reed switch can be more expensive and will require a permanent magnet or something on the door.

There's also limit switches which could be used https://www.digikey.com/products/en/switches/snap-action-limit-switches/198

When door closes, it presses on the switch and you know it's closed ... though over time dirt and crap can get inside the switch and then either you clean or replace it.

An infrared led and sensor diode are passive and require no maintenance and don't consume power until you need them to so they have their benefits ... well i guess you would have to make sure the led lens doesn't get dirty or clean it from time to time so that and the need to have wires going to infrared sensor diode is a small drawback.

Link to comment
Share on other sites

Link to post
Share on other sites

you could always go full overkill and set up a camera with ai that will turn on and find all the chickens and when it sees them all inside it will close the door, if not it will notify you that they aren't all inside *big brain* (this is stupid and probably flawed just being stupid btw)

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×