Development of a Low-Cost Wireless Bee-Hive Temperature and Sound Monitoring System

ABSTRACT


INTRODUCTION
Honey bees are indispensable in the biological circle and represent a major pollinator of crops for mankind [1] [2], and they are often referred to as healthy pollination agents [3]. The pollination industry is well over $180 billion in a year's market [4], and over 70% of the world's fruits, vegetables or seeds are manufactured on the basis of animal pollination. Interestingly, this accounts for about 30% of world food production [5]. However, the population of honey bee could suffer from certain drawbacks such as colony collapse disorder (CCD) triggered by a wide variety of factors, leading to poor yield [6]. A possible cause of CCD is the use of harmful insecticides, poisonous pesticides, and other toxic chemicals in agriculture, resulting in severe environmental pollution, and consequently, leading to rapid degradation of the ozone layer.
In the existing literature, scientists have shown how various abiotic and biotic CCD factors interact with the natural environment, such as parasites and pests contact with viruses [7] [8]. To this end, it is imperative for beekeepers to safeguard their colony from internal and external interference. In addition, the natural swarming process should be well managed using cost-efficient and sustainable approaches. Most often, the swarm with her band of working bees, leave the old queen for a colony in a new location, usually of a considerable distance from the original space where the majority of the settlement is, to be with a new queen, and this is often seen as a normal cycle [9]. However, it should be noted that a poorly managed swarming process could negatively affect the efficiency of beekeeping practice and the end products, since the hive's colony is built hundreds of meters away from the parent house. Therefore, the application of a suitable, remote, and a precise monitoring system presents a viable tool in precision beekeeping in terms of temperature and sound intensity measurements.
Colony data collection by beekeepers and research centers provide basic information on the understanding of CCD mechanisms [10]. The knowledge of all CCD mechanisms is indispensable to the defense of pollination insects, food production, and bees' survival [11]. Colony supervision requires costeffective, durable, and easy to place equipment. These data come from various backgrounds, including punctual and consistent observations, complex image analysis, videos processing, and sound characterization. In the past, the monitoring of the activity of honey bees was done manually and the behavior and movement pattern of the bees could not be meaningfully captured [12] [13]. In recent years, researchers have efficiently utilized the wealth of information technology [14] to develop systems that are capable of monitoring the behavior of bees in order to resolve this prevailing beekeeping problem. Toward this end, the deployment of sensors become increasingly ubiquitous in precision agriculture, and several beekeepers have used wireless sensor network (WSN) technology [15] to monitor, detect, and count the random movement of bees, especially in and around the vicinity of the hive. Recently, the Internet of Things (IoT) [16] offers health diagnostics and near precision monitoring of the honey bee camps. Thus, data could be gathered and sent automatically at a predetermined time to a desired gateway for data harvesting and further processing [17].
In this paper, wireless sensors were deployed and selected network parameters were configured, and a TCP database was built on an ESP8266 platform. Arduino IDE was used to program the microcontroller, and the ESP8266 Wi-Fi module was programmed using AT codes, and hosted on the virtual web-server over the internet. Candidate information on the state of the bees in the hive was extracted from the sensors, and these were transmitted to the cloud for storage. To this end, a suitable design for monitoring the environmental conditions of the beehive in real-time was evolved. The temperature information, and sound characteristics are monitored and recorded, and these information offer valuable insights on how best to monitor the bee colonies at the least cost. Therefore, beekeepers could leverage on the design to harvest real-time data about what is happening in the bee-hive at any given time, especially from remote locations.
The remaining part of this paper is organized as follows. Section 2 reports the related work and theoretical background. Section 3 presents the materials and design methodology. Section 4 presents the results and useful discussions. Finally, the conclusion and future perspectives are given in Section 5.

