Motivation 

A friend's father recently made a hatchery and put quail eggs in it. Then, I decided to capture the data from the hatchery and display them in a real time somewhere, where he could see them, even when he is not at home, which was also one of the project's goals.

Hardware 

In the project presented, Raspberry Pi, tiny and affordable computer is used. Also, Raspberry Pi Camera Module for live streaming on YouTube and sensor which measures actual temperature and humidity. The sensor must be connected to the RPi via cables, because it is neccessary to have sensor somewhere inside the hatchery in order to obtain more precise data.

Components used:

  • Raspberry Pi 4 Model B,
  • 5 megapixel Waveshare Raspberry Pi Camera Module,
  • Sensor BME280,
  • wiring.
 Raspberry Pi with Connected Components
Figure 1 - Raspberry Pi with Connected Components

Software 

In RPi is running python script, which serves as mediator between sensor and ThingsBoard. MQTT messaging protocol is used to send data from sensor BME280 to IoT platform Thingsboard via Rasberry Pi. Data are sent every 5 seconds. RPi camera  is used to monitorize eggs and it is possible to broadcast a live stream on Youtube from it, for as long as we need. 

Thingsboard is used,  because it is an open-source IoT platform for data collection, processing, visualization, and device management. There can be collected and stored telemetry data in scalable and fault-tolerant way and visualized data with built-in or custom widgets in flexible dashboards. Finally, dashboards can be shared with everyone.

Scheme of Data Processing and Communication
Figure 2 - Scheme of Data Processing and Communication

Results 

In Figure 3. we can see the dashboard, which was created in Thingsboard.  Widgets can be seen, which shows actual temperature and humidity. Also, timeseries line charts showing history of measured temperature and humidity, widget where is video from YouTube inserted, and HTML widget with short description about th project and hatching countdown. These widgets are updated according to sensor data received to Thingsbord from Raspeberry Pi (Figure 4).

Thingboard Dashbord with Received DataFigure
Figure 3 - Thingboard Dashbord with Received DataFigure
Latest Telemetry in Thingsboard Console
Figure 4 - Latest Telemetry in Thingsboard Console

In Figure 5 is screenshot from Youtube live stream. Video backup cannot be included, because Youtube allows only to save 8 hours of stream, but stream was running for few days. Seeing if something is happening in hatchery in last hatching day is very important for all breeders.

Video Stream Screenshot
Figure 5 - Video Stream Screenshot

Results 

Based on dataset the Graph 1 was plotted. In Graph 1 it is shown temperatureand humidity from last three days of hatching (from 21.4.2021 9:00:00 to 23.4.2021 11:00:00). Graph is divided into three parts:

  • Two days before hatching - from start of the graph (21.4.2021 9:00:00) to first yellow vertical line (22.4.2021 approximately 12:30:00)
    • Temperature has remained reasonably stable - in  36-37°C range. This was caused by heating and cooling in hatchery. 
    • Humidity - What is interesting there is slowly raising  humidity within the 55% to 65% range. It is caused by manual water inserting to hatchery, which is neccessary for better hatching of eggs in last few days.  As can be seen humidity felt 6 times down rapidly, which was caused by hatchery opening.
  • Hatching - between two vertical yellow lines (22.4.2021 approximately 12:30:00 - 23.4.2021 11:00:00)
    • Temperature - At this part, can be noticed that temperature fluctuate between 36 °C and 39 °C. It is clearly because of hatching. In hatchery was 230 quail eggs and when started hatching and running around the hatchery, temperature was affected. Two important points on Graph 1 are before end of hatching (two red circles). Temperture and huminidity dropped rapidly and it is caused by opened hatchery, beceause it was neccessary to move quails from it.
    • Humidity - Humididty...
Read more »