The goal of this project was to automate the chicken coop door. To avoid predators the door needed to be closed at night and then opened the following morning. We couldn't always be home to do this, and the task was perfect to try out some new hardware. I also added some switches to control other items such as a heat lamp for those below freezing winter nights.
This project morphed a lot during the build. Initially everything was bare-metal programming using an ATMega328pb Microcontroller, discrete RTC, and an ESP8266 for WLAN connetivity.
The drive for the door was a simple DC motor with an EasyDriver board.
The mechanical portion of the project involved opening and closing of the chicken door. The implementation I chose was interesting to me since I had very little experience in this area. I designed a simple 1/4" plywood door which would raise and lower vertically to uncover and cover a door hole. The plywood was raised by a DC motorm and lowered by gravity. An interesting problem was how to keep the door up (open) without keeping power to the DC motor. If power was removed from the motor, the motor would slip due to the weight of the plywood doro. I wanted to make the system as efficient as possible which meant I would need to find a way to keep the door raised without keeping power on the motor. The ultimate solution I went with was a counter-weight system. When the door was raised, a weight would lower to keep the door up. When the door was lowered, the weight would raise, but the weight was chosen such that the door weight would balance the system and keep the door down.
Eventually I ended up with everything running on a Raspberri Pi Model Zero W. The Pi Zero has everything needed built into a very inexpensive ($10) and compact solution. The ESP8266 alone was ~$6, so this was a no brainer. Additionally, knowing that I would likely use the Pi Zero W on other projects, it seemed wise to just dive into it now.
The Pi Zero W replaced the ESP8266 and ATMega328pb. The Pi served a website with a GUI and database which held the relevant program variables. The mechanics stayed the same.