RELATED WORK
Several approaches have been developed and used to maximize technologies that aid data collection for scientific investigations, especially on the health and activities of honey bees and the bee hive. Earlier practices often relied on manual means, which is extremely tedious or the use of error prone analog equipment to gather information. For example, For example, Gates [18] reported manually acquired data accounting for a beehive's temperature for every hour in specified days. In the same vein, Seeley et al [19] examined the methods used by bees for decision-making through tag paintings on the bees and adopted a manual approach in counting the bees as they arrive at their feeder's location. In another related study by Dunham [20], the temperature in a beehive was measured with the use of thermocouples.
In recent years, the study of bees' action and the fitness of the hive has been advanced by the application of computer technology through electronic data acquisition. The development of sensors for electronic dataacquisition systems has improved measurement processes from the traditional system to the recent data analytics systems [21] [22]. For instance, an Apidictor was one of the first electronic bee control systems comprising of a low-pass filter for the detection of frequencies, and its sound could change within the hive, perhaps some days prior to swarming [23]. However, Frisch [24] reported the original sounds made by bees in 1967, and observed that the sound is an essential part of bees' communication mechanism often referred to as the "waggle dance", and Neih [25], utilized a probe and a speaker as an emulation of the stop signal of Von Frisch's waggle dance.
Also, Okada et al [26] reported that the vibrations of the bee's wings often orchestrated the waggle dance sound, although the meaning of the dance is not well established due to the fact that the sound is only clear within a fraction of the hive. From the foregoing, it is quite reasonable to state that most findings on honey bees' sounds focused on trying to predict a hive's swarming behavior. In the case of Mezquida et al [27], an audio recording system which stores periodic record from a hive to eventually predicting swarming activities was developed. The recordings, however, the recordings took a few seconds, and the bits were really low.
In a related study, Ferrari et al [28] presented sound recorded via a data logger using a computer sound card for temperature and humidity measurements. The recording used 3-omnidirectional microphones as a 16bit audio recording at 2 kHz rate. However, this system was deployed for the recording of arrays of swarming events for scientific investigations, and not really suitable for long-term field usage. In a similar report, Bencsik et al [29] made a slightly different variation to the results presented by Ferrari et al [28]. The authors embedded accelerometers into the hive frame as opposed to bee hive audio sound recording during the swarming process, coupled with its emitted vibrations.
For accuracy on the population of bees moving in and out of the hives, a more sophisticated bee monitoring system specifically targeted at counting the bees with the use of an infrared sensor [30] was reported by Struye et al [31]. The system used 32 passages that are large enough to pass through a single bee, with different infrared beams (two of them) to detect motion in the path. Hence, the possible direction of the bee motion could be deciphered through the order in which the beams are interrupted, and this is an indication of outgoing or incoming movements of the bees in the hive. For validation purposes, microprocessors were used to check the infrared beam status for about two-hundred (200) for each second, enabling maximum accuracy in counting, which is recorded continuously on a disk for storage.
On the feeding pattern of the bees in the hive, Zacepins and Stalidzans [32] monitored bees feeding via measurements of the beehive temperature. For quality results, an algorithm was applied to capture the data and send the processed data to a smart computer for further processing. On the use of radio frequency identification (RFID) systems, Heidinger et al [33], reported a common approach to bee counting or tracking, especially for frequency determination, and length of honeybee Queen nuptial flights. In [34], it was observed that improving the performance and size of an Arduino-based microcontroller could lower the cost of beehive monitoring systems. The authors use a MicroSD card for the recording of temperature and relative humidity data extracted from an active beehive. The card content is downloaded for processing periodically by a beekeeper at the Beehive colony.
Moreover, Kridi et al [35] created a temperature-measurement system using Arduino platform with the LM35 sensor. The data was transferred to the internet via the XBee-Pro module, and data was collected to detect thermal changes in the hive in order to recognize a decreasing population. In order to appropriately link the activities to prevailing environmental factors, Jiang et al [36] designed a frequency monitoring application to observe the frequency of bee motion in and around the hive, the humidity, and temperature within and outside the hive.
Wireless sensor networks (WSNs) have been used for Honeybee hive surveillance more recently, and this is a more effective approach due to the enormous benefits they offer [37] [38]. WSNs aid beehive environment monitoring from a non-intrusive distance [39], especially when it is really difficult to assess the location of the beehive. In view of this development, Kviesis et al [40] designed a system with a principal unit which communicates with other nodes in the hive using a wireless sensing technology. This is done simultaneously with an internet gateway. The authors deployed an integrated SHT15 sensor to monitor humidity and temperature, and capture information being communicated to a remote database through the main unit. In Zacepins et al [41], the Raspberry Pi was deployed for temperature monitoring of all the beehives and the entire hive colony. Interestingly, the authors focused on reducing the cost of monitoring the action and movement patterns of the bees in the hive by using a single Raspberry Pi module.
Furthermore, Murphy et al [42] took advantage of a WSN to collect the most important data on the activities of the beehive and its environment. An SD card was used to save the samples collected and broadcast to the transmitter once a day over a Zigbee network. The transmitting station serves as a bridge that sends the data via a telecommunication infrastructure to the wireless server. It is interesting to note that Murphy et al [43] used this sensor monitoring system to alarm the beekeeper of any potential colony threat through autodetection of changes in the hive by suggesting various algorithms to be deployed to mitigate any arising threat, and depending on the carbon dioxide levels in the hive, a weather prediction algorithm could be deployed accordingly.
In the northern hemisphere, Zacepins et al [44] collected internal and external hives data using a wirednetwork topology, unlike some existing reports that use wireless sensors technology. Similarly, Edwardsmurphy et al [45] use several network technologies for hives monitoring, and event tracking in the colonies. The authors made use of classifiers for sensor inputs and establish on-site observations, which correlate with events that are easily verifiable. Rangel and Seeley [46] explored the use of microphones and high-tech cameras for the detection of motion within the bee hive. Various patterns were checked for both buzz and bee movements in some colonies where bees swarming operations occurred. This approach is similar to that of Ferrari et al [47] where audio, temperature and humidity sensors were used to compare steps during bees' migration.
Freitas et al [48] examined the flock of Apis bees towards the coast during the dry season and examined their routes in the rainy season. The results indicate that temperature fluctuations affect the colony. Similarly, Eskov and Toboev [49] investigated the beehive temperature using infrared radiation during the passage of winter for possible differentiation of individual bee's temperature, and Kridi et al [50] reported an experiment on beehives temperature with a wireless sensor network to match internal and external thermal patterns suggesting rapid fluctuations in bees' collection.
In recent reports, further improvements in the monitoring of bees have been presented. For instance, in Baptiste et al [51], the status of the bees was made known by observing their flight trajectories. The bees were observed and monitored using advanced image and video processing methods [52] [53]. Furthermore, Internet of things (IoT) studies on beekeeping were carried out in [54]. The interesting part is on the development of a stem that analyzes temperature data from a beehive and links it to the surrounding environmental conditions. This allows beekeepers to monitor and observe key data indicators, and provide the right enabling environment for the bee colony [55]. Finally, Jiangyi et al [56] designed an intelligent beehive structure by deploying IoT technology. In this scenario, temperature sensors were installed in the hives for proper monitoring of the hive's temperature and other environmental conditions.

