Sunday, June 22, 2014

IoT coop now in live

In the past chickens only clucked, nowadays they also do twitter.

If a chicken is interrupted during egg laying process, they get upset and make neighbour irritating noise for quite some time. That's the initial problem; how to know when it is safe to go and collect eggs? And of course the problem shall be solved at most technical and complex way.


Instrumentation for nest occupancy detection wasn't as easy as I initially expected. Here is the story.

I had some spare ultrasonic distance sensors, so decided to go with that one. But ultrasonic pings do not echo from the coat of hens. Obviously plumes do absorb or diffract the sonic wave in a way that no echo is detected by the tranceiver. In addition to not being able to detect presence of chickens, there was another problem with the ultrasonic. Operation of the sensor made hens nervous. Either they do hear the 40 kHz sound, or some other way do recognize it.

Ultrasonic sensor.
Next I decided to go with infrared gate sensor. I had some IR receivers model TSOP1740. The angle of the transmitting IR LED was limited with a shader, as well as on the receiver side. However, the gate sensor didn't recognizes the chicken passing the gate , even if it was sitting right in the middle of line of sight between transmitter and receiver. Obviously plumes do reflect the IR light in a way that it reflects from the walls of the nest box end eventually reaches the sensor.

Infrared sensor.

The TSOP-family of IR-receivers is designed to ensure signal reception even in poor conditions. With internal gain control and noise canceller, it is proven to perform well in remote control applications. One can experiment that at home by pointing TV remote controller towards the back wall and being able to control the telly that way.

Finally I decided to go with laser. Problems with absorption, diffraction, and reflection are now eliminated. Only a fully transparent chicken which does bend the laser light at all would not be detected. If such a chicken is made of any known solid transparent material like glass or plastic, it would most probably bend the beam and interrupt the signal.

Laser sensor
Once again the sensor is build from spare parts readily available in the self. Semiconductor laser transmitter is a no-name component from DealExtreme. As it has red color, infrared photo detectors I have do not work with it. Thus the only option available was a plain old photoresistor. LDRs have slow response to illumation changes, but according to my measurements over 90% of the resistance change occurs within 10 milliseconds. Blinking the laser with 10% duty-cycle with 100ms interval gives good tradeoff between detection accuracy and power consumption. 

Finding a proper sensor to detect chicken in a nest was the most complex part of solving the given problem. Rest of the technology is explained in previous postings. You can now follow the chickens in Twitter @iotcoop.

 Edit June 23th:
According to live data, hens do many short visits to nests in between laying an egg. When laying an egg, the visit takes half an hour or so. Now the algorithm has been changed in a way that visit to nest is only reported if it took more than 5 minutes. Then there most probably exists a new egg.

Edit Oct. 2nd:
Due to winter season, the IotCoop will be inactive untill Spring 2015.

No comments:

Post a Comment