News and Happenings from the Japanese Linux Pioneer

Tuesday, October 21, 2008

Final Results: Chicken Sitter

Gordon Smith of Lakewood, CO, talks about protecting his chickens from raccoons:

The Story

As a practitioner of the software arts, my lack of electronics knowledge has always bothered me. I've browsed a few books and tinkered a bit, but aside from that could I find a useful project to bring on some learning fun?

I pondered that question one night while gazing at the moon. It was bright enough to see raccoons high in a tree next door, which sent me briefly into a panic trying to remember if I had shut the door on the chicken coop. Four small spring chickens have little to protect them at night - aside from someone or something remembering to close the coop door. Perhaps something could remember better than someone to close the door? Would a silicon "Chicken Sitter" be a feasible project?

Feasible or not, a chicken sitter would need a brain. At least enough of one to observe and count the chickens as they come into the coop in the evening, and then close the door.

The Brain


While cruising the intertubes in search of a small computer to use in the project, the Plat'Home OpenMicroServer made an appearance. In a tidy little box, it had USB and serial ports, and a few digital I/O (DIO) ports. More importantly, there was no fan or disk drive to get choked up with dust. And to top it all off, the Plat'Home "Will Linux Work?" contest was looking to give one away to a lucky contestant with the most appealing idea of how to test the server's mettle in a mildly abusive but productive situation.

Luckily for the Chicken Sitter project, Plat'Home generously provided a server to four different projects and the Chicken Sitter was just popular enough to win the fourth server.



As seen above, the server is little larger than two CD cases. It is a MIPS based unit that comes preinstalled with a specialized Linux distribution (SSD/Linux) that is a breeze to configure and update. SSD/Linux is also easily installed on a separate i386 machine to provide a cross compilation environment.

The Plan


The plan is to use an inexpensive webcam with IR capability to see in the dark, along with a computer vision library to count the chickens. To determine when dusk occurs, the server will run SNTP (simple network time protocol) and query another server to determine when sundown occurs each day. A document scanner has been sacrificed to provide a stepper motor controller and power supply to open and close the coop door.


The software required includes the Linux drivers for the webcam and the network adapter, the SNTP client, the OpenCV computer vision library and an application to tie everything together.

Current Progress

The webcam with IR has been installed and used successfully on a centOS Linux system.

A colleague is "assisting with" (i.e. doing) the stepper motor electronics. The motor has been manually run using a quadrature encoding circuit. The OMS can interface to the quadrature circuit to drive the motor or produce the quadrature encoding itself to drive the motor controller directly.

The drivers and software await a working cross compile environment. Issues are being worked, so far due primarily to operator error. There is a decent amount of documentation on SSD/Linux on the Plat'Home web site to help with this.

Conclusion Before the Fact

The Plat'Home OpenMicroServer is an ideal fit to accomplish the Chicken Sitter task. It fits unobtrusively and quietly in a corner of the chicken coop and has the hardware and software capability to accomplish the required tasks. The chickens will be very fortunate to have such a capable attendant.

1 comment:

Sergio Becerril said...

Hi. Awesome project of yours; I'm glad it's (so far) working out. I hope the chicks appreciate it ;)

However I must ask... wouldn't this have been solved better by a simple PIC? A couple of heat sensors and photodiodes, and a power module for the stepper...

I dunno. Again, glad it's working out, but I wonder if it's a little bit of overkill.