Evolution of NH3 Concentrations in Weaner Pig Buildings Based on Setpoint Temperature

Ammonia (NH3) concentration has seldom been used for environmental control of weaner buildings despite its impact on environment, animal welfare, and workers’ health. This paper aims to determine the effects of setpoint temperature (ST) on the daily evolution of NH3 concentration in the animal-occupied zone. An experimental test was conducted on a conventional farm, with ST between 23 ◦C and 26 ◦C. NH3 concentrations in the animal-occupied zone were dependent on ST insofar as ST controlled the operation of the ventilation system, which effectively removed NH3 from the building. The highest NH3 concentrations occurred at night and the lowest concentrations occurred during the daytime. Data were fitted to a sinusoidal model using the least squares setting (LSS) and fast Fourier transform (FFT), which provided R2 values between 0.71 and 0.93. FFT provided a better fit than LSS, with root mean square errors (RMSEs) between 0.09 ppm for an ST of 23 ◦C and 0.55 ppm for an ST of 25 ◦C. A decrease in ST caused a delay in the wave and a decrease in wave amplitude. The proposed equations can be used for modeling NH3 concentrations and implemented in conventional controllers for real-time environmental control of livestock buildings to improve animal welfare and productivity.


Introduction
Ammonia (NH 3 ) release in livestock buildings originates from the nitrogen content in the urine and feces deposited in pits or on the building floor surfaces with or without bedding material [1]. Currently, NH 3 , together with hydrogen sulfide (H 2 S) is one of the most critical pollutants for pig production [2][3][4] because of its direct relationship with animal and workers' welfare and health [3][4][5][6]. Accordingly, many authors have analyzed the effects of NH 3 concentration on animal behavior, health, and productivity [7][8][9][10][11][12][13][14]. Generally, the negative effects of NH 3 concentrations on the physiological state of pigs in terms of growth and health have been acknowledged, but no consistent experimental results have been obtained. Actually, whereas some authors have claimed that high NH 3 concentrations have physiological effects on pigs [10,13], other authors have not found a clear influence on hepatic gene expression [7] or pig growth performance [11,13].
In accordance with Directive 91/630/EEC, gas concentrations must be kept within limits that are not harmful to pigs through building insulation, ventilation, and heating. Yet, the directive does not temperature defined in climate control systems. By finding these patterns, NH 3 concentration can be incorporated in conventional control systems with temperature as the single input variable by applying a simple algorithm based on the variables used by the climate control system. As a result, environmental control systems will contribute to decreasing the environmental impact of livestock production [44] and improving animal welfare status [45] while maintaining productivity.
Our results add to the results reported in previous research on NH 3 concentrations and emissions in buildings for rearing various species and their influencing factors, which were aimed at determining pollution levels and designing NH 3 reduction strategies [46][47][48][49][50][51][52].

Experimental Test
The study was carried out on a conventional intensive pig farm with an authorized farm size of 4895 sows, where piglets were reared to a live weight of 20 kg in 2013. The farm is located in Abegondo, A Coruña, NW Spain (43 • 10 12" N, 8 • 19 30" W), where temperatures are mild and frost is unusual. In 2013, mean annual temperature was 13.20 • C, mean annual relative humidity was 86.67%, and there were 17 frost days, according to the public network of weather stations, Meteogalicia [53]. The experimental test was conducted in a weaning room, where piglets were reared from 6 to 20 kg live weight. The inside dimensions of the weaning room, with polypropylene slat floors, were 11.82 m in length by 5.86 m in width and 2.50 to 2.25 m in height ( Figure 1). The room contained six 2.53 m × 1.97 m pens on each side of a central aisle and housed 50 piglets per pen, up to a maximum of 300 piglets. The manure pit was empty at the beginning of the production cycle and manure was removed at the end of the cycle. All the variables were sampled at 1-s intervals and stored every 600 s. The sensors used to measure relative humidity ( RH ), NH3 concentration ( C ) and temperature in the animal-occupied zone (T ) were installed in a central pen at 0.40 m height inside a metal structure that protected the equipment against aggressions from animals ( Figure 1). The sensor used to measure air temperature at the corridor outside the room (T ) was installed in the air inlet at 2.40 m height ( Figure 1). Air temperature at the corridor outside the room (T ) and outdoor temperature (T ) were the variables used to characterize outdoor climate. Outdoor temperature data were provided by Meteogalicia public weather station network, particularly by Abegondo weather station (43°24′14″ N, 8°26′22″ W; elevation: 94 m).  In the experimental test, we used the climate control system of the farm, which was composed of a ventilation system and a hydronic radiant floor heating system. The environmental conditions of the Agronomy 2020, 10, 107 4 of 14 building were controlled by a temperature probe that did not alter the farm management. The ventilation system was composed of a 500 mm helical extractor fan with the following specifications: 230 V AC, 50 Hz, 1330 rpm, 480 W power, and cos ϕ = 0.96, 8746 m 3 h −1 . Fan minimum flow was 20% and acceleration was 3 • C. In addition, the fan incorporated a system to reduce the section of the air inlet duct, the diameter of which could be adjusted between 0.30 m and 0.50 m. The radiant floor heating system was composed of two 1.20 × 0.40 m polyester spreader plates for hot water, each with a capacity of 2.90 L. The temperatures of the heating fluid ranged from 37 • C to 41 • C. The flow rate of the heating fluid was adjusted manually on the dates on which setpoint temperature (ST) was changed for ventilation purposes. The ST defined for the environmental control was in the range of 26-23 • C ( Table 1) and decreased with the increase in animal age and weight. Fresh air entered the room through two 1.50 × 0.70 m windows with air deflectors installed on the wall opposite to the fan, at both sides of the entry room door. The environmental variables measured inside the building and the measurement sensors and dataloggers used were as follows:

