Analysis of Energy Consumption in a Precision Beekeeping System
AA NALYSIS OF E NERGY C ONSUMPTION IN A P RECISION B EEKEEPING S YSTEM
Hugo Hadjur ∗ em lyon business school Inria, Univ Lyon, EnsL, UCBL, CNRS, LIPLyon, France [email protected]
Doreid Ammar † em lyon business school Ecully, France [email protected]
Laurent Lefevre ‡ Inria, Univ Lyon, EnsL, UCBL, CNRS, LIPLyon, France [email protected]
October 2020 A BSTRACT
Honey bees have been domesticated by humans for several thousand years and mainly provide honeyand pollination, which is fundamental for plant reproduction. Nowadays, the work of beekeepers isconstrained by external factors that stress their production (parasites and pesticides among others).Taking care of large numbers of beehives is time-consuming, so integrating sensors to track theirstatus can drastically simplify the work of beekeepers. Precision beekeeping complements beekeepers’work thanks to the Internet of Things (IoT) technology. If used correctly, data can help to makethe right diagnosis for honey bees colony, increase honey production and decrease bee mortality.Providing enough energy for on-hive and in-hive sensors is a challenge. Some solutions rely on energyharvesting, others target usage of large batteries. Either way, it is mandatory to analyze the energyusage of embedded equipment in order to design an energy efficient and autonomous bee monitoringsystem. This paper relies on a fully autonomous IoT framework that collects environmental and imagedata of a beehive. It consists of a data collecting node (environmental data sensors, camera, RaspberryPi and Arduino) and a solar energy supplying node. Supported services are analyzed task by taskfrom an energy profiling and efficiency standpoint, in order to identify the highly pressured areas ofthe framework. This first step will guide our goal of designing a sustainable precision beekeepingsystem, both technically and energy-wise.
Keywords internet of things, energy consumption, benchmarking, smart agriculture, precision beekeeping
Whether it is used by companies or individuals, technology applied to agriculture (smart agriculture or precisionagriculture) has brought a whole new dimension to farming. With the new modern constraints of growing demandand farming area shrinking, the need is no longer to expand, but to optimize, while taking into consideration theenvironmental challenges. To do so, farmers nowadays make use of IoT technologies that collect relevant data regardingtheir plantations and data-related tools to optimize their work.Recently, several stress factors emerged from the agricultural industry and apiculture, among others, is affected.Precision beekeeping is a branch of precision agriculture linked to apiculture. The goal is to support beekeepers so thatcrucial events are detected as early as possible. Such events may include the swarming state, queenless state, infected ∗ http://perso.ens-lyon.fr/hugo.hadjur/ † https://scholar.google.com/citations?user=Wh-CURQAAAAJ ‡ http://perso.ens-lyon.fr/laurent.lefevre/ a r X i v : . [ c s . A R ] O c t olony, attacked colony and dead colony. Designing a precision beekeeping system deployed into wild zones usuallyrequires efficient use of the energy budget, which is mainly provided by batteries.Monitoring and profiling energy consumption of large scale systems is a real challenge [8]. The objective of this workis to observe and analyze the energy consumption of all deployed hardware, software and services components of aprecision beekeeping system. Through this analysis, we can embed all costs of specific steps (idle mode, boot up,shutdown, stress) combined with required services (sensors data collection, image capture, data exchanges) and proposea complete energy consumption overview.The paper is organized as follows: Section 2 provides a brief overview of selected previous works addressing precisionbeekeeping. In Section 3, we give an overview of the precision beekeeping system, describe the data collection process,and present the experimental setup used to analyze the energy consumption. Section 4 focuses on the analysis of energyconsumption of some specific steps (idle, boot, shutdown) while in Section 5 we present an analysis of the energyconsumption of the beekeeping services. In Section 6, we analyze the energy consumption of the system in severaltemperature conditions. Section 7 concludes the paper and shares directions for future work. In recent years, several studies have underlined the potential of integrating intelligent digital technologies for monitoringhoney-bees. Edwards-Murphy et al. propose in [5] a bee monitoring system to describe the internal conditions of abeehive using data from sensors that are embedded within the beehive. The collected data are: temperature, humidity,Carbon Dioxide (CO ) levels, and Oxygen (O ). A machine model is developed in [5] to detect a subset of beehivestatus and alert the beekeeper when an important beehive change is detected. An audio-based monitoring system fordetecting the presence of the queen bee inside the beehive is introduced in [7], using data from the NU-Hive project [3].The proposed system exploits the sound emitted by the beehives to determine the presence of the queen bee insidethe beehive. Similarly, audio-based monitoring systems are also used to detect a beehive state known as "swarming",such as the work conducted in [6]. Although beekeepers who decide to integrate sensors to their beehives still heavilyrely on weight (to be correlated with honey quantity), companies release monitoring systems capable of tracking realtime temperature of the inside of beehives, humidity, sound and gas levels. A variety of products is available on themarket. Label Abeille and Arnia cover a wide range of metrics outside the beehive (temperature, humidity, weight ofthe beehive and other environmental data). Mellisphera allows monitoring temperature and humidity from inside thebeehive. Pollenity develops a sensor that can be attached to an in-hive frame and collect temperature, humidity andsound up close from the bees.The paper from Ammar et al. [2] introduces the system which is analyzed in this paper. Here, an in-depth analysis of theenergy consumption of each step of the precision beekeeping system is conducted, in order to design an autonomous,energy-efficient and sustainable connected beehive. This paper aims to analyze the energy consumption of a precision beekeeping system built at em lyon business school and previously described in [2]. The name of the system (beehive equipped with IoT components) is the “Makers’Beehives”. Figure 1 shows a picture of two Makers’ Beehives that are deployed on the roof of em lyon business school .In this section, we give a brief overview of the architecture and the electronic components of a Makers’ Beehive, aswell as, the data acquisition process. Following that, we elaborate on the experimental setup used to analyze the energyconsumption of this precision beekeeping system.
A Makers’ Beehive consists of a commonly used Dadant beehive to which two extra parts are added, namely, a woodenbase and a solar roof that are placed respectively under and on top of the beehive. The base functions as both a standfor the beehive and a scale thanks to four load sensors located at the corners of the base frame. The roof hosts theelectronics, and is equipped with a solar panel tilted to an optimum angle for maximum annual energy production. https://pollenity.com The data acquisition process in a Makers’ Beehive consists of the following steps :
Step 0:
The Trinket turns ON and the boot up of the Makers’ Beehive system is done.
Step 1:
The Raspberry Pi runs a Python script that collects the measurements (i.e., temperature, humidity, noise, light,Carbon monoxide (CO), Nitrogen dioxide (NO ), and the beehive’s weight) from various sensors on theMETRO 328. Step 2:
The Raspberry Pi camera captures a series of 20 top view photos of the beehive entrance (one per second).
Step 3:
The captured pictures are converted to a single gif file that is uploaded to an online image sharing website.
Step 4:
The collected measurements and the url of the uploaded gif file are uploaded to a remote server. By the endof this step, a software update check is performed and the git pull command is executed when an outdatedsoftware is detected.
Step 5:
The system is granted a time interval of 5 minutes to accomplish the data acquisition process. Once the data issuccessfully uploaded, the Raspberry Pi shuts off completely. However, if the data acquisition process is notaccomplished within the granted time, the Trinket turns OFF leading to a system shutdown.The Makers’ Beehive periodically executes sensing cycles. Every hour, the system wakes up, performs the dataacquisition process and then goes into sleep mode again. It is also worth noting that the data acquisition steps areperformed over a short time interval of 1 to 5 minutes.The following sections describe an experimental replica of the Makers’ Beehive and its power consumption in varioussituations.
To measure the energy consumption of our precision beekeeping system we developed an indoor experimental setupcapable of monitoring and profiling the energy consumption of the IoT nodes.Figure 2 shows an overview of our testbed. The testbed consists of a duplicated version of the sensor nodes that areresponsible for performing the data acquisition process in the Makers’ Beehive. However, the solar panel, converter,battery and Trinket were removed and replaced by a microUSB power connector that is directly connected via a 5V3igure 2: Experimental setup for monitoring energy consumptionvoltage regulator to a power plug. Furthermore, we make use of an additional Raspberry Pi 3 Model, a Base Hatfor Raspberry Pi and a ±
5A DC/AC Current Sensor (ACS70331). The current sensor is used to measure the powerconsumption of the Makers’ Beehive. This sensor is connected to the new Raspberry Pi via the Base Hat.
We first observe the energy consumption of specific conditions and steps (idle, boot, shutdown and stress) in order toanalyze several costs.Figure 3: Power consumption of a Raspberry Pi in Idle mode over a 60-second time window
A first step toward analyzing the energy consumption of the setup and its tasks is to understand the fixed costs of thehardware. The consumption of the data acquiring Raspberry Pi was recorded while in Idle mode (Raspberry Pi loggedin, the operating system launched and at a resting state). This experiment repeats itself four times, to determine thepower consumption of the peripherals. First, the full setup is tested (Arduino sensor node plugged in and Pi Cameraplugged in). Then, each peripheral is plugged in alone. Finally, the Idle consumption of the setup without any peripheralis recorded. 4igure 3 shows the extra 0.5W of power cost by the connection of the Arduino sensor node via USB. It is important tonote that the energy impact of the camera peripheral (not in use) seems negligible.
Since the in-hive system wakes up every hour, it is mandatory to analyze the details of each boot up and shutdown phase.Figures 4 and 5 show the power evolution of a standard boot up phase (with Arduino plugged in) and the comparison oftwo shutdown phases.
Observing Boot up step
For the boot up phase, the recorded Raspberry Pi was turned off (0s-10s window in Figure4), plugged out of the power supply (10s-20s) and plugged back in (20s mark).Figure 4: Power consumption of the full setup (Arduino plugged in) during boot upThe boot up phase, thanks to its quickness (10 seconds, between the 20s and 30s mark on Figure 4), does not requiremuch energy (14.5 Joules in the case of Figure 4): the time window where the power is greater than the resting phase isonly 4-second long (26-30s).
Observing Shutdown step
For the shutdown phase, a graceful shutdown approach was used. During a gracefulshutdown phase, all running processes are sent a shutdown message. It is only once those processes are closed that theinterface is turned off and the filesystems unmounted (described in [1]). A forced shutdown alternative also exists. Itdoes not notify the running processes of the incoming shutdown. In our case, both were tested and although the forcedapproach turns off the system in less than one second, the small gain of energy is not worth the risk of potential memoryerrors. The presented results focus on the graceful approach.Figure 5: Power consumption of the full setup – Arduino plugged in – (blue) and Arduino plugged out (green) duringshutdownThe results of Figure 5 follow the previous section findings, as the extra USB peripheral adds a fixed cost of energywhile turned on. If the Raspberry Pi is turned off and still plugged in, there is no impact of the Arduino. The slight peakof power usage at the moment of the shutdown (10s mark) is explained by the messages sent to running processes andthe stop of these processes. 5 .3 Stress Testing
To better understand the limits of the services of a Raspberry Pi 3, its performances in extreme situations are analyzed.Stress testing aims at pushing a CPU to its full power.Figure 6: Power consumption of stress taskFigure 7: Power consumption of CPU burn task
Experimental Conditions
In this section, we benchmark two stress tasks, both available on a Raspbian Lite operatingsystem:• Stress ( stress ): here, the CPU is run at its full power, all the while controlling the temperature of the chip.• CPU Burn ( cpuburn-a53 ): here, the Raspberry Pi is maxed out completely without any restriction.
Results
Figure 6 and Figure 7 show the temperature and power consumption for the two tasks along several minutes.The absolute maximal power used from the Raspberry Pi 3 lies around 4.5W, whereas the safer approach only requiresbetween 2.6W and 2.7W, which is comparable to the energy of some tasks performed in the field.
The second part of our analysis concerns the measurement of the energy consumption of the data acquisition processthat is detailed in Section 3.2. More precisely, we profile the power usage of the collected measurements and computethe consumed energy (
Step 1 : 6.2 Joules on average), captured images (
Step 2 : 23.7 Joules on average), resized andconverted images (
Step 3 : 126.1 Joules on average), and transmitted data (
Step 4 : 13.5 Joules on average). This analysisrelies on the embedded Python code that runs inside the beehive, every hour.Figure 8 shows the overall consumption of one execution of the in-hive script. It is mainly divided into four energyphases, one for each step, allowing us to estimate the power cost of each. The most energy-consuming phase is thelongest: the third one (20s-80s window) which converts images into a GIF and uploads it. The GIF file, which is thenuploaded to the dashboard website allows beekeepers to inspect the entrance of their beehive at a glance. https://makersbeehives.herokuapp.com The temperature, humidity, noise, light, Carbon monoxide (CO) and Nitrogen dioxide (NO2) are captured at thebeginning of the hourly script. It usually takes 1 to 2 seconds to perform this step (step 1 of Figure 8).
The series of captured images is represented in step 2 of Figure 8.There is a challenge for choosing the quantity and the resolution of images. The resolution affects the performances ofdeep learning computer vision algorithms: the better the quality, the higher the efficiency of the learning model. Theprocess of training such a model is also linked to the size of the training set: in general, a large number of images asinput is able to train a deep learning model well. But at the same time, capturing and transferring a large number ofhigh-quality images is time-consuming and CPU-consuming. Our goal is to find the right balance between the energycost of the system and the quality of recommendations to beekeepers.The Raspberry Pi camera (Raspberry Pi Camera Rev 1.3 ) and its Python module allow to pre-select the resolution ofthe still pictures so that there is no need to uselessly take high-resolution pictures to then downsize them. It was thecase of the first version of the code which was running in the Makers’ Beehive. Since then, this was changed to a betterapproach.In this section, the cost of time and energy of capturing different quantities of images at different resolutions wasanalyzed. Experimental Conditions
Once a picture is taken, the program loops without any pause and directly runs the captureof the next one. For consistency, the camera was always placed at the same spot and with the same angle of view.The first experiment consists of measuring the time to capture different batch sizes of 800 × × × × × × × × × × × × × Results
Figure 9a shows that the average time per image is 0.515s, which is also the fastest frame rate at this resolutionwhen taking pictures (the camera module also allows video capturing, not treated in our work). (a) Different batch sizes (b) Different resolutions Figure 9: Time needed by the PiCamera to capture (a) different batch sizes of 800 × The flow of data transmitted in the sensor network is bidirectional. On one hand, the Raspberry Pi updates the softwareat each iteration of the main loop: a download triggered by a git pull command (step 4 of Figure 8). On the other,data from environmental sensors and the GIF file are uploaded to a server, where it can be manually accessed (end ofstep 3 and step 4 of Figure 8).The goal of this section is to profile the data transmission energetically for both wired and wireless connexion types.The energy consumption of such scenarios was analyzed thanks to the iPerf3 tool [4], which allows transferring networkpackets at the maximum achievable bandwidth.
Experimental Conditions
The replica of the in-hive Raspberry Pi was connected to a local network, located in Lyon,France (Internet provider: SFR). This network has a maximum download speed of around 190Mbits/s and a maximumupload speed of around 20Mbits/s. The Ethernet cable has a maximum speed of 100Mbits/s. The server which wasused to test sending and receiving data is a public server located at bouygues.iperf.fr . Its bandwidth is 10Gbits/s.Once the Raspberry Pi connected to the network (either through Ethernet or Wi-Fi), a 50MB upload was tested thanksto the command iperf3 -c bouygues.iperf.fr –bytes 50M , as well as the download equivalent ( -R added atthe end of the command). 50MB is enough to get at minimum a few seconds of execution for the fastest rate of transfer(downloading through Ethernet). The Internet transport protocol used is TCP (Transmission Control Protocol) and thereis no bandwidth restriction.Figure 10: Power consumption of the full setup downloading 50MB from a distant server. Two types of connectivitywere tested: Wi-Fi (blue) and ethernet (red). 8igure 11: Power consumption of the full setup uploading 50MB to a distant server. Two types of connectivity weretested: Wi-Fi (blue) and ethernet (red). Results
The results in Figure 10 and in Figure 11 show the comparison between the types of connection. Although itis obvious that a wired connection is faster than a wireless, downloading data with the first reaches a higher spike ofpower than the latter, while uploading data show the opposite results.Table 1: Average energy consumed while performing connectivity tests (transferring 50MB)
Network Data-rate Power consumption download upload download upload
Wi-Fi 25.7 Mbits/s 9.5 Mbits/s 34.0 Joules 93.9 JoulesEthernet 86.4 Mbits/s 19.2 Mbits/s 10.8 Joules 42.5 Joules
Table 1 helps to understand what is the limiting factor and the pressure point in each case:• While downloading through Wi-Fi, the speed seems to be limited by the Raspberry Pi’s Wi-Fi card.• While downloading through Ethernet, the speed is limited by the Ethernet cable.• While uploading through Wi-Fi, the speed seems to be limited by the Raspberry Pi’s Wi-Fi card.• While uploading through Ethernet, the speed is limited by the local network’s upload bandwidth. This couldexplain the rather small increase of power in this case.Table 1 also shows that it is more efficient to use an Ethernet connection while exchanging data. However, while in Idlemode or performing other tasks that do not stress the network, having an Ethernet cable plugged into a Raspberry Piintroduces an extra energy cost of around 0.07W to 0.10W. It represents the energy required to handle the Ethernetperipheral. The longer a Raspberry Pi is performing tasks that do not require the Internet, the better the Wi-Fi connectioncompared to Ethernet.
Precision beekeeping systems will be deployed on-site in wild zones. The system is supposed to run without interruptionoutdoors and yearly. How varying temperature conditions can impact the energy consumption of the system?
Experimental Conditions
The testbed (Figure 2) was placed in two different temperature conditions: at a coldtemperature (inside a fridge; between 3°C and 5°C) and at room temperature (between 19°C and 22°C), all the whilemaintaining power supply connection. For each one (Figure 12), ten iterations of the main script were executed, eachof them followed by a 3-minute break, to retrieve a resting state. Since the pictures captured in an open place (roomtemperature situation) are different than the ones taken inside a closed dark fridge (cold temperature situation), the sizecan differ too, leading to different performance for compressing images and converting them into a GIF file. To avoidthis potential issue, the same batch of images was always chosen to create the GIF file.
Results
Over 10 iterations of the main script, the average energy consumption is on average 169.6 Joules at roomtemperature, with a standard deviation of 3.1 Joules (average temperature of Raspberry Pi chip: 45.7°C ; standard9igure 12: Power usage and temperature of the Raspberry Pi chip for one script run at different temperature conditionsdeviation: 0.6°C). At cold temperature (between 3°C and 5°C), the average consumption of energy is slightly impactedwith an average consumption of 186.4 Joules and a standard deviation of 4.6 Joules (average temperature of RaspberryPi chip: 30.4°C ; standard deviation: 0.5°C).Practically, the system (full setup with Raspberry Pi and Arduino plugged in) alternates between a 60-minute OFF modeand the 5-minute data collection window. The latter is a combination between the Raspberry Pi boot up, the executionof the script, and the shutdown. According to the observations in the previous sections, the total cost of energy is 1800Joules for the 60-minute OFF mode phase and 548 Joules for the 5-minute script window. All in all, that is an averageof 2167 Joules per hour, being 120.4 mAh at 5V. In the example of the currently deployed system [2], the capacity ofthe solar-powered battery is 33000 mAh. So if a fully charged battery were to lose its link to its charging source, thesystem would still function for around 11 days and 10 hours (274 cycles of 1 hour).
This work presents a complete analysis of energy consumption and the thermal performance of a precision beekeepingsystem. This is the first step towards optimizing the energy consumption of the deployed services of a connectedbeehive.Based on our analysis, it seems like the temperature of the system does not significantly affect the energy consumptionof the execution of a script. The current approach of the Makers’ Beehive, which consists of shutting down completelythe system and waking it up every hour in order to perform the data collection seems to be an energy efficient solutionbecause the residual consumption of an idle Raspberry Pi 3 has a significant impact on energy consumption. Theconsumption of the USB connection of the Arduino sensor node is significant. It adds an extra fixed cost of energy,so future work will explore other ways for the plugging sensor (sensor shield) in order to determine the most energyefficient solution.Future work will focus on deploying new services of data processing like deep learning applications in the precisionbeekeeping system. Taking care of the energy consumption is mandatory since there are multiple ways to proceed: eitherperforming the computation on chip (energy-heavy task) and only sending the results (few bytes), or not performingany computation and sending the uncompressed data streams.
References [1] I. A
MIRTHARAJ , T. G
ROOT , AND
B. D
EZFOULI , Profiling and improving the duty-cycling performance oflinux-based iot devices , CoRR, abs/1808.10097 (2018).[2] D. A
MMAR , J. S
AVINIEN , AND
L. R
ADISSON , The makers’ beehives: Smart beehives for monitoring honey-bees’activities , in Proceedings of the 9th International Conference on the Internet of Things, IoT 2019, New York, NY,USA, 2019, Association for Computing Machinery.[3] S. C
ECCHI , A. T
ERENZI , S. O
RCIONI , P. R
IOLO , S. R
USCHIONI , AND
N. I
SIDORO , A preliminary study ofsounds emitted by honey bees in a beehive , in Audio Engineering Society Convention 144, May 2018.104] J. D
UGAN , S. E
LLIOTT , B. A. M AH , J. P OSKANZER , AND
K. P
RABHU , iperf website . https://iperf.fr/ .Last accessed: 2020-05-19.[5] F. E DWARDS -M URPHY , M. M
AGNO , P. M. W
HELAN , J. O’H
ALLORAN , AND
E. M. P
OPOVICI , b+wsn: Smartbeehive with preliminary decision tree analysis for agriculture and honey bee health monitoring , Computers andElectronics in Agriculture, 124 (2016), pp. 211 – 219.[6] S. F ERRARI , M. S
ILVA , M. G
UARINO , AND
D. B
ERCKMANS , Monitoring of swarming sounds in bee hives forearly detection of the swarming period , Computers and Electronics in Agriculture, 64 (2008), pp. 72 – 77. SmartSensors in precision livestock farming.[7] I. N
OLASCO , A. T
ERENZI , S. C
ECCHI , S. O
RCIONI , H. L. B
EAR , AND
E. B
ENETOS , Audio-based identificationof beehive states , CoRR, abs/1811.06330 (2018).[8] A.-C. O
RGERIE , M. D
IAS DE A SSUNCAO , AND
L. L