FruiTemp: Design, Implementation and Analysis for an Open-Source Temperature Logger Applied to Fruit Fly Host Experimentation

Featured Application: Overwintering and aestivation studies for endophytic insects, development and population growth under ﬁeld conditions, demographic analysis of ﬁeld populations. Abstract: FruiTemp is an open-source prototype developed to study the response of endophytic insect species such as fruit ﬂies (Diptera: Tephrtidae) to variable temperature conditions including the controlled laboratory and ﬂuctuating ﬁeld settings. The system is a three-channel temperature sensor that consists of two precision thermistors that measure the temperature in the core and the surface of a fruit on a tree and a Harsh Environment thermistor that measures the air temperature surrounding the host at a rate of one measurement per 15 min. The sample rate can be adjusted according to the researcher’s needs. The system was successfully tested in ﬁeld and laboratory experimental conditions using apples as the fruit model. The measurements on apples on trees lasted ﬁve consecutive days and produced a range of reliable data. After assessing statistical agreement and precision, the results revealed a differential bias of 0.331 ◦ C and a proportional bias of a magnitude of 0.982. This work promotes open-source implementations allowing inexpensive solutions aiding experimentation procedures by signiﬁcantly lowering operating costs.


Introduction
Development of technological applications in monitoring of environmental traits involves countless custom-made and/or industrial devices. These serve for overviewing smart greenhouses, in applications in precision agriculture, in smart farms [1,2], in recording climatic conditions, in applications of sensors for camera trap devices, in recording behavior of wildlife using tracking devices [3], etc. Our goal in this study was to create an inexpensive custom-made device that records core, surface and external temperature of a fruit and test it in laboratory conditions and further in field experiments of interest. The essential specifications for the device are the portability, power efficiency, user-friendly interface and a weatherproof enclosure. The sensor specifications include: sensor tips as less invasive as possible in order to reduce the insertion hole diameter on the fruit, accurate and precise readings. Additionally, an important consideration was the reduction of its Figure 1. Initially the device was designed according to the specifications based on the nature of the experiment. Then, the laboratory experiment was designed and data collection followed. Data analysis involved statistical methods to assess the Agreement. Our findings confirmed the initial hypothesis which allowed us to design the field experiment.

Design of the Device
The device ( Figure 2) is a portable, waterproof temperature data logger that is equipped with two fine precision medical temperature sensors and a harsh environment temperature probe. It can log data according to the interval prespecified by the user and has low power consumption needs. It is equipped with a real time clock powered by a backup battery to include a time stamp for every reading and a micro-SD card module to store the data. The main parts of the system are the microcontroller (Adafruit feather 32u4 proto board [23]), which is the processing part that coordinates all the others. The second most important parts are the Amphenol NTC thermistor MC65 series [24] and the Amphenol Industrial Temperature Sensor JS8746A [25]. The former sensor is a very fine point medical temperature sensor (1.65 mm diameter maximum), and the latter is a harsh-environment sensor for air temperature with a cylindrical enclosure. The size of the MC65 series makes it the best available solution for the experiment, which requires the least intrusive way to measure the temperature of the fruit's core. Furthermore, we did not choose a smaller diameter for the sensing part although available, because, as the thermistor is inserted in the core of the fruit it might be damaged due to the friction between the flesh of the fruit and the thermistor during its insertion. The vital parts that contribute to the precision and accuracy of the system are the ADS1115 16-bit ADC-4 channel with Programmable Gain Amplifier [26]-which increases the ADC resolution from 10 to 15 bits and amplifies the analog signal of the sensor and the LM4040 Voltage Reference Breakout [27], which stabilizes the reference voltage to achieve more accurate readings. Table A1 displays the specification of the thermistors used. Figure 1. Initially the device was designed according to the specifications based on the nature of the experiment. Then, the laboratory experiment was designed and data collection followed. Data analysis involved statistical methods to assess the Agreement. Our findings confirmed the initial hypothesis which allowed us to design the field experiment.

