Welcome to the SmartCoop.tech Web Site

The SmartCoop is a fully automated Chicken Coop Controller solution which uses a RaspberryPI and a ESP32-S3 Processor located on a custom designed Surface Mount Designed (SMD) PCB.

The goal of this project was to significantly reduce the amount of regular and routine tasks required to keep a small flock (~30) of chickens on a hobby farm located in NSW just outside of Canberra Australia. A secondary goal was to provide an ex Royal Australian Airforce (RAAF) electronics technician and embedded software developer with an excuse to use skills acquired early in his career on something challenging in his spare time.

The 4th generation of this solution is based on over ten years in development with a lot of trail and error along the way. Just one example was the need to run all of the wiring harness within Conduit otherwise the local cockatoos will eat the wiring.

It is worth highlighting that I have no plans to turn this into some type of commercial product, as I already have demanding day job within the Australian Defence Industry and the whole point of this solution was that I really enjoy designing embedded PCBs and writing embedded code (Java & C++).

If you are interested in building this solution for yourself, please feel free to let me know and I may be able to provide you one of my spare populated populated PCBs at my cost and assist when and if I can.

I am the first to admit that this solution is most likely an over engineered and therefore not cost effective, for the typical small suburban chicken coop or flock, so if your just after a simple automated door opener there are now several in the market, that may be far more suitable for your needs. This solution is aimed at full automation of the chicken coop, including multiple doors, water management, feed monitoring, system logging (MQTT) and an advanced web based user interface.

Both the software and hardware are provided as Open Source, so please feet free to download the design and arrange your own manufacture, noting the Open Source licence requirements .

The source code and PCB hardware design files and a high level more technical overview can be found at the following GIT repository : https://bitbucket.org/DaveDuncanson/smartcoop.tech/src/master/README.md

The 4th Generation of the SmartCoop provides the following key features

  • Fully Automated Main Door, utilising a light sensor to trigger the open and close with dawn and dusk setting for each day at your location via a GPS.
  • Fully automated Yard Door, that utilises a weather forecast from the Australia BOM to decide if the yard door should be opened each day
  • Comprehensive Web interface that provides a range of manual controls, configuration settings and charting of sensor data
  • Manual push buttons on the PCB to open or close either of the doors, fill the water tank or power up the RaspberryPI
  • Monitors and automated fill of a water tank
  • Preset configurable power down and on again function for the RaspberryPI to reduce overnight battery power consumption
  • Nightly check is send via email to ensure that everything is closed for the overnight power down
  • Open Source Relational Database to store configuration and long term monitoring of all sensor information
  • GPS interface that provides an accurate Time Source for updating the RTC and when our Internet is down, plus LAT & LONG coordinates used for Dusk & Dawn settings
  • Realtime monitoring of remaining chicken food across two separate feeders
  • Fetches the weather forecast for the location from the Australian BOM site to determine if yard door is to be opened for the day
  • Realtime monitoring of the chicken coop system via a MQTT broker
  • (Under Development) UHF RFID Chicken Tag Reader to automatically close the main door when all of the chickens have entered the Coop
  • (Under Development) RFID Chicken Tag Reader to record which chickens are laying the eggs in each laying box, each day (may be useful for small breeders)

If you would like to know more, my email address is
Dave with a dot Duncanson at gmail with another dot com

The project has been developed over a decade with numerous improvements and enhancements addressing specific issues or design flaws where were exposed along the way. The majority of software and hardware development will version control using numbers or release names, I have decided to use the issue that drove the enhancement instead, below are a few of the key ones

"RFID Tags could improve the protection against foxes and other interesting features"

Even with the automated door closures, there have been times where we get a local storm come through in the afternoon, which causes the chickens to go into the coop, but the main door remains open until the configured closure time, which has presented the local smart foxes an opportunity. So my thinking is that if all of the chickens had UHF RFID Tags that are reasonably cheap now (via AliExpress), the system would know when all of the Chickens have entered the coop in the afternoon and then trigger a door close. Another potential feature could be knowing which chickens are laying the eggs, when and where. No I'm not planning to introduce SLAs/KPIs for chicken egg layering, especially given we have heritage breeds :)

So the latest generation (GEN4.3) of the custom PCB now has an RS232 interface that can be used to access a relatively cheap UHF 4 x Antenna RFID Reader via the ESP32-S3. The initial querying of the RFID Tags is now working and Im currently working on the integration with the Raspberry PI application and the H2 Database.

"Lets have a play with these ESP32-S3 modules and some C++ upgrade"

Prior to GEN4 of the PCB, there was a very basic secondary micro-processor (PICAXE-14M2) on the custom PCB that just ran some simple basic code to perform the overnight power down and on again function for the Raspberry PI. With the move to a SMD PCB, I decided to replace this device with something that was cost effective, low power requirements but high speed for interrupt handling, plenty of open source libraries available and didn't require an investment in complex a IDE. The ESP32-S3 module from a fellow Australian (Unexpected Maker) was an ideal fit and just as important, I really enjoyed doing some embedded realime C++ again. BTW I'm not saying that there weren't days when I would of given anything to have a JDK/JRE for the ESP32 :)

