The Automated Chicken Coop will have three primary, initial, objectives:
1. Open and Close the coop door, the door must be open 14 hours a day and any time it is open outside of sunlight must be pre dawn.
2. Turn on the lights when the door opens and turn them off after sunrise
3. Monitor Temperature in the Coop
The Coop Controller has three additional senor inputs and 5 additional outputs that are currently unassigned. Eventually I may add heaters, water heaters and Camera triggers to the outputs. I may also add weight sensors in the nest boxes to detect eggs and/or egg laying.
I will also be adding a new power supply with battery backup and 5 volt power regulator for the Pi. The power supply also has a trigger to notify of mains outages and I will add a script to override the door schedule and open the door if power goes out.
There will of course be a Web app to monitor and control the coop manually but the objective here is to automate everything.
Got my KPS-5-1 power supply installed today! Along with the Buck Converter and Boost Converter.
The KPS-5-1 takes 24v(AC) in and 12v(DC) from a battery and out puts 13.8v DC. The Buck Converter drops 13.8 down to 5v to power the rPi, Driver board and relay board. The Boost Converter raises 13.8v to 30v to power the actuator. The KPS-5-1 has an LED to show AC power status (LED illuminates with AC power off when powered by battery). So.. I swapped the LED with an optocoupler and wired the output to GPIO 25. Next I will write a script that checks GPIO 25 for high every 5 minutes and then install it as a service. If GPIO 25 goes low we know that power failed so the script will shutdown the automation service and open the door, after GPIO 25 goes high again it will check it for 10 minutes and then restart the automation service again.