Mathematical Analysis
• NH 3 concentration in the animal-occupied zone (C NH 3 ): ST-IAM IP66 electrochemical detector (Murco Ltd, Dublin, Ireland) with splash guard, 0-100 ppm detection range, 5% accuracy, temperature correction and auto-zero factory calibration before installation, implemented with a particulate filter made of wire cloth with 0.168 mm aperture width and 0.110 mm wire diameter.

•
Relative humidity (RH az ) and temperature (T az ) in the animal-occupied zone: temperature/relative humidity sensor, model S-THB-M008 sensor (Onset Computer Corporation, Bourne, MA, USA), with 40-75 • C temperature measurement range, ± 0.21 • C accuracy over the range 0-50 • C, and 0%-100% relative humidity range, and ± 2.50% accuracy from 10% to 90% RH. All the variables were sampled at 1-s intervals and stored every 600 s. The sensors used to measure relative humidity (RH az ), NH 3 concentration (C NH 3 ) and temperature in the animal-occupied zone (T az ) were installed in a central pen at 0.40 m height inside a metal structure that protected the equipment against aggressions from animals ( Figure 1). The sensor used to measure air temperature at the corridor outside the room (T ac ) was installed in the air inlet at 2.40 m height ( Figure 1). Air temperature at the corridor outside the room (T ac ) and outdoor temperature (T ao ) were the variables used to characterize outdoor climate. Outdoor temperature data were provided by Meteogalicia public weather station network, particularly by Abegondo weather station (43 • 24 14" N, 8 • 26 22" W; elevation: 94 m).

Mathematical Analysis
We estimated the average NH 3 concentration at each setpoint temperature every ten minutes, which provided an average daily evolution pattern that was fitted by least squares setting (LSS) using the following equation: where: C NH 3 : NH 3 concentration (ppm) A: amplitude (ppm) ω: angular frequency (rad min −1 ) ϕ: initial phase angle (rad) B: independent variable or vertical shift (ppm) To fit the series of values of NH 3 concentrations to Equation (1), we derived the characteristic values of A, ω, ϕ, and B from the following equations: where: C NH 3 MAX : maximum NH 3 concentration in the animal-occupied zone (ppm) C NH 3 MIN : minimum NH 3 concentration in the animal-occupied zone (ppm) T: period of the wave, 1440 min t 0 : time during which the wave takes the average value (min) B = C NH 3 AVE : daily average NH 3 concentration in the animal-occupied zone (ppm) Time, t 0 , was considered positive if the wave was advanced or negative if the wave was delayed. Initial time was obtained from experimental data, which was used to maximize the coefficient of determination R 2 for fitting data to the sine wave function.
The goodness of fit was defined by the coefficient of determination (R 2 ), the root mean square error (RMSE), and the standard deviation of the error (SDE), in ppm. The equations for RMSE and SDE can be written as: where: N: number of observations C NH 3 C : estimated NH 3 concentration (ppm) C NH 3 M : measured NH 3 concentration (ppm) In addition, fast Fourier transform (FFT) was used for harmonic analysis. Before applying the FFT, the additive time series was decomposed into the trend, seasonal, and random components. FFT was applied only to the seasonal component of the series, which provided a good representation of the average of the analyzed days. The trend component was determined by using a moving average and was then subtracted from the series. The seasonal part was computed by averaging for each time of the day over all days. Finally, the random component was the remaining part of the original time series.

