Every morning I walk outside to let my chickens out of their coop. Every night, I need to lock them back in to keep them safe from predators. Is there something I can rig up to automate this?
I ended up using a power antenna from an old Volvo in the scrap yard. When it extends, the door opens, and when it retracts, the door closes. The antenna is powered by a 12V AC adapter, while the trigger wire is connected to a relay. The relay closes when power is sent to it from a WiFi smart plug, which means I can set schedules based on time and/or weather, and can even control it from my phone!
Since you do not worry that the chickens will be outside when you choose to have the door closed, as they are most likely inside already I have one suggestion to you: An automatic trap door.
If you make a sliding door which can be hoisted upwards, then you can have an active lifting mechanism to lift it in the morning, and release it down again in the evening (or automatically drop if power fails). This will also spare you the trouble of making sure it is properly shut, as gravity will keep it shut, and you can lift it a suitable amount using some electric motor.
Such devices can surely be bought, but should not be to hard to build if you are somewhat handy yourself. Depending on needs and wants, you can choose whether to make it fully automatic or if you want to have some remote control for it. Both are feasible, although not easily described within a post like this.
One option springing to mind is to have a timer giving power to a lifting circuit which would spin an engine lifting the door until it touches a circuit breaker when lifted high enough, but not releasing the tension on the spinning device until power is shut off (by the automatic timer).
Have a cat flap type arrangement and add a small latch that is released with a small 5V solenoid. Fit a over large 24V solar panel (with LDO voltage regulator) to release the solenoid catch at dawn (orient the panel wisely towards winter dawn) even if overcast.
After the first hen is through the door you can have it stay open until roosting time when you swing it closed, as the sun sets the latch will lock at which point the hens are secure. Make the door open outward to deter visitors if roosting is before sunset and you have closed up but lock is still open. Solar panel should be pointing away from sunset side so unless you have bright overcast the panel should be receiving little evening light.
As a added benefit your night time security visit may allow you to unlock door to peek inside by illuminating solar panel with your torch.
Build a door similar to this on the picture below;
It is similar to the small doors for pets found on exterior house doors. I am not sure if the chickens will push the door with their heads to enter inside or go out. If this is the case, then you can put a sensor and a second stepper motor to open and close the door. Don't forget to wire the sensor also to the timer.
I bought one of this timers to use with my boiler. They are around 15-20$ on aliexpress. For the stepper motors, look inside of the old CD/DVD ROMs or Scanner / Printers. I don't think they are expensive. I think you can find sensors online. They must be cheap on sites like ebay or aliexpress.
Note: You may ask how to limit the rotation to 180*. Well, it may be done by setting the speed of the motor. The timer is not second-sensitive. The minimum time range between the On and Off is 1 minute. So the door should complete the 180* rotation in one minute. I know it is not easy to do without using electronics.
You can use some kind of controller to automate this task. For example Arduino. But you need some programming experience to do this.
You will need an electric motor which will move the door in both directions (open/close). And some sensors (like Hall effect sensor) which will detect if the door is closed or opened.
The door can be controlled with a timer or a sensor (photo resistor/transistors) which detects if it is day or night (depending on the light).