Design of the Device
The device ( Figure 2) is a portable, waterproof temperature data logger that is equipped with two fine precision medical temperature sensors and a harsh environment temperature probe. It can log data according to the interval prespecified by the user and has low power consumption needs. It is equipped with a real time clock powered by a backup battery to include a time stamp for every reading and a micro-SD card module to store the data.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 3 of 16 Figure 1. Initially the device was designed according to the specifications based on the nature of the experiment. Then, the laboratory experiment was designed and data collection followed. Data analysis involved statistical methods to assess the Agreement. Our findings confirmed the initial hypothesis which allowed us to design the field experiment.

Design of the Device
The device ( Figure 2) is a portable, waterproof temperature data logger that is equipped with two fine precision medical temperature sensors and a harsh environment temperature probe. It can log data according to the interval prespecified by the user and has low power consumption needs. It is equipped with a real time clock powered by a backup battery to include a time stamp for every reading and a micro-SD card module to store the data. The device consists of two precise medical sensors inserted in the fruit and an environment temperature probe. There is also an On/Off waterproof switch. The box is waterproof (IP 54) and flanged.

Hardware
The main parts of the system are the microcontroller (Adafruit feather 32u4 proto board [23]), which is the processing part that coordinates all the others. The second most important parts are the Amphenol NTC thermistor MC65 series [24] and the Amphenol Industrial Temperature Sensor JS8746A [25]. The former sensor is a very fine point medical temperature sensor (1.65 mm diameter maximum), and the latter is a harsh-environment sensor for air temperature with a cylindrical enclosure. The size of the MC65 series makes it the best available solution for the experiment, which requires the least intrusive way to measure the temperature of the fruit's core. Furthermore, we did not choose a smaller diameter for the sensing part although available, because, as the thermistor is inserted in the core of the fruit it might be damaged due to the friction between the flesh of the fruit and the thermistor during its insertion. The vital parts that contribute to the precision and accuracy of the system are the ADS1115 16-bit ADC-4 channel with Programmable Gain Amplifier [26]-which increases the ADC resolution from 10 to 15 bits and amplifies the analog signal of the sensor and the LM4040 Voltage Reference Breakout [27], which stabilizes the reference voltage to achieve more accurate readings. Table A1 displays the specification of the thermistors used. The device consists of two precise medical sensors inserted in the fruit and an environment temperature probe. There is also an On/Off waterproof switch. The box is waterproof (IP 54) and flanged.

Hardware
The main parts of the system are the microcontroller (Adafruit feather 32u4 proto board [23]), which is the processing part that coordinates all the others. The second most important parts are the Amphenol NTC thermistor MC65 series [24] and the Amphenol Industrial Temperature Sensor JS8746A [25]. The former sensor is a very fine point medical temperature sensor (1.65 mm diameter maximum), and the latter is a harsh-environment sensor for air temperature with a cylindrical enclosure. The size of the MC65 series makes it the best available solution for the experiment, which requires the least intrusive way to measure the temperature of the fruit's core. Furthermore, we did not choose a smaller diameter for the sensing part although available, because, as the thermistor is inserted in the core of the fruit it might be damaged due to the friction between the flesh of the fruit and the thermistor during its insertion. The vital parts that contribute to the precision and accuracy of the system are the ADS1115 16-bit ADC-4 channel with Programmable Gain Amplifier [26]-which increases the ADC resolution from 10 to 15 bits and amplifies the analog signal of the sensor and the LM4040 Voltage Reference Breakout [27], which stabilizes the reference voltage to achieve more accurate readings. Table A1 displays the specification of the thermistors used.
The battery used for the system to be portable is a 1200 Mah Li-po battery, which can be recharged by means of a micro-USB connector while in operation. The use of headers in a Printed Circuit Board (PCB) allows the researchers to easily replace parts that might Appl. Sci. 2021, 11, 6003 4 of 16 be damaged or not working properly. The detailed list of the components can be found in Appendix A.
The design is simple but efficient and is based on open-source technology. We have used a 32u4, 8-bit microcontroller, clocked in 8 Mhz. This choice was based on low consumption of the microcontroller and the vast number of guides and tutorials available that can provide guidance even for amateur users [23]. Since the 32u4 is equipped with a 10-bit analog to digital converter and the input range to the ADC is 0 to 2.048 Volts, a 16-bit analog to digital converter (ADS1115) equipped with an amplifier was added to the device. The readings from the thermistor are sent directly to the ADS1115, which uses an I2C connection with the microcontroller and the signal is amplified and digitized using 15 bits, instead of the microcontroller's 10-bit ADC. The amplification gain according to the datasheet and the input voltage from the thermistor is 2, which means that the Vcc used in order to calculate the value of the thermistor in volts (Table A2, Appendix B, ADC value formula) is 2.048 Volts. Moreover, since the microcontroller reference voltage is not stable, an LM4040 voltage reference breakout is used (0.1% output voltage tolerance) by defining the reference as 2.048 volts. Last, all the reference resistors used to create a voltage divider to read the resistance of each thermistor are of high precision and are described in details in Appendix A. A logger shield [28] was used to write all the data to a micro-SD card integrated with a timestamp. The current time was acquired by the Real time clock PCF8523. The logger shield uses a 3 V CR1220 battery to keep track of the time even if the power is cut from the microcontroller to the logger shield. The schematic is available on Figure A1 (Appendix B).