Results
We analyzed the daily evolution of NH 3 concentrations in the animal-occupied zone of a weaner building where pigs were reared for 44 days, from 5.36 kg to 20.34 kg average live weight. Since thermal requirements during this phase are strict and changing, setpoint temperature was modified according to the usual production process. The days in which setpoint temperature was changed were not considered in the analysis insofar as two different temperatures were used during the same day to control the heating and ventilation systems.
The analyzed days were grouped according to setpoint temperature (Table 2). Overall, average NH 3 concentrations decreased with the decrease in setpoint temperature and ranged between 3.79 and 0.30 ppm for 26 and 23 • C, respectively. However, at a setpoint temperature of 25 • C, the average NH 3 concentration was 5.24 ppm. A sharp decrease in NH 3 concentrations was observed when setpoint temperature decreased from 25 to 24 • C. Such a decrease was caused by a change in setpoint temperature that was related to the increase in the ventilation rate. NH 3 concentrations were within the established limits [20][21][22][23]. Relative humidity and average NH 3 concentration showed an inverse behavior at all setpoint temperatures, which was fitted by the least squares method to a potential function (Figure 2).
We analyzed the daily evolution of NH3 concentrations in the animal-occupied zone of a weaner building where pigs were reared for 44 days, from 5.36 kg to 20.34 kg average live weight. Since thermal requirements during this phase are strict and changing, setpoint temperature was modified according to the usual production process. The days in which setpoint temperature was changed were not considered in the analysis insofar as two different temperatures were used during the same day to control the heating and ventilation systems.
The analyzed days were grouped according to setpoint temperature (Table 2). Overall, average NH3 concentrations decreased with the decrease in setpoint temperature and ranged between 3.79 and 0.30 ppm for 26 and 23 °C, respectively. However, at a setpoint temperature of 25 °C, the average NH3 concentration was 5.24 ppm. A sharp decrease in NH3 concentrations was observed when setpoint temperature decreased from 25 to 24 °C. Such a decrease was caused by a change in setpoint temperature that was related to the increase in the ventilation rate. NH3 concentrations were within the established limits [20][21][22][23]. Relative humidity and average NH3 concentration showed an inverse behavior at all setpoint temperatures, which was fitted by the least squares method to a potential function (Figure 2).  The daily evolution of NH 3 concentration (Figure 3) was fitted to a sine wave function by the least squares method and FFT method. In the fast Fourier transform, a decomposition of the additive time series (Figure 4) was performed, and only the seasonal component was considered. The FFT determined the amplitude (A), the initial phase angle (ϕ), and the average value (B) of the sine wave. Table 3 summarizes the values obtained at every setpoint temperature ( Figure 5). The daily evolution of NH3 concentration (Figure 3) was fitted to a sine wave function by the least squares method and FFT method. In the fast Fourier transform, a decomposition of the additive time series (Figure 4) was performed, and only the seasonal component was considered. The FFT determined the amplitude (A), the initial phase angle (φ), and the average value (B) of the sine wave. Table 3 summarizes the values obtained at every setpoint temperature ( Figure 5).        The amplitude of the sine wave function decreased with the decrease in setpoint temperature because of the lower NH3 levels. However, the values obtained at setpoint temperatures of 26 °C and 25 °C were almost identical, whereas amplitude decreased dramatically at lower setpoint temperatures. The LSS model showed a greater wave amplitude than the FFT model at all setpoint temperatures. Moreover, air temperature in the animal-occupied zone was higher than the setpoint temperature in all cases, with values above 1.50 °C ( Table 2).
The initial phase angle was positive for setpoint temperatures of 26 °C and 25 °C, and negative for 24 °C and 23 °C. For 26 °C and 25 °C, the initial NH3 concentration was higher than the average NH3 concentration by 19% and 22%, respectively. For setpoint temperatures of 24 °C and 23 °C, the initial concentrations were 15% and 34% lower than the average concentrations, respectively.
The statistics included in Table 4 show the goodness of fit of the sine wave pattern to the daily evolution of NH3 concentrations in weaner buildings based on setpoint temperature, using LSS and FFT.   The amplitude of the sine wave function decreased with the decrease in setpoint temperature because of the lower NH 3 levels. However, the values obtained at setpoint temperatures of 26 • C and 25 • C were almost identical, whereas amplitude decreased dramatically at lower setpoint temperatures. The LSS model showed a greater wave amplitude than the FFT model at all setpoint temperatures. Moreover, air temperature in the animal-occupied zone was higher than the setpoint temperature in all cases, with values above 1.50 • C ( Table 2).
The initial phase angle was positive for setpoint temperatures of 26 • C and 25 • C, and negative for 24 • C and 23 • C. For 26 • C and 25 • C, the initial NH 3 concentration was higher than the average Agronomy 2020, 10, 107 9 of 14 NH 3 concentration by 19% and 22%, respectively. For setpoint temperatures of 24 • C and 23 • C, the initial concentrations were 15% and 34% lower than the average concentrations, respectively.
The statistics included in Table 4 show the goodness of fit of the sine wave pattern to the daily evolution of NH 3 concentrations in weaner buildings based on setpoint temperature, using LSS and FFT. The goodness of fit of the data to a sinusoidal function was characterized by the coefficient of determination, R 2 , which showed reasonable values, in the range 0.71-0.93 at setpoint temperatures of 23 and 26 • C, respectively. R 2 values increased with ST, which suggest a better fit and greater variations for high NH 3 concentrations. These findings were supported by other statistics, such as the standard deviation of the error (SDE), which was in the range 0.70-0.09. As SDE and RMSE were identical, mean errors were null. The values of R 2 were almost identical in both methods, whereas SDE and RMSE values suggest a better estimation of NH 3 evolution by FFT.