MATERIALS AND METHOD 3.1 Hardware Design
Arduino UNO microcontroller is the major and central unit of the proposed system, it is the main processing unit that performs the key functions in the entire system, and it serves as an interface with the sensor chip at the input. This receives acoustic, humid data and transmits same through the Wi-Fi module, which sends the received information to the cloud via the GSM Network. The block diagram of the proposed beehive monitoring system is as shown in Figure 1

Software Design
The system was programmed in Arduino and AT commands, an open-source software development platform (Arduino) with a large world-wide community support. Arduino IDE was used for the microcontroller programming and useful data were extracted by the sensors and transmitted to the cloud. The code for reading the temperature, and sound levels were built in Arduino. When the program starts, it initializes variables and opens the serial port at 9600 baud rates. It also initializes the liquid crystal display (LCD) and waits for about 3s for the ESP8266 to boot up. The algorithm designed for this code is as shown in Figure 2 Wi-Fi module is programmed directly through AT commands as the Arduino IDE is programmed to work with the ESP8266 Arduino compatible module. When the ESP8266 boots up, an array called variable is initialized to receive data through UART communication from the Arduino. In the case that the ESP8266 module is not connected to Arduino, this prevents runtime errors. If connected, Arduino values will override the zeroinitialized array. In addition, the network parameters are configured and a TCP database is built on the ESP8266 platform. In order to avoid having to flash the ESP before subsequent programming can work, a 3s delay is input to give it time to flash if and where necessary. Any incoming link and service arrives after 3s. The algorithm used in the ESP8266 module programming is illustrated in Figure 3.

