NDIR Gas Sensor for Spatial Monitoring of Carbon Dioxide Concentrations in Naturally Ventilated Livestock Buildings

The tracer gas ratio method, using CO2 as natural tracer, has been suggested as a pragmatic option to measure emissions from naturally ventilated (NV) barns without the need to directly estimate the ventilation rate. The aim of this research was to assess the performance of a low-cost Non-Dispersive Infra-Red (NDIR) sensor for intensive spatial field monitoring of CO2 concentrations in a NV dairy cow house. This was achieved by comparing NDIR sensors with two commonly applied methods, a Photo-Acoustic Spectroscope (PAS) Gas Monitor and an Open-Path laser (OP-laser). First, calibrations for the NDIR sensors were obtained in the laboratory. Then, the NDIR sensors were placed in a dairy cow barn for comparison with the PAS and OP-laser methods. The main conclusions were: (a) in order to represent the overall barn CO2 concentration of the dairy cow barn, the number of NDIR sensors to be accounted for average concentration calculation was dependent on barn length and on barn area occupation; and (b) the NDIR CO2 sensors are suitable for multi-point monitoring of CO2 concentrations in NV livestock barns, being a feasible alternative for the PAS and the OP-laser methods to monitor single-point or averaged spatial CO2 concentrations in livestock barns.

livestock buildings, the use of a cheaper CO2 monitoring system, allowing for multi-point sampling, may result in similar levels of accuracy than using more accurate (and more expensive) methods.
In this paper, Non-Dispersive Infra-Red (NDIR) based sensors are suggested as an alternative for PAS and OP-laser to measure CO2 concentrations in NV buildings. In the studies of Piccot et al. [31] and Yasuda et al. [32], several different commercially available NDIR CO2 sensors were compared with a reference method in the laboratory, and concluded that concentrations measured with all sensors agreed well with that of the calibration gas. However, field performance of the selected NDIR technique is still meager in current literature.
The goal of this study was to assess the performance of a low-cost NDIR sensor for intensive spatial field monitoring of CO2 concentrations in a livestock building, as compared to the OP-laser and PAS methods. Specific objectives of this research were: (a) to test the NDIR sensor in the laboratory for linearity, variability between sensors and sensitivity to ambient static pressure and (b) to compare measurements from NDIR sensors with OP-laser and PAS methods in a NV dairy cow barn.

Material and Methods
In order to assess their feasibility for use in NV livestock barns, the NDIR sensors were first tested in the laboratory for linearity, variability between sensors and sensitivity to static pressure. Subsequently, the sensors were brought to the field for exposure to actual CO2 concentrations in a NV dairy cow barn, and compared with two other measuring devices: the PAS analyzer and the OP-laser. Bland-Altman charts were plotted to assess the agreement between the compared measurement techniques. A detailed description of the methods, experimental procedures and data analysis conducted to meet the objectives of this study is provided below.

NDIR CO2 Gas Sensor
It is a portable sensor (model SD-GAS-025, Sensor Data B. V., Rijswijk, The Netherlands), with measuring principle based on gas absorption of radiation at a known wavelength [33][34][35]. Its core part consists ( Figure 1) of a NDIR module which is comprised of an infrared source, a measuring chamber, a wavelength filter and an infrared detector (CO2 Engine ® K30, Delsbo, Sweden). Any CO2 molecules present inside of the measuring chamber will only absorb a specific wavelength of the light given off by the infrared source. The filter allows only the particular wavelength of 4.3 µm to pass through it. The light intensity that is received by the detector is then proportional to the number of given CO2 molecules inside the chamber and can be described through the Lambert-Beer's Law in Equation (1): where: I = light power intensity after absorption by CO2, measured at the detector (W·m −2 ); I0 = light power intensity at the source (W·m −2 ); k = absorption index of CO2 at 4.3 μm (dimensionless); l = length of the absorption path (cm); [CO2] = CO2 concentration to be measured (mol·dm −3 ). The NDIR sensors were connected to a datalogger system (CR1000, Campbell Scientific, Inc., Logan, UT, USA) located in a shelter placed outside the barn, each sensor was powered with a voltage of 1200 mV. For the laboratory comparisons, average concentrations of CO2 concentrations over periods of 5 min was used, while during field tests, CO2 concentrations were integrated over a 60 min period.

