I mentioned my chicken coop controller in the recent discussion about active-low relay modules. Here's a picture of it:
(click on it to see it on PhotoBucket where you can zoom in.)
A little bit below and to the right of center you can see the ULN2803A Darlington transistor array that I used to more easily control active-low relay modules. It also controls the power to the voltage regulator (top side of the box) that powers a small wifi router (Edimax BR-6258n). One of the relay modules is high on the left side of the box. That one controls the motor for opening/closing the door. The voltage regulator for the WC is below the relay module.
The door slides up to open / down to close. At the top and bottom are limit switches, through which the signals to the relays are wired. When the door reaches the top, the signal to the "open-door" relay is cut off. In addition, the switches are monitored so if the door takes unusually long to open or close the relay is turned off and an email is sent, resulting in an alert on my cell phone.
The door open and close times are determined based on sunrise/sunset times because that's how chickens operate. The sun times are calculated by the server in my basement and fetched via WEBSET. I couldn't figure out how to calculate them on the WC because the equations involve arcsin and arccos. I tweaked some code I found online to get the times in a format that I could use.
The door operation is the most useful function. I've had it working well for about a month. Chickens like to go outside when it's light, regardless of time or temperature, and it's nice to not have to worry about that or closing them up safely at night.
The hardware for other functions isn't installed in the coop yet, but I have PLC code written for food and water level sensors, as well as water temperature sensor and heater (a light bulb in a cookie tin under the water bucket). I plan to put a temperature sensor in the bottom of each nest box also (the 1-wire line to the water bucket goes through all of them anyway, so why not?). When the WC sees the temp go up it will conclude that a chicken is sitting in the nest box. When the temp goes back down it will assume there's an egg and increment a counter. A switch on the nest box lid will reset the counter, and an email will go out if eggs are in danger of freezing, or if there are still eggs waiting when the door closes for the night. We'll see how well that actually works. I don't know whether the chickens sometimes go in there just to have some "alone" time and not lay an egg.
It's been a fun project. My kids think the automatic door is pretty cool, especially the older one who used to have the job of letting the chickens out in the morning.
-Ben

(click on it to see it on PhotoBucket where you can zoom in.)
A little bit below and to the right of center you can see the ULN2803A Darlington transistor array that I used to more easily control active-low relay modules. It also controls the power to the voltage regulator (top side of the box) that powers a small wifi router (Edimax BR-6258n). One of the relay modules is high on the left side of the box. That one controls the motor for opening/closing the door. The voltage regulator for the WC is below the relay module.
The door slides up to open / down to close. At the top and bottom are limit switches, through which the signals to the relays are wired. When the door reaches the top, the signal to the "open-door" relay is cut off. In addition, the switches are monitored so if the door takes unusually long to open or close the relay is turned off and an email is sent, resulting in an alert on my cell phone.
The door open and close times are determined based on sunrise/sunset times because that's how chickens operate. The sun times are calculated by the server in my basement and fetched via WEBSET. I couldn't figure out how to calculate them on the WC because the equations involve arcsin and arccos. I tweaked some code I found online to get the times in a format that I could use.
The door operation is the most useful function. I've had it working well for about a month. Chickens like to go outside when it's light, regardless of time or temperature, and it's nice to not have to worry about that or closing them up safely at night.
The hardware for other functions isn't installed in the coop yet, but I have PLC code written for food and water level sensors, as well as water temperature sensor and heater (a light bulb in a cookie tin under the water bucket). I plan to put a temperature sensor in the bottom of each nest box also (the 1-wire line to the water bucket goes through all of them anyway, so why not?). When the WC sees the temp go up it will conclude that a chicken is sitting in the nest box. When the temp goes back down it will assume there's an egg and increment a counter. A switch on the nest box lid will reset the counter, and an email will go out if eggs are in danger of freezing, or if there are still eggs waiting when the door closes for the night. We'll see how well that actually works. I don't know whether the chickens sometimes go in there just to have some "alone" time and not lay an egg.
It's been a fun project. My kids think the automatic door is pretty cool, especially the older one who used to have the job of letting the chickens out in the morning.
-Ben