Software
The datasheet of the ADS1115 includes the choice of samples per second that has a range of 8 to 860 samples per second. We used the Adafruit library for the ADS1115 [29] which by default uses 128 samples per second.
The logging interval is adjusted according to the users' needs. For the FF-IPM experiments we used 1 and 15-min intervals.
The code was based on GitHub, OSBSS [30] and the instructions to provide it are in the supplementary material S1. The GitHub example is based on another thermistor of the manufacturer Vishay, the ADS1115 usage, the Hoge-2 equation, the resistance reading and the manual sample average. We added the logger functionality by adding the Real Time Clock, the SD-card, the sleep functionality for the MCU to reduce power consumption and the reduction of the self-heating effect functionality by powering the thermistor only when a measurement is taken. The coefficients of the thermistors were configured accordingly using the method described on Section 2.1.4.

Physical Features of the Device
The dimensions of the device (Figure 3b) are 136 mm × 83 mm × 44 mm. The box is equipped with mount holes useful in securing the device on the tree with nylon plastic cable ties. The MC65 ( Figure 3c) and JS8746A ( Figure 3d) sensors' length is 400 mm and 1000 mm, respectively. Heat-Tubes are used to protect the MC65 sensors and silicone is applied in the junction between the sensor and the heat-tube to make it stiff and protect it from damage while we insert it in the fruit.

Calibration Method
The thermistors were calibrated using conventional non-expensive methods by accessing the sensors temperature resistance curves [31]. The procedure was based on Ohm's Law and the Hoge-2 equation [32]. Only the MC65 thermistor is described since the JS8746A was calibrated the same way. The procedure is summarized in Figure A2 (Appendix B).
First, we had to read the resistance ratio of the thermistor in a range of 0 to 44 degrees of Celsius to choose the category of coefficients according to Table A3. We managed to do this by using a voltage divider and the formula Rt in Table A2. The reference resistance is 10 KOhms with a tolerance of 0.05%. The ADCvalue in the formula corresponds to the readings of the ADS1115 analog to digital converter (15 bits of precision and 1 bit for the sign) and amplifier which we used in order to increase the precision and resolution of the reading since the ADC of the microcontroller is only 10 bits. We calculated the ADC value by using the formula in Table A2. Vcc on gain two is 2.048 as the dataset of the ADS1115 suggests. We amplified the signal by only a gain of two since the output of the thermistor can only range between 0 and less than 2.048 volts. We used the LM4040 to have a reference of 2.048 with a 0.1% tolerance. This addition improved the accuracy and precision of the system since it keeps the voltage reference stable and the values will not fluctuate. The first formula on Table A2 calculates the resistance of the thermistor. The value 10,000 is the reference resistance and 32,767 is 2 15 − 1 which is the ADC number of bits.

