Welcome to the SmartPICoop Web Site

The SmartPICoop is a fully automated Chicken Coop Controller which uses a RaspberryPI at the core of the solution and is supported by a custom designed 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 keep an ex Royal Australian Airforce (RAAF) electronics technician / software developer from getting bored in the cold Canberra winter nights. If you have ever seen Australian Free To Air TV, you will understand :)

The SmartPICoop provides the following automated features

  • 4 Inch Touch Screen provides access to all settings and status information
  • Solar Powered with charge voltage and current logging
  • Opens and closes a Main Door at a preset light levels using the locations dawn and dust times
  • Opens and closes a secondary 'Yard' Door at present time each day
  • Monitors and fills a water tank (Sand Filter) and Trough
  • Preset power down and on again function to reduce daily power consumption
  • Nightly check is emailed to ensure that all doors have been closed
  • Open Source Relational Database to store configuration and long term monitoring of all sensors
  • Comprehensive Web interface that provides a range of manual controls and charting of sensor data
  • 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 (Coronavirus Upgrade)
  • Fetches the weather forecast for the area from the Australian BOM site to determine if yard door is to be opened
  • Realtime monitoring of the system via a GUI on a 2nd RaspberryPI within the house

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 several years 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

"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 (Spark-Java) 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.

Feeder Chart

"I had better secure that web interface (I will get back to this.. maybe)"

The intent of this enhancement is to add a reasonable layer of security to the simple web interface before someone I work with has a close look at how open it is. Unfotunatley I still haven't finished this upgrade, as StartLink doesn't give me a configurable firewall, so effort was greater than reward

"Im tied of the Chickens pooping on the deck, when its cold or wet upgrade (under development)"

When its wet or cold, instead of wandering around the house paddock, they tend to stay near the house on the wooden deck. So I have 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.

"Why don't I have an realtime view in the house upgrade"

The thinking was to have another RaspberryPI running a full GUI (X Window based) running in the house, when we wanted to check the Chicken Coop status or do some manual control. So I used MQTT as the realtime messaging between the Coop controller and another PI running Ubuntu with X Windows. The Application is Java SWT based and the source can be obtained via the BitBucket.org GIT repo here : https://bitbucket.org/DaveDuncanson/smartpicoopgui. I setup the MQTT Server on a spare Linksys router running OpenWRT with the mosquitto-client-ssl installed.

"Its a cold and wet Canberra Winter, so I can stay near the wood fire" upgrade

Its been a while and a cold and wet winter, so I have started on a major update to the software stack and including a number of enhancements, including intergrating with GPSD and expanding the web interface, so in future I may just run a headless version (ie No Touch Screen), but Im also having a play with a ESP 7" touch screen that I may moved to instead of the existing model.