OP-Laser
This device (model GasFinderFC, Boreal Laser, Alberta, Canada) measures the average gaseous CO2 concentration in the air through a user set open path length. The OP-laser is composed of a single channel gas monitor, a fiber-optical cable (type SMF-28, mode diameter of 9 μm, single mode with FC/APC, 3 m long), a co-axial cable (Belden 9880, 3 m long), a remote head (model OP3) and a retro-reflector ( Figure 2). The OP-laser was set up to measure CO2 concentrations in the central axis or the barn (path length of 64 m), at approximately the same level as the NDIR sensors (3 m above the slatted floor). The remote retro-reflector (prism like mirror), made of aluminum and coated with a thin layer of gold (to ensure high reflectance and no tarnishing) was installed on the wall at the opposite side of the barn for reflection of the laser beam back to the source. The retro-reflector mirror was housed inside a sealed enclosure made out of polyethylene with a polycarbonate window.
The used OP-laser was sent to factory for maintenance within 12 months prior to the execution of the experiments. It holds a self-calibration check mechanism, which includes a reference calibration cell (crystal sphere containing CO2 at a known concentration, Figure 2); a portion of the laser beam generated by the laser diode is passed through the reference cell every minute to provide continuous update on calibration quality. The waveform of each path is first processed and then compared to determine the adsorption in the measurement path. The reference cell of known concentration is used to determine the adsorption of the other path. These curves (the standard reference and the sample waveforms) are then digitized and compared as two numeric arrays through the linear least squares regression analysis, from which a coefficient of determination (R 2 ) and the slope of the regression line are obtained. Any significant deviation generates a status code which alerts the user to a potential calibration problem. The CO2 concentration measured in the dairy cow house with the OP-laser was pre-analyzed and the plot of concentration versus the R 2 was made and presented in Figure 3. The plot was used to determine the sensitivity of the OP-laser to the gas concentration measurement at field conditions and a minimum threshold of R 2 = 0.80, as a measure for minimum measurement quality was applied to filter CO2 concentration data in this study.

PAS Analyzer
It is based on the photo-acoustic principle, where chopped IR light is converted into an acoustic signal measured by a highly sensitive microphone placed on the wall of the measurement chamber. Inside the PAS analyzer (model 1312, INNOVA AirTech Instruments A/S, Ballerup, Denmark), a sample of air is sealed in the measurement chamber; then, the chamber is irradiated with pulsed narrow-band IR light. The light absorbed by the gas sample present in the chamber, which is proportional to the gaseous concentration, is converted into heat. The light chopper causes the air sample to heat and cool down, while the temperature fluctuations generate a pressure wave signal, which is detected by the microphone, which is subsequently digitized and converted into gaseous concentration ( Figure 4). The PAS analyzers used in this study were set to measure CO2 with IR light filter (model UA0982, Air Tech Instruments), which only let pass through IR light with a center wave length of 14.1 µm ± 7.5%. The monitor was set to sample at an interval of 40 s plus 10 s for flushing, and a time integration interval of 5 min. Dew point temperature (Tdp) was also monitored by the PAS in order to account for cross-interference with moisture in the air. The PAS analyzers were sent to the manufacturer for certified calibration against CO2 and other gases along with crossed interference with water vapor within 6 to 12 months prior to the beginning of the trials, in order to make sure that deviation on concentration measurements was under the tolerance level of 5%. Some additional technical specifications of all CO2 measuring devices used in this study are presented in Table 1.