Calibration Method
The thermistors were calibrated using conventional non-expensive methods by accessing the sensors temperature resistance curves [31]. The procedure was based on Ohm's Law and the Hoge-2 equation [32]. Only the MC65 thermistor is described since the JS8746A was calibrated the same way. The procedure is summarized in Figure A2 (Appendix B).
First, we had to read the resistance ratio of the thermistor in a range of 0 to 44 degrees of Celsius to choose the category of coefficients according to Table A3. We managed to do this by using a voltage divider and the formula Rt in Table A2. The reference resistance is 10 KOhms with a tolerance of 0.05%. The ADCvalue in the formula corresponds to the readings of the ADS1115 analog to digital converter (15 bits of precision and 1 bit for the sign) and amplifier which we used in order to increase the precision and resolution of the reading since the ADC of the microcontroller is only 10 bits. We calculated the ADC value by using the formula in Table A2. Vcc on gain two is 2.048 as the dataset of the ADS1115 suggests. We amplified the signal by only a gain of two since the output of the thermistor can only range between 0 and less than 2.048 volts. We used the LM4040 to have a reference of 2.048 with a 0.1% tolerance. This addition improved the accuracy and precision of the system since it keeps the voltage reference stable and the values will not fluctuate. The The material of the thermistor is type F. For that reason, we used Table A3 to choose which coefficients were appropriate to form the Hoge-2 equation which is the best calibration equation comparing to nine more for the MF501 NTC thermistor according to Liu [33]. In our case the values of the resistor ranged between 0.5 to 3.223 so we used the second row (0.36035 to 3.274), this ratio is close to optimal linearity, according to Rudtsch [34] who states that for a microK-type of instrument, optimum linearity is achieved in the resistance ratio range between 0.2 and 1.2.

Power Consumption and Techniques Used for Its Reduction
FruiTemp runs on a 1200 mAh Li-po battery which can be recharged by means of a micro-USB connector while in operation. Power consumption reduction was achieved Appl. Sci. 2021, 11, 6003 6 of 16 using software and hardware techniques. The microcontroller periodically goes to sleep, and the watchdog timer [35] awakes it for temperature sampling. The microcontroller is clocked at a low frequency of 8 Mhz. When the device is measuring and recording, which means that it is awake from the sleep function, it takes 6 s to measure and log the data and has an averaged power consumption of approximately 9.735 mAh. When the device enters sleep mode the power consumption drops to an average 1.944 mAh approximately. The average consumption of the device including both modes is 3.148 mAh, for a logging interval of 1 sample per minute.

Cost of the Device
The trade-off between cost and linearity [36] affected the design. The thermistor manufacturer suggests a circuit including a differential amplifier that improves the linearity of the thermistor. Since the ADS1115 includes 4 single channels or 2 differentials, we decided to use the single ones because the sensors were 3, leaving one channel unused. By using 2 differential channels, only 2 thermistors can be supported.
Other devices, like HOBO MX2303 which is weatherproof, power efficient, has high accuracy (±0.2 • C) and has an additional Bluetooth connection, could be a good fit to the experiments demand but it is only equipped with two probe sensors and not three, the diameter of the sensors (0.53 cm) is wider than the proposed system's internal sensors (0.165 cm) and the housing of the sensor is a cylindrical stainless steel compared to the proposed system's internal sensor, which is a point epoxy material which senses a significantly smaller area than the HOBO MX2303. Overall, the HOBO MX2303 is inappropriate because it provides only two sensors, compared to our device, which provides three, and the sensors of the HOBO MX2303 are much more intrusive comparing to the proposed systems sensors. Lastly, the Hengko temperature and relative humidity data recorder sensor is specifically made for fruits and vegetables, but it only provides one sensor, has an a non-acceptable for the experiment accuracy (±0.5 • C) and its probe is highly intrusive comparing to the proposed system.
The total cost was around EUR 110 (end 2020 market costs) which can be reduced substantially by not using breakout and prototype boards (for example adafruit 32u4 proto), instead create a PCB that include only the vital parts for the system that will also decrease the size of the device.