Discussion
The air temperatures recommended for weaned piglets housed in pens with plastic slatted floors range between 30-32 • C for 5 kg live weight and 19-25 • C for 20 kg live weight [40,41]. Many authors [5,32,52] have related the effect of setpoint temperature on NH 3 concentration with the influence of setpoint temperature on ventilation and, consequently, on NH 3 extraction from the building. During approximately the first two weeks of weaning, which correspond to the critical period [39], the setpoint temperatures were 26 • C and 25 • C and ventilation was highly restricted by reducing the fan air inlet section due to the strict thermal requirements for pig growth and the sensitivity of weaners to air currents. The highest NH 3 concentrations occurred during this period. During the postcritical period, when regular food intake was already established [39], setpoint temperatures decreased to 24 and 23 • C, and ventilation restrictions were lower, which led to a substantial decrease in average NH 3 concentration, from 5.24 ppm (critical period) to 1.00 ppm (postcritical period) for setpoint temperatures of 25 • C and 24 • C, respectively, as shown in Table 2. In addition, air temperature in the animal-occupied zone (T az ) was always above setpoint temperature, with variations between 2.07 and 1.56 • C for setpoint temperatures of 26 and 23 • C, respectively, which shows the thermal inertia of the heating system. These findings suggest a better performance of the environmental control system at lower setpoint temperatures.
Since NH 3 density is lower than air density, NH 3 settled in the upper areas of the room and was easier to extract than other gases such as CO 2 , which concentrated in the lowest areas. Accordingly, NH 3 concentration patterns were strongly influenced by ventilation, which, in turn, was affected by setpoint temperatures, which were in the range 26-23 • C and decreased with the increase in animal age and weight.
Average NH 3 concentration and relative humidity showed an inverse behavior ( Figure 2). This is in agreement with Banhazi [38], who demonstrated that NH 3 levels are more closely related to evaporation levels than to ventilation rates and that evaporation levels are at the maximum at higher temperatures. However, the small margins of relative humidity in this study (57%-61%) and the sensor accuracy (± 2.50%) do not allow a strong relationship to be established between the relative relationship and the NH 3 concentration.
Many authors have reported higher measured NH 3 concentrations than the concentrations reported here due to factors such as animal age and weight [32,38,50], ventilation system [35], cleaning system [32], location, climate [34,38], or season of the year [35,38]. The values reported by other authors were above the values obtained during the last phase of our research, during which the conditions for pigs with a weight of approximately 20 kg came nearer to the conditions that are usual for finishing pigs, with NH 3 levels of 0.30 ± 0.48 ppm at 23 • C setpoint temperature.
The daily evolution of NH 3 concentrations observed in our research differs considerably from the pattern observed under laboratory conditions for finishing pigs in rooms ventilated with negative pressure systems [32]. Such differences may be due mainly to the use of dissimilar ventilation and cleaning systems. In the experimental test conducted, the forced ventilation system effectively removed NH 3 at midday, thus avoiding a trend of NH 3 concentration parallel to that of air temperature. In addition, daily manure removal abruptly affected the daily evolution of NH 3 concentration [32], which did not happen in our study.
The results of our experimental test suggest a sinusoidal response of the daily evolution of NH 3 concentration, which is in agreement with the results reported for rabbits [47]. Likewise, a sinusoidal response was found for daily NH 3 concentration, which was directly related to odor and pollutant emission from finishing pigs [31]. Saha et al. [50] incorporated the daily activity of pigs into the model as a sine wave equation to predict NH 3 emissions from dairy livestock with natural ventilation and found that including the sine and cosine of circular variables such as the hours of the day, days of the year, and wind direction improved the dynamic nature of the models used to predict NH 3 emissions. Similarly, clear sine patterns were found for the daily emission of NH 3 for broilers [48].
The daily evolution of NH 3 concentration in weaner buildings showed a similar pattern to the pattern obtained by Calvet et al. [47], with maximum values at night, when ventilation rates were minimum and minimum values during the day, when ventilation rates were maximum. Therefore, the sinusoidal response was strongly conditioned by the ventilation rates inside the building, which was controlled exclusively by indoor temperature. This pattern affected NH 3 emission, which followed the opposite trend to NH 3 concentration and increased with the increase in ventilation rates. As a result, NH 3 emission was higher during the daytime [48,50].
Overall, a decrease in setpoint temperature caused a decrease in the amplitude of the modeled sine wave function and a delay in the wave. However, we observed only a small difference in amplitude when fitting the model to temperatures of 26 • C and 25 • C, around 2.70 ppm. Yet, amplitude sharply decreased at lower setpoint temperatures (0.33 ppm at 23 • C), when higher ventilation rates are allowed because of the lower sensitivity of weaners to air currents. This is in agreement with high temperatures leading to considerable NH 3 emissions, which increase when combined with high pH levels in bedding material [54], although this not the case.
SDE was the main component of the error because the bias was null insofar as the mean of the experimental data coincided with the mean of the sinusoidal curve obtained in one period (1440 min). From among the two methods used, FFT showed a better sine fit than LSS, probably because the FFT used only the seasonal component of the series and neglected the trend component ( Figure 4). Figure 5 shows the better fit of FFT, confirmed by statistics.