Laboratory Tests and Calibration of NDIR Sensors
Prior to their installation in the animal house, the NDIR sensors were tested in the laboratory for output linearity and sensitivity to static pressure. For the test of linearity, span gas at 1952 ppmv concentration of CO2 (certified concentration accuracy of ±20 ppmv) was diluted with zero gas (N2, certified purity of 99.999%) at the percentages of 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90% and 100% of the span gas, resulting in concentrations of 1952, 1757, 1562, 1366, 1171, 976, 781, 586, 390, 195 and 0 ppmv of CO2, respectively. The dilution was achieved with the aid of a precision gas divider (model 821, Signal Instruments Co., Camberley, UK), which operates by dividing the flow rates of the incoming gases down a chain of ten identical capillary tubes, in such a way that the dilution level will be the ratio between capillaries carrying span and zero gases. To avoid contamination of the gas mixture with other gases, after being produced by the gas divider, the mixture was immediately directed into the NDIR during the test of linearity through polytetrafluoroethylene (PTFF) tubing. One NDIR sensor was exposed to gas at each concentration, at a flow rate of 200 mL·min −1 . This flow rate value was used to apply into sensors an average static pressure to which they were usually exposed during field measurements. After stabilization of the sensor output (mV), a few readings were recorded. During the laboratory exposure trials, gaseous mixture static pressure and temperature at the entrance to the sensor remained approximately constant and equal to (1006 ± 1) hPa and (24 ± 1) °C, respectively.
For the static pressure sensitivity test, CO2 span gas at 1952 ppmv was passed through a NDIR sensor at the following relative pressures: 1.5, 4.5, 9.0, 15.0, 23.0 and 33.0 hPa. The relative pressure values (relative to room static pressure) were achieved in the laboratory by applying an overpressure inside a sealed protecting case where the sensor was housed. After full reading stabilization, sensor raw data was recorded for each static pressure level. Air temperature was kept approximately constant and equal to (24 ± 1) °C during the test. The sensitivity of the NDIR sensors to static pressure was calculated according to Equation (2): where: Ssp = sensitivity of the NDIR to change in static pressure (% of change in raw data per unit of pressure); Δraw = measured range of raw data (mV); Avgraw = average raw data value (mV); Δsp = measured range of pressure (hPa).
To account for sensor individual variability and to allow independent direct comparison with the reference calibration gases, a two-point calibration was developed in the laboratory for every NDIR sensor. Sensors were excited with a voltage of 1200 mV and exposed to calibration gases at 0 ppmv of CO2 (N2, certified purity of 99.999%) and 1952 ppmv (span, certified accuracy of ±20 ppmv) at a flow rate of 200 mL·min −1 . During exposure to each gas, sensors that presented drifted readings were adjusted. Sensor raw data was corrected for the reference static pressure of 1013.25 mbar and then correlated to the reference gas concentrations. This procedure was performed twice for every sensor: before the start of the field measurements, and at the end of the trials. The final calibration equation was obtained by using data from both calibration procedures, resulting in a single equation per sensor.
The response time of the NDIR sensors to span gas concentrations at the flow rate of 200 mL·min -1 took 15 to 30 s and was considered relatively small compared to the data retrieval rate used in practice of 5 min.

Description of the Livestock Barn
This study took place in a dairy cow barn ( Figure 5). The barn is located in the county Bunschoten, in the middle of the Netherlands, is east-west oriented, has a roof with 37% slope, and has dimensions of 64 m Length × 38 m Width × 4 m Heigth (L × W × H). The building envelope is composed of insulated roof and side walls, the lateral openings on both sides are 2.75 m high, protected with stainless steel screens with openings of 5 × 5 cm 2 and has manually operated curtains. In the eastern part of the building there is a deep litter area of 10 m L × 21 m W with maximum housing capacity of 30 dry and pregnant cows. In the central part of the building, 3 double-rows of cubicles (paper chips bedding; 42 m L × 21 m W) are located, with feeding alleys on both sides (north and south), and maximum housing capacity for 150 lactating cows. The last section of the barn is at the most western side, has an area of 13 m L × 21 m W with similar cubicles and bedding system as for the lactating cows, where the heifers are kept (maximum capacity of 40 heifers). Barn cubicles area had slatted walking alleys and an automatic scraping robot. Manure is stored in a deep pit space of 65 m L × 21 m W × 2 m Depth located under the slats and cubicles. Manure was removed from the barn twice a year, usually during early spring and fall seasons. The lactating cows had free access to three milking robot systems. All cows were kept inside year round and were fed with roughage (grass and corn silage) and concentrate. The data collection and validation trials in the barn were conducted during the summer season, in the months of June, July and August of 2012. A more detailed description of the experimental barn is provided by Mendes et al. [36].