Bias Removing Techniques, Accuracy and Measurement Range
According to Ebrahimi-Darkhaneh [37], a thermistor dissipates power in the form of heat when current flows through it due to its nature since thermistors are resistors. For that reason, we connected the input voltage of the LM4040 to pin 6 of the MCU and adjusted the code to power the thermistor only when a reading is going to take place.
We also added manual averaging to the code. The function was getting 50 readings using a 10-millisecond interval, which according to Goumopoulos [38] for the thermistor the author used, 50 readings for every cycle delivered an optimal accuracy after proper calibration.
The MC65 thermistor reports an accuracy of 0.05 • C and the JS8746A reports an accuracy of 0.15 • C according to the manufacturer's datasheet. The external ADC and the bias removing techniques we have used are not expected to add extra bias. The measuring range of the MC65 as reported in the datasheet is −40 • C to 105 • C and for JS8746A is −40 • C to 120 • C, but since the coefficients used to form the Hoge-2 equations were retrieved for a range of 0 • C to 44 • C, the present configuration suggests using this measurement range and is not limiting the device since it can be programmed to switch the parameters when the temperature is below 0 • C or above 44 • C.

Design of the Agreement Study: Measuring the Agreement Between the Core and the Surface Thermistor
The difference between the core and the surface temperature of apples was tested by inserting the green MC65 sensor (Figure 3c) in the core, 3.3 cm below the surface and the yellow MC65 sensor, 0.5 cm below the surface of 80 apples of the cultivar "Golden Delicious". The apples had similar diameter (mean = 6.94 cm, st.dev = 0.355) and firmness (mean = 7.49 and st.dev = 0.535). We used 8 fixed temperature conditions of 2 • C, 5 • C, 15 • C, 20 • C, 27 • C, 30 • C, 34 • C and 43 • C.
The external temperature sensor was measuring the fixed temperature during the experiment since all devices like fridges or furnaces fluctuate within an interval around the fixed value. The values of the readings are provided in Table 1. For the first fixed temperature condition the apples were placed in a commercial fridge (PITSOS P1KCL3606D) set at a fixed temperature of 2 • C. For the 5 • C condition we placed the apples in a commercial fridge with a fixed temperature of 5 • C. For the 15 • C condition we placed 10 apples inside an Elvem CLP 600 chamber fixed at 15 • C. For the 20 • C we placed the apples in a controlled temperature room fixed at 20 • C. For the rest of the temperature conditions, we used a WTC binder 78,532 furnace and set the temperature for 27 • C, 34 • C, 30 • C and 43 • C.
To reach the desired temperature the apples were placed for 15 h in the commercial fridges, chamber and the controlled environment room and 4 h in the furnace per desired temperature. Then, we picked one apple, pierced it with a sharp needle of 33 mm length and 3 mm diameter, inserted the green sensor and fixed it with sticky tape, pierced the apple 0.5 cm below the surface, inserted the yellow sensor, fixed it with duct tape and placed the apple in one of the aforementioned places with the logger. After 15 min, we switched on the logger to make the temperature stable in case it increased/decreased during the insertion routine and 15 measurements were taken every 3 s. The procedure was repeated for 10 apples per fixed temperature.

