Skip to main content

Automatic Chicken Coop V4

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.

Key Features

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:
  1. IP65+ enclosure
  2. IP65+ connectorized cabling
  3. Modular design
  4. GPS-based time
  5. Automated door
  6. Automated lights
  7. 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:
  1. 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.
  2. Chickens molt every 12-18 months and will not lay during this time - nature's mechanism for R&R.
  3. 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.

Project Box

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.


Popular posts from this blog

Samsung Odyssey G9 49" - Firmware Upgrade and Other Notes

I picked up the Samsung Odyssey G9 49" some months ago during the (nearly too good to be true) GameStop PowerUp promo. With a curvature of 1000R it matches the human eye's FOV at 1 meter and provides a great experience for games which support the 32:9 aspect ratio.  Although Samsung primarily targets gamers for the marketing of the display, productivity apps are excellent as well; 49" + Windows 11's enhanced support for window docking has allowed me to do away with a dual-display setup. There are a few oddities which may help others: Adaptive-Sync cannot be "On" with Screen Size "Auto" If your game does not support an ultra wide 32:9 aspect ratio, you cannot use AMD's FreeSync or NVIDIA's G-SYNC. The "Auto" setting for Screen Size provides vertical black bars on the left/right to provide proper display of non-ultra wide content; when this setting is disabled due to Adaptive-Sync your game will become horribly stretched across 49&q

nVidia RTX 3090 Founder's Edition - Thermal Pad Modification

nVidia's RTX 3090 is a beast of a GPU featuring the latest Ampere architecture with 10,496 CUDA cores and 24GB GDDR6X. Like many products these days it's suffering from limited availability, but I finally managed to acquire one. The 3090 replaces my aging GTX 1070 Ti FTW2 as the primary gamer and boosts my daggerhashimoto rate for Ethereum mining. Unfortunately the 3090 cooling system is not well suited for mining workloads and upon firing up NiceHash, the VRAM temperature quickly reached 110C and began throttling due to excessive heat. Searching the web I found a solution - replacement of the stock thermal pads with higher efficiency aftermarket pads . There are two paths - replacement of all thermals pads front and back or replacement of just the back. I elected to do a full replacement (as it's not terribly difficult to continue once the card is torn apart) and followed  CryptoAtHome's YouTube guide . -WARNING- This process may void the warranty of your GPU and carri

Building Custom Beeswax Molds with 3D Printed PETG and Silicone Resin

Through my beekeeping operation I accumulate dozens of spent frames from which I salvage beeswax. Until recently I created candles as a means of storage for refined wax, though it reached a point where candle creation exceeded consumption. I decided to cast the refined wax into blocks for long term storage and began the process of creating molds. I pursued a number of concepts before settling on one which fit my needs; this post is will hopefully save others a fair amount of time as little information is available on the web for fabricating custom beeswax molds. Guidelines for the project: Use materials on-hand: 3D Printed PLA or PETG Silicone Resin Must be capable of reliably imprinting fine detail; minor defects are acceptable so long as it fits within the definition of "rustic" Technique must be adaptable across a range of sizes: 1/4 Lb to 5 Lbs Preheating of molds prior to casting not required Mold release agent (silicon spray) not required PETG Mo