Field Experimental Setup and Data Collection Procedure
Prior to each measurement campaign, the OP-laser was installed in the barn to sample the average CO2 concentration in an open-path of 64 m along the central axis of the barn (3 m from the slats, 19 m of distance from each side). For the comparison of NDIR sensors with the OP-laser, five sensors were placed in the central axis of the barn ( Figure 5). The central line of NDIR sensors was located at a height of 3 m above the slats, 19 m from both side walls. The distance between sensors being approximately 13 m, where the first and last sensors were 6 m away from front and back walls. Measurements with both NDIR sensors and OP-laser were taken for a minimum of 48 h per trial, with a total of six trials. To reduce the effect of sensor individual variability, five NDIR sensors were, in every trial, randomly selected from a set of 17 new sensors. Data sets from all trials were pooled together and hourly averaged data points were calculated prior to statistical analyses. For the comparison of the NDIR sensors with the PAS analyzer, three air sampling ports were installed to collect samples from three fixed different points inside the barn ( Figure 5). The PAS analyzers were placed inside the shelter located at the west part outside the building. The sampling lines consisted of PTFF tubes (0.63 cm internal diameter) with PTFF filters (4.7 cm diameter, 5 μm pore diameter) installed at the end. The air was drawn by the internal pump of the PAS analyzers, with a flow rate of 0.108 m 3 ·h −1 during measurements and 0.018 m 3 ·h −1 when flushing the measurement chamber. Each PAS analyzer was programmed to sample CO2 concentrations at every 40 s, with 10 s for flushing, and to store average values at every 5 min. Data was downloaded from the analyzers at the end of each measurement. During every trial, three NDIR sensors were installed at the same height and next to each of the PAS analyzers' sampling ports (within a maximum distance of 0.5 m) for simultaneous measurement of CO2 concentration. A total of three trials were performed, each lasting a minimum of 48 h. During each trial, the three used NDIR sensors were randomly selected from a pool of 17 new sensors, in order to take into account the effect of sensor individual variability. Data sets for all performed trials were pooled together prior to the statistical analyses, and hourly averaged values were calculated for each measuring device, for posterior analysis.

Analysis of Agreement between Laboratory and Field Comparison Methods
The agreement between CO2 concentration data from the NDIR sensors compared to the concentration data from the OP-laser and PAS analyzer was assessed by regressing the difference between CO2 concentrations (Diff[CO2]) determined with the NDIR method and OP-laser or PAS analyzer and the average CO2 concentration (Avg[CO2]). Results were compared by using the analysis of agreement of Altman and Bland [37] In Equation (3), the intercept (βo) and the slope (β1) represent homogeneous and heterogeneous systematic bias, respectively. A test of significance for each coefficient was carried on with procreg in SAS ® (Version 9.4, Cary, NC, USA) to assess whether βo and β1 were statistically different from zero.
The agreement between NDIR sensors and OP-laser was done by averaging out data from different number of NDIR sensors, i.e., 5, 3, 2 and 1 over a time integration interval of 1 h, and comparing with the path averaged concentration measured with the OP-laser. The analysis of agreement between NDIR sensors and PAS analyzers was done using data from both instruments collected at approximately the same point in the barn, also averaging data based on a time integration of 1 h.