Agreement Techniques
The study of agreement comprises of two important parts. The first part is to quantify the extent of agreement between two measurement methods/instruments/or procedures and to determine whether this is sufficient so that they can be used 'interchangeably'. The second part is to compare important characteristics of the measurement methods such as bias and precision [39]. The first goal of our study is the quantification of the difference between the core and the surface temperature. The second goal is the comparison of important characteristics such as bias and precision of the measurements since the bias reveals the trend of the difference along various ranges of temperature between the core and surface temperature of the fruit. The precision might reveal possible fluctuations of the temperature readings probably due to difference in temperature fluctuations in the two points of interest.
The official and valid approach used to compare two different measurement methods or instruments lies in the field of statistical agreement [39]. We followed the approach proposed by Taffe [40] and Taffe et al. [41] based on measurement error models that predict the true latent trait using an empirical Bayes approach. An R package is available for the implementation of the method [42]. A graphical illustration of the estimated bias between measurement approaches and the precision of each is allowed as well. Since the package focuses on recalibration of the two methods the source code of the package is modified to remove the recalibration step, which is not relevant in our case. The adapted code is presented in detail in Supplementary Materials S2. The model used is the following [40]: where y 1ij is the proxy surface measurement for i = 1, . . . , 8 subjects, j = 1, . . . , 15 is the number of replications per subject, y 2ij is the reference measurement (fruit core temperature in our case). The parameters β 0 and β 1 are the differential and proportional biases, respectively, while x ij is a latent variable with density f x representing the true unknown trait value, true temperature for individual i in our case. As a result, x ij ≡ x i . Method by subject interactions are absorbed into the measurement error terms. The quantities ε 1ij , ε 2ij represent measurement errors for measurements at the surface (1) and the core (2), respectively. It is assumed that the variances of these errors are heteroscedastic and increase/decrease with the level of the true latent trait x ij in a way that depends on the parameter θ 1 and θ 2 . These parameters quantify the trend of the variance's fluctuation. The regression model for y 2ij is estimated by marginal maximum likelihood accounting non-parametrically for the heteroscedasticity by allowing the variance of ε 2ij to be different for each decile of the empirical distribution of y 2i (i.e., the mean of the individual repeated measurements y 2ij is used as a rough approximation to x i ). Then, an empirical bias is adopted to predict x i by the mean of its posterior distribution (i.e., the mean of the conditional distribution of x i given the vector y 2i of observations for individual i by method 2), which is the best linear unbiased prediction (BLUP) for x i [29].
A smooth estimate of the (heterogeneous) variance of the measurement errors is computed by regressing the absolute values of the residualsε * 2ij , from the linear regression model y 2ij = a * 2 + β * 2x i +ε * 2ij , onx i by ordinary least squares (OLS) We chose this configuration since the goal of the field experiment targets the difference between the core and the surface temperature of the fruit (see Introduction). We also added a scatterplot to examine the structure of the data and a Bland-Altman plot to check for trends and outliers.
Alternative approaches using mixed effect models or measurement error models were considered [39] but their implementation was not as straightforward as the preferred one.

Design of the Field Experiment
The experiment took place in apple orchards, in the mountainous village of Drakeia, south Pelion, at 500 m altitude, Volos, Greece. The climatic conditions of the area during the summer months exceed 30 • C and during the winter can drop below zero especially during nighttime. We installed the sensors in apple varieties Granny Smith and Red Delicious (Starking) after the harvest period. First, we randomly selected a tree and installed the first FruiTemp logger on the peak of a tree's crown, the second to the east side of the tree, and the third on a low full shaded point. The selection of fruits/subjects varied according to their daily sun exposure. The apple located on the peak of the tree was exposed to the sun continuously during the day, the apple located to the south-east side of the tree was exposed to the sun for less time than the one on the peak and the last one was full shaded during the whole day. One sensor (MC65) was placed inside the core of the apple just before the side of sperm and the other (MC65) 1.5-2 mm away from the surface of the fruit. The third sensor (JS8746A) was placed also on the tree next to the fruit to measure the temperature of the environment (Figure 4). The system logging interval was adjusted to 15 min. After 24 h the next apple was measured for a total of 15 fruits. After the 24-h procedure each fruit was evaluated for its qualitative characteristics.
posed to the sun continuously during the day, the apple located to the south-east side of the tree was exposed to the sun for less time than the one on the peak and the last one was full shaded during the whole day. One sensor (MC65) was placed inside the core of the apple just before the side of sperm and the other (MC65) 1.5-2 mm away from the surface of the fruit. The third sensor (JS8746A) was placed also on the tree next to the fruit to measure the temperature of the environment (Figure 4). The system logging interval was adjusted to 15 min. After 24 h the next apple was measured for a total of 15 fruits. After the 24-h procedure each fruit was evaluated for its qualitative characteristics.

