I've kept chickens for ~7 years as of this writing and employed automation for the majority of those years. Chickens are great fun and one of the easiest animals to farm; the addition of automation eliminates some of the more mundane chores.
I subscribe to a pasturing approach where chickens are given unrestricted access to my surrounding woodlands, meadows, and wetlands - there are a number of benefits to this system of management that I won't dive into here. Aside from fire mitigation, the property remains in a fairly wild and unaltered state and all active management centers around the coop - this is in contrast to other systems where birds are confined to cages, coops, and optionally attached runs in accordance with metrics on minimum cubic feet per bird.
Over the last few months I've been mulling over a new design for my chicken coop automation system. It's been nearly 2 years since the last refresh and few new dynamics are in play for the 4th version:
- The California power grid has become increasingly tenuous - I can no longer assume connectivity will be present let alone power.
- My current project box is ~IP33 and I'm growing tired of the creepy crawly ecosystem thriving in there.
- Desire to expand functionality without rebuilding each time.
- I've built a few ESP32-based development boards at work and looking for a fun personal project to employ.
As I'm not looking to boil the ocean on the first iteration, I settled on a set of basic features which provide a solid foundation for continued development:
- IP65+ enclosure
- IP65+ connectorized cabling
- Modular design
- GPS-based time
- Automated door
- Automated lights
- LAN-based OTA via WiFi
I've been a big fan of the Adafruit Feather pinout for sensor or MCU-based development boards - nearly all boards I've produced lately follow this spec. Interconnect between boards from various vendors, clean stack-up, large ecosystem - an easy choice. The Feather Tripler was selected to spread the load horizontally as opposed to a single column stack-up.
Adafruit DC Motor+Stepper FeatherWing
An H-bridge motor controller makes operating a linear actuator a breeze. Lighting can also be operated from the motor controller by treating it as a single direction motor. Care must be taken when operating as only 1.2A can be driven per terminal block.
Flex ESP32-WROOM Feather
Although an ESP8266 would have sufficed for the current feature set, I've got a few of my ESP32 development boards around which provide headroom for upcoming features. The Flex ESP32 board provides access to all pins along with an SWD header for easy debugging with an ESP-PROG.
U-blox NEO-6M GPS Module
The core functions of the chicken coop are driven by sunrise/sunset which varies throughout the year for a given set of coordinates - GPS provides location data and UTC time from which the sunrise/sunset can be calculated. Although the NEO-6 series is fairly old, I had a module in my parts bin and the capabilities were more than sufficient for my needs. I wrote a quick library for communication with the module via standard NMEA sentences and will open source when I get a chance to cleanup.
Interconnect with the Feather pinout was achieved through a FeatherWing Proto board on which I soldered a female header strip.
2700-3000K LED Rope Lighting
Chickens govern their egg production based on available resources and the "expectation" of resource availability. I say this in quotes as nature has devised an ingenious method for estimating what the future holds for food - day length (in actuality the inverse - length of night). As the sun powers all vegetative growth and therefore the basis of nearly all life, increasing day length corresponds with increasing potential for food availability while decreasing length indicates the onset of winter and decreasing food availability. The pineal gland is primarily responsible for the sensing of light, though the eyes and hypothalamus are also contributors.
There are numerous studies on the benefits of artificial lighting on egg production and behavior. I mulled over the concept that lighting was a step too far and created unnatural conditions to the detriment of the birds, though consider:
- In areas near the equator, day length remains long throughout the year to no ill effect. Chickens are domesticated descendants of Red Junglefowl with an ancestral range in these very areas.
- Chickens molt every 12-18 months and will not lay during this time - nature's mechanism for R&R.
- Short days correspond with lack of food in the wild which isn't the case under my care. Although my birds consume a significant portion of their diets from the woods and wetlands throughout the year, they do have access to a balanced commercial feed whenever they desire.
Optimal "day length" is 16 hours which I dynamical calculate based on sunrise for the given day of the year at the GPS coordinates. For example if sunrise occurs at 6am, artificial lighting commences at sunset and continues till 10pm.
I installed a 2700-3000K LED light strip with 3D printed mounting brackets. Power is controlled via the DC motor controller.
12V Linear Actuator
Linear actuators are an ideal mechanism for door control as they are highly reliable and forced entry is beyond the abilities of any animal that could possibly fit through the chicken door, in my area namely - owl, hawk, fox, coyote, dog, skunk, possum, and bobcat.
The most primitive method of operating a linear actuator is through mechanical relays - tie NCs to ground and flip the NO on either relay to +12VDC to extend or retract. As mentioned previously, I utilized a DC H-bridge controller allowing for solid-state actuation and fine-grained speed control - no relay clicking and provides ample time for birds to get out of the way.
My linear actuator has been in service for nearly 7 years and still functioning well.
I selected an IP67-rated enclosure to provide ample protection from the elements as well as critters. The included grid plate allows for easy mounting off the tripler as well as GPS antenna.
Ultimately I'd like to transition to 100% solar power, though in the interim 12VDC provides a reasonable stepping stone (many solar charge controllers push 12VDC). I repurposed an IP67 12VDC power supply I had in the parts bin. Within the enclosure, a step down converter provides 5VDC via micro USB to the ESP32 and the other wing boards.
As I intend to retrofit in the near future, I've connectorized all external wiring with IP65 rated connectors. I had a few hundred foot roll of 16AWG 2-conductor direct burial wire from a past project which I employed for the 12VDC power run (an acceptable ~10.5VDC at the enclosure) as well as runs to the linear actuator and LED lights.