RESULTS AND DISCUSSION 4.1 Results
The system maintained automatic readings of the temperature and sound levels inside the beehive and were recorded and uploaded to the thingspeak server as a test for the full implementation of the system. Data obtained could be further analyzed to give graphical outputs depicting the measurements parameters of the beehive on the cloud server accessible with reliable internet connection. Sample output data from the sensors are presented in Table 1. The bees sound levels at different periods of the day and their corresponding frequency variations are summarized as shown in Table 2. For clarity, the results in Table 1 are sketched on a graph as shown in Figure 4. Further to this, a comparison of sound intensity in the beehive against the time of the day is given in Figure 5. Finally, a comparative analysis of the frequency and sound levels obtained during the night, day and swarm activities of the beehive is given in Figure 6.       Table 1 shows a comparison of the temperature and sound levels measured inside a beehive against day and time. The data shows the ambient temperature inside the beehive which corresponds to the daily average temperature of the bee hive. A critical observation shows that the temperature of the surrounding environment affected the internal temperature of the beehive. There seems to be a reasonable correlation between sound intensity and the temperature in the hive, coupled with weather fluctuations that occur during the day. The initial temperature recorded at the beehive is 23.5°C at 12:30WAT, and rises briefly to 23.9°C at 12:33hours until the actual swarming time when the temperature falls steadily to 22.3°C, the lowest temperature recorded. Suddenly, the temperature increases reaching 26.4°C at 13:25:00, and falls rapidly to around 22.5°C at 13:47:00. This is perhaps due to a ventilation issue in the beehive housing resulting to a frequent flitting of bees' wings to reach a temperature of around 26°C for lifting. However, the impact of these rapid movements did not significantly affect the performance of the proposed system. Moreover, the temperature rises continuously to a peak at 26.8°C, and maintain a fairly stable state between 14:37:00 and 14:50:00 hours before falling steeply to 22.7°C at about 16:38:00 hours.

Discussions
Results also revealed that four swarming events occurred which were identified at the right time from the sound analysis during data collection. It is interesting to note that swarms also occur in the daylight hours, mostly in the hours when the temperature is very high. However, the length of the swarm was not used in distinguishing the sounds from the others as they had a wide range. In analyzing the sound data, the activity of the bees was observed particularly in relation to the status of the hive in terms of swarming and normal activity, and also the time of the daynight and day. Figure 5 shows the sound intensity in the beehive against the time of day. The highest sound level recorded is -340dB and this occurs at about 15:20:00 hours. On the other hand, the lowest sound reported is -377dB and this corresponds to the 12:40:00 hours. However, it should be noted that sound levels change depending on the time of the day and such differences are depicted in Figure 6, where certain different events are observed and labeled with the corresponding basic frequency.
Furthermore, Figure 6 shows the sound levels at night, day, and swarming, in sound recording spectrograms. These results revealed that throughout daytime operation, the general amplitude is much lower compared to the noise at night. Though the peak frequencies could be observed occurring around the same frequency bands, the major difference lies in the change from around 140-260 Hz and 330-440 Hz, when focusing on the swarming sound frequencies. In addition, increased energy content in swarms at higher frequencies in close comparison with the normal behavior of the bee is observed. Finally, Figure 6 also shows a rise in both parameters in swarming sounds relative to the other sounds over the frequency and amplitude values of the entire recorded sound information.

CONCLUSION
A candidate system that monitors the temperature and sound levels inside a beehive was designed and implemented. The system remotely monitors the conditions of a beehive via ESP8266 communication module, and a web-server on a smartphone. Harvested data on the bee colony behavior ranging from temperature variations to sound intensity measurements were obtained using the evolved system. Analysis of the data obtained from the beehive shows reasonable variations in sound intensities as the temperature of the beehive changes. Through a careful examination of the results, information on the current state of the beehive such as knowing when swarming is about to start, and when swarming is completed were deduced. Results also show that bees are at their most active regime at higher temperatures, and in this scenario, produce higher frequencies when compared with the normal temperature data. This period is when swarming takes place in the beehive, and at this time, appropriate measures could be taken in preparation for swarming. Future work would focus on the integration of a robust sound recording system with other environmental variables for seamless integration with an online platform, to automatically alert beekeepers during emergency at the beehive.