Results
Table 1 displays the temperature for every fixed condition (fixed temperature inside the fridges, room and furnaces described in Section 2.2) during the laboratory experiment, measured by the external temperature sensor, including the mean and standard deviations. The external sensor was placed 20 cm away from the fruit in all cases.
According to the scatterplot in Figure 5a the pairs of the measurements do not seem to deviate more than 0.5 units from the identity line. This is interpreted as minor differences among the core and surface temperatures especially for temperatures ranging from 9 °C to 19 °C. In Figure 5b the Bland-Altman and Limits of Agreement (LOA) plot is displayed [43][44][45], which were generated using the 'MethodCompare' package in R version 4.0.2 (The R Foundation for Statistical Computing, Vienna, Austria). The limits of agreement in the plot (blue dashed lines and a solid line for the regression) indicate that there is a positive bias of the measurement method for low temperature values and a negative bias for high values. The linear trend of the Bland-Altman plot indicates possible correlation between differences and averages, and difference in precision of the methods which is confirmed in the precision plot (Figure 6b). There were no outliers detected.

Results
Table 1 displays the temperature for every fixed condition (fixed temperature inside the fridges, room and furnaces described in Section 2.2) during the laboratory experiment, measured by the external temperature sensor, including the mean and standard deviations. The external sensor was placed 20 cm away from the fruit in all cases.
According to the scatterplot in Figure 5a the pairs of the measurements do not seem to deviate more than 0.5 units from the identity line. This is interpreted as minor differences among the core and surface temperatures especially for temperatures ranging from 9 • C to 19 • C. In Figure 5b the Bland-Altman and Limits of Agreement (LOA) plot is displayed [43][44][45], which were generated using the 'MethodCompare' package in R version 4.0.2 (The R Foundation for Statistical Computing, Vienna, Austria). The limits of agreement in the plot (blue dashed lines and a solid line for the regression) indicate that there is a positive bias of the measurement method for low temperature values and a negative bias for high values. The linear trend of the Bland-Altman plot indicates possible correlation between differences and averages, and difference in precision of the methods which is confirmed in the precision plot (Figure 6b). There were no outliers detected.
After the analysis, the results revealed a differential bias of 0.331 (95% CI: 0.299, 0.363) and a proportional bias of 0.982 (95% CI: 0.981, 0.983). The bias is positive for low values and negative for high values. Table 2 summarizes the biases with their corresponding 95% confidence intervals. The differential bias is a constant that the method adds to its measurements regardless of the true value being measured as per Choudhary [39]. The proportional bias is the amount of change observed by the method if the true value changes by one unit [43]. The Bland-Altman LOA plot on the other hand estimates a differential bias of 0.958 (95%CI: 0.658, 1.28) and a proportional bias of 0.976 (95%CI: 0.958, 0989) revealing the inadequacy of the specific method since it only assesses the variability of the differences but not each method separately.
The bias is displayed in Figure 6a and decreases as the true values increase until it reaches 0 at around 19 degrees of Celsius then increases at the opposite direction. Specifically, almost a zero bias was found around 19 • C, −0.2 • C at 30 • C and almost −0.4 • C at 40 • C. According to our results for a temperature of 40 • C in the core, the surface sensor will measure 39.612 (0.331 + 0.982*40), which gives a total bias of −0.4 • C compared to the core. The precision of each sensor is displayed in Figure 6b indicating that the core measurements are more precise than the surface temperatures revealing fluctuations of maximum 0.1 • C on absolute value when the surface temperature is measured and a constant difference of precision between the core and the surface of 0.2 • C with the core being more precise. This indicates that the core retains the temperature for more time than the surface much more in lower temperatures rather than in higher. After the analysis, the results revealed a differential bias of 0.331 (95% CI: 0.299, 0.363) and a proportional bias of 0.982 (95% CI: 0.981, 0.983). The bias is positive for low values and negative for high values. Table 2 summarizes the biases with their corresponding 95% confidence intervals. The differential bias is a constant that the method adds to its measurements regardless of the true value being measured as per Choudhary [39]. The proportional bias is the amount of change observed by the method if the true value changes by one unit [43]. The Bland-Altman LOA plot on the other hand estimates a differential bias of 0.958 (95%CI: 0.658, 1.28) and a proportional bias of 0.976 (95%CI: 0.958, 0989) revealing the inadequacy of the specific method since it only assesses the variability of the differences but not each method separately. After the analysis, the results revealed a differential bias of 0.331 (95% CI: 0.299, 0.363) and a proportional bias of 0.982 (95% CI: 0.981, 0.983). The bias is positive for low values and negative for high values. Table 2 summarizes the biases with their corresponding 95% confidence intervals. The differential bias is a constant that the method adds to its measurements regardless of the true value being measured as per Choudhary [39]. The proportional bias is the amount of change observed by the method if the true value changes by one unit [43]. The Bland-Altman LOA plot on the other hand estimates a differential bias of 0.958 (95%CI: 0.658, 1.28) and a proportional bias of 0.976 (95%CI: 0.958, 0989) revealing the inadequacy of the specific method since it only assesses the variability of the differences but not each method separately.