Conclusions
The following conclusions can be drawn:

1.
NH 3 concentration in the animal-occupied zone varies with the temperature setpoint defined for the climate control system. At night, when air temperature is lower, the ventilation rate decreases, which causes an increase in NH 3 concentration. The increase in outdoor temperature during the daytime causes an increase in the ventilation rate and, consequently, in the rate of gas removal.

2.
The daily sine wave for NH 3 concentrations provides a reliable pattern at every setpoint temperature, with R 2 values between 0.93 and 0.71 for the two methods used, LSS and FFT.
The FFT method showed a better sine fit, with RMSE values below 0.55 ppm as compared to 0.70 ppm in the LSS method. This occurs because the trend component of the series is neglected and only the seasonal component is considered. With the decrease in setpoint temperature, the amplitude of the wave diminishes and, generally, the sine wave is delayed. These sine waves were obtained by using inexpensive electrochemical sensors that could be easily incorporated in livestock farms. Our results show that these sensors, if maintained properly, can accurately represent the daily evolution of NH 3 concentration.

3.
The use of sine wave equations to estimate NH 3 concentrations can be beneficial for farmers, insofar as sine wave equations provide a reliable pattern for real-time estimation of NH 3 concentration and can be included as a parameter in control strategies considering daytime. In addition, sine wave equations can be implemented in many conventional controllers because of their simplicity. Sine wave equations based on setpoint temperatures could be useful for real-time environmental control, which would substantially improve animal welfare.