Laboratory Tests with the NDIR Sensors
The results of the linear regression performed for NDIR sensor raw data against CO2 concentration is presented in Figure 6. The performed test of linearity indicates that when CO2 concentrations vary in the range of 0 to 1952 ppmv, the sensor had a nearly perfect linear response (p-value < 0.0001), with intercept and slope of (−11 ± 2) ppmv and (10.54 ± 0.02) ppmv·mV −1 . Such outcome is in agreement with the linear behavior found by Hodgkinson et al. [38] within the same range of CO2 concentration levels measured in this study. The analysis of sensitivity to static pressure yielded a Ssp value of 0.08% of the reading per each 1 hPa, over the tested range, which agrees to the specifications of the sensor factory of 0.1% [39].
Next to the tests of linearity and sensitivity to static pressure conducted with the NDIR sensors, individual calibration was performed in the laboratory and the results are presented in Table 2. When comparing the coefficients of calibration equations within the 17 sensors presented in Table 2, one notices that they present some variability between one another. For instance, when using the sensors to measure a typical CO2 concentration of 910 ppmv, the range of measurements with the different sensors was within 896 to 942 ppmv, resulting in an overall standard error of the mean from all 17 sensors of 4 ppmv, which corresponds to a variability between sensors of 5%.
The developed calibration equations presented in Table 2 were obtained by pooling together data from calibration procedures applied to the sensors twice in a period of three months. During this time frame, the drift in calibration coefficients observed in each individual sensor was estimated to be (0.4 ± 0.4)%, and thus rather negligible, although over longer times of sensor exposure, significant drifts from calibration might occur. However, effects of long exposure time on sensor calibration equations was not the purpose of this study, and might be a subject for further investigation on field application of NDIR sensors.