"Its time to learn how to do Surface Mount PCBs upgrade"

All of the prior custom PCBs used Through Hole components, which required a larger and therefore more expensive PCB and the cost and availability of Through Hole components, when compared to Surface Mount Devices was significant. On top of this, I never really enjoyed soldiering in all of the components, so when I realised that I could get 5 x PCBs, with two of these PCBS being fully populated by PCBWay, for less than the cost of the prior bare PCBs, I decided that the latest (GEN4.x) of the PCB would use SMD components, except a couple of connectors. This also allowed the design to require less power and everything on the PCB could be powered via a USB-C connector.

"Dam those foxes are smart" upgrade

The reason for this enhancement was that for just under a week, our guinea fowl were going to "alarm" at the same time each morning, to alert us to a fox. It became obvious that the fox had determined that the main door to the Chicken Coop was opening at the same time every day. It had decided to position itself, just outside the coop, a few minutes before the door would be automatically opened each day.

The only solution I could see, was to add a random component to the main door opening time, plus I could also remove the need to change the opening times to handle daylight saving. As a result, the software now uses a web site hosted to pre-populate the database with all of the dawn and dusk times for the specific location. At each dawn time, the software will commence monitoring the light sensor until it reaches a preset value, before opening the door. There is also a configurable timeout (i.e 60min), when the door is opened anyway. The combination of changing dawn time, plus the variations in light levels and the one hour timeout, seems to of resolved the regular appearance of our clever fox.

"The teenager just can't remember to close the front door" upgrade

Anyone that has a teenager(s)) will understand this, so I added a sensor to the front door to the Coop and a final nightly check feature into the application, which provides a final check, that all of the doors have been closed, water tank and tough are full and emails the result to a configurable number of email addresses. I have since extended this feature, so that it can be triggered via the web interface as well. Typically I use this when the family is camping and won't be in mobile range when the regular nightly check is performed

"I really don't want to upgrade the battery and solar panel" upgrade

Obviously during the Canberra winters the light duration and level is significantly less and therefore with the RaspberryPI and LCD running 24x7, it only took a number of cloudy days and the battery charge would get too too low to power the system. So instead of upgrading the Solar Panel and deep cycle Battery (each would need $$$), I decided to incorporate a PIXACE micro to the supporting board that leverages the Real Time Clock (RTC) to power on and off at a configurable sequence. My thinking was that the Raspberry and LCD were doing nothing over night, so why not just power down the system when the chickens were asleep. I had also started to think about a mobile variant of the solution for Chicken Trackers, which would power down during the day, instead of at night when they would slowly move to the next GPS coordinate. This feature allows the controller to be powered down over night, which has removed the flat battery issues I had been experiencing

"I really don't want to clean or fill the water trough ever again" upgrade

Prior to this upgrade, the water supply for the chickens, was supplied from a Dam, which meant that the quality of the water would vary significantly, depending upon season and water levels. This would result in the water trough having to be regularly emptied and cleaned. To resolve this situation, I built a water tank from storm water PVC pipe, which included a sand filter. This water tank then supplied clean water to a smaller tank made of 90mm PVC pipe, which supplied water to the chickens via the small auto cups that commercial operators use.

"The I want to be able to control and monitor status from anywhere" upgrade

The Genesis for this upgrade, was that one weekend, while the family was away, the system detected a gate timeout issue and sent an email, detailing the issue and that the main gate may not of been closed. Please note, this was an occasional issue before I started using the inductive gate sensors. Up until this point, you needed local access to the touch screen display, to diagnose and resolve any issues. To resolve this, I incorporated a RestFull Java Web Server (Javalin) into the main application, which provides a simple web interface which provides remote control of all of the key functions (ie Open Main Gate, Close Main Gate, etc) and provides a range of status and sensor readings via Google Charts. The various email messages that are sent each day, include the external IP Address of the gateway router to the Internet, so that the Web interface is available from any device with an Internet connection. I'm planning to extend this in the near future to provide raw diagnostic and configuration capability.

"The I need a better way to monitor that feeder"" upgrade

The intent of this enhancement is to allow my wife and I to take short holidays without requiring a pet minder to regularly visit the property. As a result the latest release of the PCB board, provides support for a NAU7802 based weight/load sensors for an automated chicken food dispenser. The food dispensers will contain at least a couple of weeks supply of chicken food.

"I'm tied of the Chickens pooping on the deck, when its cold or wet"

When its wet or cold, instead of wandering around the house paddock, they tend to stay near the house on the wooden deck. So implemented a regular fetch of the weather forecast XML File from the Australian BOM and if rain is forecasted above a limit that is configurable in the H2 database, the system will keep the secondary door (yard) closed for a day, so I don't need to pressure wash the deck every week.