Discussion
The FruiTemp prototype was built to aid the needs of gathering data for the overwintering dynamics of medfly in marginal for its existence areas in the frameworks of the Horizon 2020 funded project FF-IPM. The system promotes the open-source community and inexpensive methods that can be adopted in other studies in entomology and agriculture. This project can be a guide for non-specialized researchers to build systems that can aid them on a wide range of similar experiments.
The proposed device has low cost, fine sensors, portability, energy efficiency and accuracy as assessed in laboratory conditions. A field experiment was further designed and implemented successfully. The proposed device combines all the characteristics that can be found in widely used commercial devices such as the Hobo Mx2303 [22] and the Hengko [21] which are much more expensive.
Agreement methods utilized were straightforward to implement and graphical tools makes it easier for an individual with basic statistical background to interpret the results.
Other upgrades and optimizations can be applied to increase the reliability, precision, and accuracy of the device. The method described by Liu [33] can be used to retrieve the coefficients for the Hoge-2 equation, to improve the calibration part. Since the thermistor curves provided from the manufacturer delivers a typical scenario of the sensors, an oil bath can be used to retrieve the Hoge-2 coefficients. In that case, the calibration can be applied for each individual thermistor.
Moreover, other parts can be added, such as a GSM module that directly sends the data retrieved on a fixed time interval, on a server. This addition will aid the researcher/individual as the remote access will notify for possible errors or will grant direct data access. Finally, if the device is established in an open field exposed to sunlight, a solar panel can be added, and power efficiency can be achieved for a longer period.
The FruitTemp prototype could be easily adapted to serve additional experimental needs in entomology and in ecology. Understanding insect phenology (seasonal occurrence), population growth and dynamics, as well as patterns of aging in the wild is still a major challenge in both applied ecology and entomology. Precise temperature recording in micro-habitats, such as a host fruit for medfly larvae, is of paramount importance for gaining insights regarding field biology of pikilotherms. The FruitTemp provides an inexpensive open-source system that can be used in a wide range of studies besides overwintering. The data generated from these kinds of experiment will feed population modeling with reliable data that increase the precision of the projection and assist the management activities often implemented against insect pests.
Future research involves a detailed assessment of temperature fluctuations in the core of the fruit given standard temperature external conditions and the study of different hosts.

Conclusions
Our device was successfully tested in the lab and field in a wide range of temperature settings. Quantitative assessment can be efficiently performed via methods based on statistical analysis of agreement that are implemented in open-source software. The results revealed a fixed bias of 0.331 and a proportional bias of 0.982 between the core and the surface temperature.
The field experiment that followed was designed and conducted for five consecutive days. The device confirmed its power efficiency during the five consecutive days of its function. Measurements were successfully logged, with the device having no failure in any of the 15-or 1-min intervals along the course of this study.
The device can be used in similar applications, e.g., other hosts, and in a wide variety of environmental conditions. Moreover, it promotes open-source, custom made solutions for conducting experiments with small cost allowing for relatively large sample sizes that can achieve the anticipated by design statistical power in formal hypothesis testing.
Last, it can be easily modified by researchers depending on their experimental needs. Any part can be replaced in case of malfunction, without affecting its performance.   Figure A1. The circuit sketch describes the connections among the electronic parts. For the sketch of the circuit, we used the open-source schematic maker Fritzing [51].   Figure A2. Calibration procedure.