Analysis of Agreement of CO2 Data from NDIR Sensors against PAS and OP-Laser Data
A snapshot of CO2 concentration data measured at the dairy cow barn with the NDIR sensors, OPlaser and PAS analyzer is represented graphically in Figure 7. The results of the analysis of agreement between the CO2 concentrations measured in the field averaged out from different numbers of NDIR sensors and as compared to the OP-laser are presented in Figure 8. It can be seen that the points presented a more homogeneous distribution around the reference line of Diff[CO2] = 0 when data from five NDIR sensors were averaged out, while comparing the OP-laser with only three, two or one NDIR sensors presented a linear trend that drifted from the reference line. This outcome might have stemmed from the fact that fewer than five NDIR sensors will cause the mean CO2 concentration value to misrepresent the concentration measured by the OP-laser. From the five NDIR sensors, three were placed in the milking cows area (where most of the metabolic CO2 sources are), and the other two were each placed above the dry and young cows' areas; if less than three NDIR sensors are placed above the milking cows area, the prediction of the CO2 concentration from the OP-laser is poorer, as shown by the cases where three, two and one sensors are used. On the other hand, placing CO2 sensors above the milking cows area only is not enough to represent barn total CO2 concentration, as shown by the cases when data from two or one NDIR sensors in the milking cows area is paired with the data from OP-laser. In these cases, barn CO2 concentration is over-estimated as lactating cows produce and emit more CO2 than dry or young cows [13]. The 95% level significance test revealed that the term βo in Equation (3) was different from zeroand equaled to (60 ± 9) ppmv when averaging CO2 concentration data from 5 NDIR sensors, which was considered relatively small, given the magnitude of practical measurements for dairy cow barns (440 to 2000 ppmv). In fact, when applied in practice for CO2 mass balance experiments, this bias will be eliminated by using the same sensor for background measurements. A similar outcome was observed by Chagunda et al. [40] when comparing a NDIR device to a OP-laser analyzer for measurements of methane (CH4) concentrations from cattle. Those authors also observed that the NDIR method systematically overestimated the OP-laser method by 30 ppmv, and related the discrepancy to inherent distinct nature of the measurement devices. Chagunda et al. [40] added that although different methods resulted in concentrations that were distinct in absolute values, the trends in the measurements were similar.
The estimated value for β1 when averaging out data from five NDIR sensors was (−0.03 ± 0.01) ppmv·ppmv −1 , and was not significantly different from zero at the level of 95% confidence, indicating that a systematic proportional underestimation (or heterogeneous bias) of the CO2 concentrations measured in the dairy cow barn with five NDIR sensors was not present.
A Bland-Altman plot for CO2 concentrations determined with the NDIR sensors against CO2 concentrations determined with the PAS analyzers is presented in Figure 9. The majority of the data points are above the line of Diff[CO2] = 0, suggesting that the NDIR sensors tended to provide higher CO2 concentrations compared to the PAS analyzer. The significance test for βo in Equation (3) yielded to (−10 ± 3) ppmv, which is statistically different from zero, but considered negligible in practical situations.  Results of the significance test performed on the coefficient β1 in Equation (3) demonstrated that a systematic positive heterogeneous bias was present in the measurements of CO2 concentrations made with the NDIR sensors in relation to the PAS analyzers (0.132 ± 0.006) ppmv·ppmv −1 , or, 13.2%, and was significantly different from zero (p-value < 0.0001). A positive heterogeneous (or proportional) bias indicates that as the mean CO2 concentration in the dairy cow house became higher, the difference between concentrations measured with the NDIR sensors and PAS analyzers also enlarged. According to previous research studies, e.g., [23,41,42] PAS analyzers might be affected by cross interference between gaseous CO2 and water vapor, especially in livestock buildings where concentrations of CO2 and water vapor are usually correlated. Hence, an analysis of cross interference between CO2 concentration and water vapor in this study was conducted by plotting a chart with dew-point temperature (Tdp, °C) versus the difference in CO2 concentration measured with the NDIR sensors and the PAS analyzer ( Figure 10). Results indicate that increasing Tdp did not result in higher average values for the discrepancy between CO2 concentration measurements from NDIR and PAS; instead, the average discrepancy remained constant (71 ppmv), and thus could not be used to explain the positive homogenous systematic error observed in the comparison between PAS and NDIR sensors observed in this study. One source of heterogeneous overestimation of NDIR sensors, when compared to the PAS analyzers, might have stemmed from the sampling strategy used to compare both methods, by placing the NDIR sensors from an average distance of 0.5 m from the PAS analyzers. Although every effort was taken in order to make NDIR sensors capture the same concentration as the PAS analyzer, such a task is difficult to achieve given the inherent spatial variability of CO2 concentrations present in NV livestock barns, where large concentration gradients may be present even within small distances. The complexity in spatial variability of CO2 distribution in NV barns is well known [15], especially when measurements are made at close proximity to the CO2 emission sources (the animals), as demonstrated by Mendes et al. [36]. In addition, not only CO2, but other gases produced in livestock barns present high concentration gradients, such as ammonia (NH3) [16,43].

Conclusions
A NDIR sensor technology was tested for monitoring of CO2 in a NV dairy cow barn. Laboratory calibration, tests of linearity and sensitivity to static pressure were performed on the sensor. After being calibrated, NDIR sensors were exposed to CO2 concentrations in the livestock barn together with PAS analyzers and an OP-laser. An analysis of agreement between the concentrations measured with NDIR sensors and the methods of comparison was performed. The following conclusions can be drawn: (1) The tested NDIR sensor presents a small variability between sensors of 5%, and a sensitivity to static pressure of 0.08% of the reading per each 1 hPa; (2) In order to represent the overall CO2 concentration of the dairy cow barn, the number of NDIR sensors to be accounted for average concentration calculation is dependent on barn length and on barn area occupation.
(3) The NDIR CO2 sensors are suitable for multi-point monitoring of CO2 concentrations in NV livestock barns, and is a feasible alternative for the PAS and the OP-laser methods to monitor single-point or averaged spatial CO2 concentrations in livestock barns.