Next Article in Journal
Advancements in Chemiresistive and Electrochemical Sensing Materials for Detecting Volatile Organic Compounds in Potato and Tomato Plants
Previous Article in Journal
Experimental and Numerical Study on Dynamic Porosity of the Flow Layer During the Paddy Grain Convective Drying Process
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Application of Internet of Things Technology for Ventilation and Environmental Control in Conventional Open-Air Pig Housing Systems in Thailand

by
Suphalerk Khaowdang
1,
Nopparat Suriyachai
1,
Saksit Imman
1,
Kowit Suwannahong
2,
Surachai Wongcharee
3 and
Torpong Kreetachat
1,*
1
School of Energy and Environment, University of Phayao, Phayao 56000, Thailand
2
Faculty of Public Health, Burapha University, Chonburi 20131, Thailand
3
Faculty of Engineering, Mahasarakham University, Mahasarakham 44150, Thailand
*
Author to whom correspondence should be addressed.
AgriEngineering 2025, 7(6), 165; https://doi.org/10.3390/agriengineering7060165
Submission received: 26 March 2025 / Revised: 7 May 2025 / Accepted: 21 May 2025 / Published: 23 May 2025

Abstract

:
This study examined the effectiveness of using Internet of Things (IoT) technology to control environmental conditions in open-air pig housing systems in Thailand. This experiment was conducted in three zones: Zone 1, with no environmental controls (natural ventilation); Zone 2, with ventilation fans but no water-spraying system; and Zone 3, equipped with both ventilation fans and a roof-mounted water-spraying system. Key parameters, such as ammonia (NH3), hydrogen sulfide (H2S), temperature, and relative humidity, were monitored all year round. Zone 1, with only natural ventilation, exhibited the highest levels of pollutants, with an average ammonia concentration of 7.1 ppm and hydrogen sulfide at 7.6 ppm. The temperature averaged 31.81 °C, and the relative humidity was 53.65%, creating unfavorable conditions for pig farming. Zone 2, featuring ventilation fans, showed improvements, with the average ammonia and hydrogen sulfide levels reduced to 3.75 ppm and 4.12 ppm, respectively, although the temperatures (29.35 °C) were still too high at times, and the relative humidity was 49.50%. Zone 3, incorporating both fans and a water-spraying system, demonstrated the most effective environmental control, achieving lower ammonia (3.0 ppm) and hydrogen sulfide (2.93 ppm) levels, with an average temperature of 28.85 °C and relative humidity of 47.15%. These results suggest that IoT technology, combined with adequate ventilation and cooling systems, significantly enhances environmental conditions, thereby promoting better pig health and growth.

1. Introduction

Small pig farms are prevalent in rural areas of Thailand, where most utilize a traditional open-air housing system (CONV system). These systems are characterized by open structures without side walls, causing the internal temperature, humidity, and ventilation to fluctuate in accordance with the external environmental conditions. During periods of hot weather, the temperature inside these pig houses rises, exacerbating the stress on the animals. Additionally, these farms frequently encounter sanitation challenges, which contribute to environmental pollution and pose significant health risks [1].
To mitigate the effects of high temperatures, many farms have adopted basic measures, such as installing fans or water-spraying systems [2,3]. Although basic cooling methods offer some heat relief, data on their effectiveness in controlling environmental pollutants on pig farms, particularly under seasonal weather variations, remain limited. Unlike commercial farms with advanced cooling systems, small-scale farms often cannot afford such technologies, which results in higher production costs and increased pork prices. As a result, small pig farms remain reliant on less sophisticated, cost-effective solutions, despite their potentially limited efficacy in addressing pollution and maintaining optimal environmental conditions [4].
Several studies have been conducted to develop technological solutions suitable for Thailand’s agricultural context, focusing on managing pollution within farms, enhancing productivity, and increasing the income of small-scale food producers [5,6,7]. In response, the Thai government has accelerated its initiatives to achieve these objectives while promoting agricultural development in alignment with the United Nations Sustainable Development Goals (SDGs). These efforts are particularly focused on Goal 2, especially on Targets 2.3. and 2.4. These practices aim to increase productivity and production while maintaining ecosystems, adapting to climate change, and managing extreme weather events, such as droughts and floods [8,9].
Environmental issues on pig farms are critical as temperature and humidity directly impact pigs’ health [10]. Naturally ventilated pig housing often results in the accumulation of toxic gases produced from excretion, feeding, and maintenance activities [11]. Pollution within these environments is primarily generated through microbial fermentation processes, which release harmful gases and byproducts that can negatively affect animal welfare and growth rates. The main pollutants include carbon dioxide (CO2), ammonia (NH3), and hydrogen sulfide (H2S), as well as particulates and microbial byproducts [12]. Pigs exposed to such unsuitable environmental conditions tend to eat less, have lower feed conversion efficiency, and exhibit elevated cortisol levels [13]. Additionally, pigs in polluted environments often show less activity and may become more aggressive, displaying behaviors such as cannibalism due to discomfort [14]. Table 1 outlines the pollutants impacting animal health [15].

1.1. Ammonia

To help reduce the impact on both animal health and farmer well-being, the ammonia (NH3) level in animal housing should be kept as low as possible. Different countries have established varying standards. According to the European Union regulation (Commission Directive 2000/39/EC), the maximum permissible NH3 concentration is 20 ppm for long-term exposure (8 h) and 50 ppm for short-term exposure (15 min), which is the highest acceptable level for long-term exposure [16,17]. In many countries, the acceptable concentration limit for ammonia on pig farms is 25 ppm; however, current recommended exposure standards range from 7 to 25 ppm, depending on the country and the duration of exposure, whether it be short-term, 15 min, or throughout a workday of 8–10 h [15,18,19].
Several studies have focused on understanding whether pigs can differentiate between polluted and cleaner environments, but these studies often have limitations in the pollutant concentrations used. For example, in Drummond’s study [20], NH3 concentrations of 50, 100, and 150 ppm were tested, but these levels do not reflect natural farm conditions. De Boer and Morrison [21] found that the ammonia concentration on typical pig farms generally ranges from 1 to 30 ppm.
A study found that pigs have varying tolerance to airborne ammonia at different concentrations, and their choice of resting area is influenced by social hierarchy [22]. The initial limit of 5–10 ppm was chosen because it is non-toxic to the animals. However, according to Jones’s study [23], exposure to 10 ppm of ammonia can cause discomfort in both pigs and humans, leading to respiratory and eye issues depending on concentration and duration. Ammonia is particularly hazardous to young pigs, while adults tend to be more resistant [15]. According to Gustafsson et al. [24], high concentrations of NH3 significantly impact animal growth, as they lead to reduced feed intake and nutrient utilization efficiency. This may be due to changes in gut integrity, including alterations in gut morphology, intestinal bacterial flora, metabolites, and gene networks [25]. However, with prolonged exposure to ammonia, a compensatory response has been observed: While feed intake decreases, the efficiency of converting feed into energy increases [26]. This may indicate that animals are adapting to the more challenging environment, which could be a sign of potentially compromised animal welfare.

1.2. Hydrogen Sulfide

Hydrogen sulfide (H2S) can be highly hazardous. It may cause inflammation of the respiratory system, irritation of mucous membranes, reduced appetite, and paralysis of the diaphragm and can be fatal at high concentrations. The central nervous system is the target organ; hence, following acute exposure, animals may exhibit symptoms of unconsciousness and respiratory failure [15,27]. In ClassyFarm [28], H2S is not classified as a toxic gas because it is produced from the anaerobic decomposition of waste and binds with water. The highest release occurs during the agitation of manure storage systems [29,30].
Poisoning and death are often associated with proximity to manure storage tanks, which release high concentrations of H2S into the air. In pig barns, H2S concentrations are typically below detectable levels (approximately 1 ppm) but can rise rapidly if manure management is not conducted correctly, especially in facilities with deep-pit floors. Hydrogen sulfide is a highly toxic gas, and fatal accidents have been reported on many livestock farms. However, studies on the effects of various factors on H2S concentrations on pig farms are still limited, and the risks associated with high concentrations of H2S have not been fully assessed to date [31]. H2S produced by manure decomposition and sulfate-reducing bacteria is considered one of the most dangerous gases in livestock facilities and is second only to cyanide in toxicity. It has caused fatal accidents and is commonly released during manure collection and storage on pig farms, particularly near barns and liquid manure pits [22,26]. In Thailand and many other countries, there are no fixed standard values for hydrogen sulfide in pig barns. Air quality is generally managed through recommended guidelines. In this study, the acceptable H2S range was based on modified Veterinary Science Committee recommendations of 0.5 to 5 ppm [14].

1.3. Temperature

Changes in extreme temperatures, an increased frequency of disease, and higher mortality rates due to reduced immunity or increased pathogen pressure can negatively affect pigs’ reproduction and production quality [32] through impacts such as weight gain and feed conversion efficiency. Pigs are sensitive to heat and adapt their behavior by lying on their sides, avoiding close contact, seeking better air circulation, and reducing activity. In hot weather, they consume less feed but more water and may use water or excreta to cool down. Temperatures above 32 °C can impair reproduction in breeding pigs and reduce feed intake and milk production in lactating sows [33].
In general, when raising pigs in confined spaces, various factors must be considered to achieve optimal environmental parameters. Microclimatic parameters (temperature, relative humidity, and air speed) are key components of the indoor environment, with temperature being the easiest parameter to control. The ClassyFarm system has established the appropriate temperature ranges for raising pigs based on the animals’ weight (as shown in Table 2) [34].

1.4. Humidity

The optimal relative humidity range is between 50% and 75%. Low humidity can lead to respiratory issues by dehydrating the mucous membranes and increasing dust levels in the environment. Conversely, high humidity can be particularly hazardous, especially when combined with extreme temperatures, as it can cause the body to lose heat and make temperature regulation more challenging. Additionally, low humidity contributes to energy loss and further increases dust accumulation in the environment [35]. During winter, relative humidity is the primary indicator of adequate ventilation [18,29,30]. Air humidity is crucial for the growth and health of pigs. If the relative humidity exceeds 70%, water vapor in the air will condense into droplets, causing the pen floor to become damp and promoting the growth of pathogens, which can lead to respiratory diseases, foot-and-mouth disease, and parasitic infections. However, if the relative humidity is below 50%, it can increase the spread of dust, pathogens, and viruses from outside the housing into the pen. Therefore, maintaining an appropriate environment promotes better growth in pigs and helps reduce illness rates. Moreover, proper pig housing can reduce the space required per pig by 30–40% compared to pigs raised in hot environments. The appropriate environment for pig growth at different ages is shown in Table 3 [14].
The development of the Internet of Things (IoT) and Big Data technologies has driven Machine Learning (ML) to become increasingly attractive and highly effective for real-time indoor air quality monitoring. IoT devices in air quality monitoring enable the easy and rapid control and tracking of air quality. Many air quality monitoring systems and IoT devices have been designed and developed [36]. As global demand for animal products rises, the challenge is to improve livestock efficiency while ensuring animal welfare and sustainability. This also opens opportunities to transform traditional farming through advanced technologies like IoT and AI [37,38].
The application of IoT in controlling ventilation rates is therefore a critical factor for the welfare of animals on farms. For instance, humidity levels and the concentration of hazardous gases are adjusted according to ventilation. High humidity resulting from insufficient ventilation can lead to the accumulation of toxic gases, which may cause diseases that increase animal mortality rates [39,40,41]. Recent research indicates a continuous increase in the adoption of IoT technology in the livestock sector, with a focus on monitoring environmental conditions and animal health to enhance efficiency, reduce costs, and improve animal welfare [42]. Examples of applications include air quality monitoring systems in livestock housing, real-time temperature and humidity tracking systems, and wearable devices for early detection of illnesses. Additionally, these systems can be connected to cloud platforms for data analysis, enabling more efficient farm management [43]. Provolo et al. [44] developed a low-cost, battery-powered IoT device that effectively monitors environmental conditions in livestock housing, supporting animal welfare and long-term environmental management. The study concluded that the device is suitable for on-farm use to enhance animal welfare and support efficient long-term environmental management. The study by Oliveira et al. [45] developed a low-cost embedded system for real-time monitoring of the temperature and humidity in animal housing, achieving a 94.04% data transmission success rate, with RMSE values of 0.26–2.46 °C for temperature and 4.37–16.20% for humidity; after calibration, the system achieved high accuracy with R2 > 0.98, making it suitable for small- to medium-scale farms in developing countries.
In 2019, Carnegie Mellon University researchers developed a vibration sensor system for Thai pig farms to monitor movement and detect illness. Installed beneath pig pens, it identifies abnormal behaviors, enabling targeted antibiotic use and improving farm management without disturbing the animals [5]. Sittakul et al. [6] applied LoRaWAN technology to develop a smart pig farm with sensors for temperature, humidity, power, and pig weight measurement via cameras. The system accurately displayed data online, with a weight measurement error of ±1.86 kg. This technology can enhance future pig farming efficiency. Sena and Kaiwman [7] utilized IoT to automate environmental control and feeding in a Thai experimental farm. An ESP8266 module with a DHT11 sensor regulated temperature, activating heating lights below 24 °C and fans above 35 °C. The system maintained an average temperature of 28 °C and 92% humidity, improving farm efficiency and reducing workload. Mahfuz et al. [46] found that IoT technologies, such as RFID, computer vision, acoustic analysis, and environmental sensors, enhance swine farm management by improving health monitoring, reducing mortality, and boosting productivity, though challenges remain in cost, complexity, and data security. The study by Arulmozhi et al. [47] developed a Wi-Fi-enabled IoT system using Raspberry Pi and low-cost sensors to monitor 11 environmental variables in pig housing; it showed stable performance with a PM2.5 average of 34.34 µg/m3, but issues with sensor accuracy and durability persist. Integration with automated fan systems is suggested for further improvement.
This research aimed to install an IoT sensor system to monitor and control three different types of environments to study the year-round variations in pollution within pig housing in a rural area of Phayao province (north of Thailand). Therefore, this research focused on the application of the IoT in rural areas where users have limited knowledge of the Internet of Things. The IoT is transforming rural areas by enhancing agriculture. However, limited digital literacy, poor infrastructure, high costs, and language barriers hinder its adoption. Many rural users struggle to understand and operate IoT systems, making user-friendly interfaces, localized content, and training programs essential. The environments studied included Zone 1: natural ventilation (without exhaust fans and without roof water spraying), Zone 2: equipped with a ventilation system but without roof water spraying, and Zone 3: equipped with a ventilation system and roof water spraying. The overall environment of these three experimental conditions was then analyzed.

2. Materials and Methods

2.1. Study Area and Environmental Control

This field measurement was conducted from 1 January 2023 to 31 December 2023 at a commercial pig farm in rural northern Thailand. The pig housing facility measures 40 m × 100 m × 4.5 m (height to the roofline) and has a gable roof structure. The facility is divided into four zones: one breeding zone and three zones designated for fattening pigs for commercial sale. The sides of the housing are open to allow natural ventilation. The facility houses a total of 150 Duroc pigs. The pig housing has natural ventilation, and pig manure is removed and cleaned daily (between 6:00 AM and 7:00 AM). The average temperature and relative humidity inside the pig housing are 28.0 °C and 58.0%, respectively.
For environmental control, the study area was divided into three zones for fattening pigs. Zone 1 was set up without fans or water-spraying systems (natural ventilation only). Zone 2 was equipped with ventilation fans to expedite the removal of pollutants within the housing, with the fans operating 24 h a day. Zone 3 was also equipped with ventilation fans to expedite pollutant removal, with the fans running 24 h a day, similar to Zone 2, but had additional periodic roof water spraying to reduce the temperature during the day and alleviate heat stress in the pigs (scheduled to operate from 10:00 AM to 2:00 PM). The installed water-spraying system activates when the air temperature exceeds 25 °C, particularly during the hot months from February to April. The environmental conditions in Zones 2 and 3 are managed using an IoT system, with sensors installed in the center of the pig housing to monitor general parameters (temperature, humidity) and gases (NH3 and H2S).

2.2. Environmental Measurement Parameters

Pollution levels on pig farms within the European Union [29] have established guidelines for air quality in livestock farms, stating that “air circulation, dust levels, temperature, relative humidity, and gas concentrations should remain within safe limits for the animals.” However, the exact limits are not specified. Nonetheless, the Scientific Veterinary Committee set maximum limits as indicated by the ClassyFarm guidelines shown in Table 3.

2.3. Measurement Equipment

The IoT sensor monitoring network used in this study provides continuous data collection throughout the year, as depicted in Figure 1. The network is structured into three layers: the perception layer, the transport layer, and the application layer. In the perception layer, sensors detect key environmental parameters, such as NH3, H2S, temperature, and relative humidity (%RH), within the pig housing. The specific types and specifications of each sensor are listed in Table 4. These sensors are integrated into a microcontroller unit (MCU) to facilitate the real-time detection of gas concentrations and environmental conditions.
Figure 2 illustrates the research environment and the installation of the system in this study. An Internet of Things (IoT) system was installed in the pig house to regulate the environment and ensure optimal conditions for pig farming. The system consists of a controller for processing and managing connected devices, a sensor box for monitoring environmental parameters, ventilation fans to reduce temperature, and a spraying system that operates in conjunction with a water pump to regulate humidity and provide cooling. Sensor data are transmitted via wired connections to the NB-IoT system and displayed on an IoT platform using a Wi-Fi router for real-time analysis and control. The system is installed in different zones, as illustrated in the schematic, allowing efficient environmental regulation within the pig house. For air quality monitoring, temperature, humidity, NH3, and H2S sensors were installed at the front and rear sections of the pig house inside sensor boxes, which were designed with probe extensions to minimize the effects of moisture and dust. The sensor boxes are mounted on beams beneath the gable roof and connected via wired connections to the NB-IoT system. The installation locations were selected based on areas with a high likelihood of gas accumulation to ensure accurate data collection. This information is then utilized to optimize the environmental conditions within the pig house, enhancing the efficiency of pig farming operations.
The transport and application layers handle the transmission and management of these data. The collected sensor data are uploaded to an IoT platform (Things Board) via the Internet, where it is stored in a centralized database. The platform also displays real-time operational statuses of the sensors, indicating whether they are online or offline. Additionally, time-series data for each parameter are accessible on the platform, enabling users to continuously monitor sensor performance and data accuracy. This system allows for effective and ongoing environmental management in pig housing through the continuous monitoring of critical environmental factors.
During the measurement process, the concentrations of various parameters (NH3 concentration, H2S concentration, temperature, and %RH) were sampled at each point every minute, and the data were uploaded to the platform every 20 min. During the experiment, all devices, especially particulate matter sensors, were cleaned every two weeks and replaced with new sensors if any degradation in functionality was detected.
The researchers then retrieved the measured values from the service provider’s platform, recorded them, and calculated the weekly averages over the entire experimental period from January to December, covering 48 weeks. The measured values were analyzed to assess the effectiveness of the IoT system and environmental control within the three studied zones of the farm. In addition, the Pearson correlation coefficient (r) was applied to evaluate the relationship between NH3 and H2S concentrations across different zones of the pig housing [48].
The concentrations of NH3 and H2S in different zones of a pig housing system were analyzed using the Pearson correlation coefficient (r) and various statistical tests to assess relationships and differences across zones. The Pearson correlation coefficient, ranging from −1 to 1, was applied to evaluate the linear relationship between the two gases. A value of r = 1 indicates a perfect positive correlation, while r values between 0.7 and 1 indicate a strong positive correlation, 0.4 to 0.7 is a moderate positive correlation, 0.1 to 0.4 is a weak positive correlation, and r = 0 suggests no linear correlation. To compare the concentrations of NH3 and H2S across the three zones, a one-way analysis of variance (ANOVA) was initially used. However, since some data did not meet the assumption of normal distribution, as confirmed by the unequal variances, the non-parametric Kruskal–Wallis H test was employed to validate the results. This test revealed statistically significant differences in the median concentrations of both gases among the zones (p < 0.05). To further explore which zones differed, Dunn’s post-hoc test with Bonferroni correction was conducted. The results indicated that Zone 1 had significantly higher concentrations of both NH3 and H2S compared to Zones 2 and 3. Additionally, Spearman’s rank correlation analysis revealed a strong positive relationship between NH3 and H2S in Zone 1 (ρ = 0.91), with slightly lower correlations in Zones 2 (ρ = 0.89) and 3 (ρ = 0.69). These variations are likely attributed to differences in ventilation efficiency across the zones. These findings underscore the impact of ventilation on gas accumulation and highlight the need for targeted mitigation strategies in poorly ventilated zones. All analyses were conducted using SPSS (version 30 free trial) software, with a significance level set at p < 0.05.

3. Results

3.1. Ammonia

The ammonia levels in the air on pig farms in Thailand tend to increase during the hot and dry seasons (approximately from March to May), when temperatures are high, humidity is low, and farm ventilation is inadequate. Additionally, during the dry season, when there is little rainfall, the low humidity in the air means that ammonia is not washed out by rain and can accumulate in the air within the farm more than during the rainy season. Therefore, Thailand’s hot and dry seasons typically see higher ammonia levels in the air on pig farms than in other seasons.
The analysis of the average ammonia levels across different zones throughout the year (Figure 3) reveals trends and fluctuations in ammonia concentrations observed each month. The data measured from each zone provide a clearer understanding of the factors that may influence ammonia levels on pig farms.
The analysis revealed significant differences in NH3 levels across the three zones. Zone 1, which lacked a ventilation system, recorded the highest ammonia concentrations, ranging from 4.3 to 9.9 ppm due to poor air circulation, resulting in ammonia buildup. In contrast, Zone 2, equipped with a ventilation fan, had lower ammonia levels, ranging from 2.2 to 5.3 ppm. Zone 3, which combined ventilation with roof water spraying, had the lowest ammonia levels, ranging from 1.2 to 4.8 ppm. These results demonstrate that improved environmental management can substantially reduce ammonia levels in pig housing.
The results of the analysis of ammonia levels across Zones 1, 2, and 3 underscore the critical role of environmental management in mitigating ammonia emissions within pig farming operations. Zone 1 exhibited the most significant fluctuations in ammonia concentrations, likely driven by elevated temperatures and suboptimal ventilation, posing a potential risk for exceeding permissible thresholds in the future. In contrast, Zone 2 demonstrated greater stability in ammonia levels, suggesting more efficient waste and ventilation management. Zone 3, with the lowest and most stable ammonia concentrations, reflects superior environmental controls and underscores the efficacy of comprehensive ventilation strategies.

3.2. Hydrogen Sulfide

The results of the average H2S measurements in pig housing (Figure 4), divided into three zones under Thailand’s hot and humid climate, highlight the importance of ventilation systems in controlling indoor air quality. This is particularly evident when comparing zones without ventilation systems to those with ventilation systems.
Similarly, H2S levels varied across zones. Zone 1 had the highest H2S levels, ranging from 3.82 to 10.47 ppm due to the absence of ventilation, which allowed decomposition gases to accumulate. In Zones 2 and 3, H2S levels were reduced to 1.98 to 6.25 ppm and 1.14 to 4.73 ppm, respectively. This indicates that ventilation systems, particularly when combined with water spraying, effectively lower H2S concentrations in the air.
The findings of this study underscore the critical importance of proper ventilation systems in managing hydrogen sulfide emissions within pig housing. Efficient ventilation plays a crucial role in removing harmful gases produced by anaerobic decomposition, maintaining lower concentrations of H2S, and improving overall environmental quality. This is particularly vital in hot and humid climates, such as that of Thailand, where the natural tendency for gas accumulation is higher. The data also point to the necessity of incorporating adaptive environmental control strategies, especially during the warmer months, to prevent hazardous gas build-up and ensure the health and well-being of the pigs and workers.
Figure 5 presents the results of the experiment conducted to investigate the impact of installing ventilation systems on the levels of NH3 and H2S, common chemicals found in this type of facility. The experimental results demonstrated that Zone 1, which lacked a ventilation system, had significantly higher concentrations of NH3 and H2S. This was due to the accumulation of waste and insufficient air circulation, leading to the buildup of these chemicals in the air, which could pose health risks to the pigs and the workers.
In Figure 5a, the experimental results show that Zone 1, lacking a ventilation system, had significantly higher concentrations of NH3 and H2S, with a strong correlation of 0.91, indicating gas accumulation due to poor air circulation. This poses serious respiratory health risks for both pigs and workers. In contrast, Zones 2 and 3, equipped with automatic ventilation fans, showed significantly lower gas concentrations. Zone 2 had a correlation of 0.89, while Zone 3 showed a lower correlation of 0.69, suggesting more effective ventilation. Overall, proper ventilation in Zones 2 and 3 improved air quality, reducing harmful chemical exposure and promoting healthier conditions for pigs.
This experiment found that ventilation systems are crucial in controlling the potentially harmful chemicals in pig housing. Notably, in the zones with ventilation systems, the concentrations of NH3 and H2S were significantly reduced, creating a better and safer environment for animals and humans. The proper management of ventilation systems is essential for improving air quality in housing units and should be considered in the design and management of future pig farms. This aligns with numerous studies on the effects of these gases on animal health, including recent research reviews [24,29,30,49]. Evidence has shown that high concentrations of harmful gases typically occur in housing systems with inadequate ventilation and high temperatures. In contrast, open environments with higher air circulation do not present such issues.
As shown in Figure 5b, Zones 1 and 2 exhibit a strong positive correlation (r > 0.85, 0.7 ≤ r < 1: strong positive correlation), meaning that as NH3 levels rise, H2S levels also increase significantly, likely due to similar environmental factors such as poor ventilation or common non-water spraying system sources. However, Zone 3 shows a moderate-to-strong correlation (r ≈ 0.69, 0.4 ≤ r < 0.7: moderate positive correlation), suggesting that while NH3 and H2S still increase together, the relationship is less pronounced, possibly due to better environmental controls like ventilation systems reducing gas accumulation such as ventilation fans and a water spraying system on the roof.
Figure 5c and Table 5 illustrate a comparative analysis of NH3 and H2S concentrations across the three monitored zones using the Kruskal–Wallis test. The results revealed statistically significant differences in gas concentrations among zones, with test statistics of H = 102.15 for NH3 and H = 88.67 for H2S and extremely low p-values (p < 7.0 × 10−23 and p < 5.5 × 10−20, respectively), indicating that at least one zone differs significantly from the others. This non-parametric test was appropriate due to its robustness against non-normal data distributions.
To determine which specific zones differed, Dunn’s post-hoc test with Bonferroni correction was applied. The results showed that Zone 1 had significantly higher concentrations of both NH3 and H2S compared to Zones 2 and 3, confirming more intense gas accumulation in that zone. Zone 2 also had higher levels than Zone 3, though to a lesser extent. These statistical findings are visually supported by the boxplots in Figure 5c, which clearly depict variations in medians and data ranges across zones.
The analysis confirms significant spatial variation in gas concentrations, likely influenced by differences in ventilation, emission sources, or environmental conditions. Given its consistently elevated levels, Zone 1 should be prioritized for ventilation improvements or further investigation to mitigate potential health risks.
The analysis results are consistent with the study [50], which employed Pearson’s correlation coefficient to assess the relationship between ventilation and pollution in pig farms. Their study found that the concentrations of NH3 and H2S were significantly correlated with the ventilation rate. In particular, the NH3 emission rate exhibited a moderate positive correlation with the ventilation rate, indicating that as ventilation increased, the NH3 emission rate also tended to rise.
Furthermore, studies [1,48] have emphasized the relationship between NH3 emissions and ventilation in pig housing. They utilized Pearson’s correlation analysis to identify factors influencing the accumulation of NH3, a major air pollutant in pig farms. The findings highlight the importance of improving ventilation systems and controlling environmental conditions in pig housing as key strategies for reducing air pollution.

3.3. Temperature

Raising pigs in housing facilities requires careful control of the environment, particularly temperature, as it directly impacts the health and growth of the pigs. This experiment focuses on studying the effects of temperature control within pig housing using IoT systems to manage various devices in each facility zone, which are managed differently.
This study provides valuable insights into the temperature dynamics within three distinct pig housing zones, each characterized by different environmental control strategies (Figure 6). Zone 1, which lacked both ventilation and a roof-mounted water-spraying system, recorded an average indoor temperature of approximately 31.81 °C. This elevated temperature is attributed to solar heat gain and insufficient ventilation, particularly during the sweltering summer months in Thailand.
In contrast, Zone 2 incorporated a ventilation system without a roof-mounted water-spraying system, resulting in an average indoor temperature of approximately 29.35 °C. While the ventilation system provided some alleviation from the heat, it was inadequate to fully mitigate the temperature increase caused by direct sunlight on the roof, especially during peak summer conditions. Although there was a reduction in temperature compared to Zone 1, the environmental conditions in Zone 2 remained suboptimal for pig housing. This finding indicates that, while ventilation is beneficial, it alone may not suffice in ensuring a comfortable environment for pigs under extreme heat conditions.
Zone 3, which featured both a ventilation system and a water-spraying mechanism on the roof, achieved the most favorable conditions, with an average indoor temperature of approximately 28.85 °C. The synergistic effect of ventilation and water spraying effectively mitigated heat accumulation within the housing structure, particularly during the hot summer months. This combination not only lowered the indoor temperature but also facilitated a more stable microclimate conducive to optimal pig growth.
The findings of this experiment highlight the critical role of temperature control in pig housing, particularly in regions such as Thailand, where seasonal temperature fluctuations can be extreme. This study clearly illustrates that relying solely on a ventilation system may not be sufficient for maintaining optimal housing conditions for pigs. Instead, the integration of a roof water-spraying system in conjunction with ventilation emerged as the most effective strategy for regulating temperature and establishing a suitable environment for pig rearing.

3.4. Humidity

Based on the humidity measurements in the pig housing, as shown in Figure 7, this experiment measured the humidity levels in three zones of pig housing with different environmental management strategies using IoT systems to control the equipment in each zone. This experiment measured humidity and temperature in relation to seasonal changes in Thailand. The results highlight the importance of proper environmental management in pig housing, with the key factors affecting humidity and temperature being the presence or absence of a ventilation system and the use of water spraying from the roof.
In Zone 1, the mean relative humidity was recorded at 53.65% RH, the highest among the three evaluated zones. The absence of a ventilation system and the lack of roof water spraying resulted in inadequate airflow within the housing structure. This led to the accumulation of excess moisture, particularly pronounced during the rainy season typical of Thailand. Such conditions can negatively impact the housing environment for pigs, potentially heightening the risk of disease transmission and bacterial proliferation, thereby creating suboptimal conditions for livestock management.
In Zone 2, the installation of a ventilation system contributed to a reduction in average humidity, which was measured at 49.50% RH. The enhanced air circulation provided by the system was effective in mitigating moisture buildup within the housing. However, in the absence of roof water spraying, temperatures within the structure remained elevated, especially during the summer months. These high temperatures could expose the pigs to heat stress, potentially affecting their overall health and well-being. In Zone 2, the installation of a ventilation system contributed to a reduction in average humidity, which was measured at 49.50% RH. The enhanced air circulation provided by the system was effective in mitigating moisture buildup within the housing.
Zone 3 exhibited the lowest average humidity at 47.15% RH, a result of combining both a ventilation system and roof water spraying. The application of roof water spraying helped to lower the internal temperatures during the warmer months, creating a cooling effect within the housing. When paired with efficient ventilation, these measures contributed to an environment conducive to healthy pig rearing, minimizing the risks associated with high humidity and excessive heat, which are known to contribute to the spread of diseases and other health concerns in livestock.

4. Discussion

Effective environmental management on pig farms in Thailand is crucial, as pigs are sensitive to temperature and humidity changes. Poor management can lead to the accumulation of harmful gases like NH3 and H2S from manure decomposition, posing health risks to both pigs and farm workers. This study aimed to assess the effects of environmental management in pig housing using IoT technology to monitor and control temperature, humidity, and ventilation. The objective was to improve air quality and create a more suitable environment for raising pigs. This experiment was conducted in a pig house measuring 4 m × 10 m, divided into three zones, each utilizing different environmental management strategies. Various parameters, including NH3, H2S, temperature, and relative humidity, were monitored throughout the year using IoT sensor systems that continuously recorded data. Monitoring devices are vital for managing livestock environments, improving animal welfare, and reducing emissions. An IoT system was developed to track conditions in pig, dairy cow, and rabbit housing, measuring temperature, humidity, gas levels, and air quality. With accuracy within 2.7% and precision within 3.3%, case studies confirmed its effectiveness in detecting pollutants and supporting better environmental control [44].

4.1. Monitoring of Ammonia Concentration

In Zone 1, ammonia concentrations exhibited the highest variability compared to the other zones. These fluctuations may be attributable to environmental conditions, particularly the elevated temperatures commonly experienced in pig housing during Thailand’s summer months. Despite remaining within acceptable thresholds [14], the data indicate the potential risk of ammonia levels surpassing these limits in the future, especially if the pig population increases. Ammonia emissions are likely influenced by high temperatures, which accelerate the volatilization of ammonia from pig manure and other organic waste [51]. Poor ventilation can worsen ammonia accumulation, which poses risks to animal health and the overall environmental conditions [52]. Proactive management strategies, such as enhancing ventilation systems and monitoring population density, are essential to prevent future exceedances and ensure safe and healthy housing conditions for livestock [1]. This highlights the need for integrated environmental management in livestock farming to reduce ammonia emissions and protect animal and environmental health.
In Zone 2, ammonia concentrations displayed greater stability compared to Zone 1. This relatively narrow range suggests that the environmental management within this housing zone may be more optimized. Factors such as improved ventilation systems and more effective waste management protocols are likely contributors to this stability, as they play a critical role in controlling ammonia emissions. Thailand’s climatic conditions, particularly the high humidity levels, may further contribute to reducing airborne ammonia concentrations. Humidity can facilitate the absorption of ammonia into moisture, thereby lowering its presence in the air. Moreover, high humidity conditions may enhance the dispersion of ammonia, aided by natural airflow, thereby preventing its accumulation within the housing environment [48]. This consistency in ammonia levels in Zone 2 highlights the effectiveness of integrating appropriate environmental control measures in livestock housing. Optimized ventilation improves air quality and reduces respiratory risks for animals, while efficient waste management helps minimize ammonia production, supporting sustainable livestock practices [53]. The continuous monitoring and maintenance of these practices is crucial for achieving long-term stability and minimizing the potential for harmful ammonia exposure, underscoring the importance of sound environmental and operational management in agricultural systems.
Zone 3 exhibited the lowest ammonia concentrations among all zones. This narrow range clearly indicates the presence of highly effective environmental management strategies within this zone. Adequate ventilation systems likely played a significant role in maintaining these low ammonia levels, ensuring the continuous removal of emissions and preventing their accumulation within the airspace. Such optimized ventilation practices are crucial in mitigating the harmful effects of ammonia exposure on both livestock and the surrounding environment [54]. The data also revealed a seasonal influence on ammonia concentrations, with the highest levels recorded in April across all zones, which aligns with the peak of the summer season in Thailand [55]. The elevated temperatures during this period are known to enhance the volatilization of ammonia from manure, leading to greater concentrations in the air. Conversely, the lowest ammonia levels were observed in February and October, likely reflecting the cooler weather conditions, which reduced the rate of ammonia release. Additionally, cooler temperatures may improve natural ventilation efficacy, further contributing to the lower levels of airborne ammonia [56]. This temporal analysis highlights the link between environmental factors and ammonia emissions, emphasizing the need for seasonal adjustments in farm management. Using these insights, farms can apply targeted measures during hotter months to control ammonia levels, optimize resource use, and support animal welfare and environmental sustainability year-round.
The measurement of NH3 levels in this study aligns with international standards, which specify an acceptable concentration range of 7–25 ppm, depending on the duration of exposure [15,18,19]. Additionally, the findings are consistent with the study by De Boer S. and W. D. Morrison [21], which reported that NH3 concentrations in typical pig farms range from 1 to 30 ppm, with a safe level for animals being 5–10 ppm [14]. Although the NH3 levels measured in all three zones remain within the safe range, Zone 1 poses a significant risk, especially during the summer. If NH3 accumulates without adequate ventilation, it may negatively impact the health of the pigs. This aligns with previous research, which found that mechanical ventilation resulted in relatively low ammonia concentrations [1]. On the other hand, significant correlations were found between ammonia emissions and environmental factors. In cases where ammonia concentration has a greater influence on ammonia emission than ventilation rate [57]. The seasonal variation, particularly the peak ammonia levels observed in April, highlights the influence of climatic conditions on ammonia volatilization, necessitating adaptive management approaches during warmer months. Conversely, the lower levels in cooler months, such as February and October, indicate the potential for enhanced natural ventilation and reduced ammonia emissions during these periods.
The findings highlight the need for seasonally adaptive environmental management, including better ventilation, waste control, and continuous monitoring, to reduce ammonia emissions. Addressing both temporal and spatial variations can improve animal welfare, lower environmental impact, and support sustainable pig farming. This analysis aligns with studies on ammonia levels in dairy farms conducted by Kaasik and Maasikmets [58] and Bluteau and Leduc [59], which showed that the temperature and NH3 concentration inside livestock buildings are positively correlated. Since NH3 is produced by microbial processes, higher-than-optimal temperatures can stimulate NH3 production. A larger volume of air inside the building also helps dilute NH3 concentrations.

4.2. Monitoring of Hydrogen Sulfide Concentration

In Zone 1, where no ventilation system is present, the H2S levels were observed to be the highest among all zones. High temperatures and humidity during Thailand’s summer contribute to increased H2S emissions from decomposing pig manure. Without effective ventilation, these gases accumulate and persist at elevated levels in the housing environment. Prolonged exposure to such high levels of H2S poses health risks not only to the pigs but also to the workers in the facility, as hydrogen sulfide is a toxic gas known to affect respiratory and neurological functions at elevated concentrations.
In contrast, Zones 2 and 3, which are equipped with ventilation systems, demonstrated more controlled and significantly lower H2S levels. Zone 2 had an average H2S concentration of 3.34 ppm, with values ranging from 1.98 to 6.25 ppm, suggesting that the ventilation system effectively mitigated gas accumulation to some extent. Zone 3, which benefits from the most advanced environmental management practices and ventilation systems, exhibited the lowest H2S levels, with an average concentration of 2.84 ppm and a range between 1.14 and 4.73 ppm. The continuous removal of H2S through mechanical ventilation, combined with the dilution effect of moisture in the humid air, significantly reduces the concentration of harmful gases in these zones. This not only enhances air quality but also reduces the risk of gas exposure, providing a safer and healthier environment for both livestock and personnel.
In this study, the concentration levels of H2S varied across different zones. The highest concentration was recorded at 10.47 ppm in Zone 1, 6.25 ppm in Zone 2, and 4.73 ppm in Zone 3. Notably, the H2S concentration in Zone 3 falls within the acceptable range of 0.5 to 5 ppm, as revised by the Veterinary Medicine Committee [14]. However, the maximum concentration detected in Zone 3 may still pose a risk to pig health and safety if H2S accumulation increases over time. Therefore, enhancing the ventilation system in the area is a crucial measure to help reduce H2S levels to a safer range and mitigate potential adverse effects on animal health. In agreement with previously reported, ventilation plays a crucial role in diluting H2S concentration within a confined space, especially during manure operations [60]. Therefore, this study provides clear evidence that ventilation systems are essential for the effective control of H2S emissions in pig farming operations. Reducing gas concentrations through proper ventilation not only improves the living conditions for animals but also mitigates health risks for farmworkers. These results should encourage farm managers, especially in tropical climates, to invest in and maintain advanced environmental management technologies to sustain both productivity and occupational safety in pig housing facilities.

4.3. Monitoring of Temperature

Temperature differences between the zones were also observed. Zone 1 had the highest average temperature of 31.81 °C, which is detrimental to pig health and may cause heat stress. Continuous exposure to such high temperatures poses significant risks to pig health, including heat stress, which can adversely affect growth rates and increase the likelihood of heat-related illnesses. Prolonged exposure to elevated temperatures may also lead to reduced productivity in pigs, underscoring the importance of effective temperature management in pig housing. Zone 2, with an average temperature of 29.35 °C, benefitted from ventilation but still experienced higher-than-ideal temperatures during certain periods. Zone 3, with both ventilation and water spraying, had the lowest average temperature at 28.85 °C. As a result, pigs housed in Zone 3 are likely to experience improved health outcomes, enhanced growth rates, and a significantly reduced risk of heat stress.
A study measuring the temperature inside a pig house throughout the year found that the ventilation and misting system significantly influenced temperature control. In the zone using natural ventilation, the average temperature was 31.81 °C, which exceeded the optimal range for pig farming. This condition increases the risk of heat stress, potentially affecting the animals’ health and growth. Additionally, in the zone equipped with exhaust fans, the temperature decreased to 29.35 °C. Although this system helped reduce heat, the temperature remained higher than the recommended level, which could still negatively impact the pigs’ physiological condition. However, in the zone where both fans and a misting system were used, the average temperature further decreased to 28.85 °C, which was within the optimal range for pig farming. The recommended temperature for pig houses should be below 29 °C [34]. The combination of fans and a misting system is the most effective method for reducing heat stress in pigs, improving their health, and potentially boosting growth. Pigs are particularly sensitive to heat, which can negatively impact their behavior, physiology, and productivity. Common cooling methods in pig facilities, such as evaporative pad cooling, high-pressure fogging, sprinkling, increased air velocity, and floor cooling, can help mitigate this issue [61].
These results advocate for the adoption of advanced technologies, such as IoT systems, to facilitate the real-time monitoring and management of indoor environmental conditions in pig housing. By leveraging IoT technology, farmers can enhance their ability to control temperature, humidity, and other critical factors, ultimately improving the welfare and productivity of their livestock. As such, this study lays the groundwork for future research into innovative approaches for optimizing pig housing environments, contributing to the sustainability and efficiency of pig farming practices.

4.4. Monitoring of Relative Humidity

Relative humidity levels also varied between the zones. Zone 1 recorded the highest relative humidity at 53.65% RH, which can contribute to disease spread and bacterial growth. Zones 2 and 3 had relative humidity levels of 49.50% RH and 47.15% RH, respectively. The combination of ventilation and roof water spraying effectively reduced humidity, making Zone 3 the most favorable environment for raising pigs.
When comparing the three zones, the recommended humidity range for pig farming is between 50 and 75% RH [35]. Humidity levels below 50% may increase dust and pathogen levels, negatively affecting the pigs’ respiratory system. Conversely, humidity levels exceeding 70% may lead to wet pen floors, increasing the risk of disease. The experimental results showed that Zone 1 (without control) had an average humidity of 53.65% RH, which is near the lower limit of the recommended range. Zone 2 (with ventilation fans) reduced humidity to 49.50% RH, slightly below the standard threshold. Meanwhile, Zone 3 (with ventilation fans and a misting system) had a humidity level of 47.15% RH, which is too low and may create excessively dry conditions, potentially affecting pig health. Compared to the standard range of 50–75% RH, both Zone 2 and Zone 3 exhibited humidity levels that were too low. It is necessary to improve the ventilation system and optimize the use of the misting system to maintain humidity within the recommended range, thereby minimizing health risks for pigs and enhancing long-term farming efficiency. According to previous research, high relative humidity (>75%) reduces pig weight gain by 20% and increases feed consumption by 40%. However, low humidity (below 50%) also negatively impacts pigs, causing eye and respiratory tract irritation [2].
This study underscores the importance of managing ventilation systems to control pollutant gas levels, keeping them within safe limits, and preventing harmful health effects on both animals and farm workers. These findings align with a study by Popa et al. [62], which used IoT sensors to monitor ammonia levels on farms. The results indicated that ammonia levels tend to rise during periods without ventilation, leading to higher humidity and heat and, subsequently, higher ammonia concentrations. Conversely, during periods of proper ventilation, ammonia levels decreased as air circulation reduced humidity and ammonia accumulation. Applying IoT technology alongside ventilation and roof water spraying improves air quality in pig housing by reducing ammonia and hydrogen sulfide levels, while also regulating temperature and humidity. These practices support healthier pigs and more efficient farming, offering significant benefits for pig production in Thailand.

4.5. Significance of the Research

In summary, this study employed a data collection system developed using an IoT system to monitor environmental conditions within pig housing facilities. The platform was designed by Modella IoT Co., Ltd., a Thai company specializing in smart agricultural technologies. The system was customized to suit the objectives of this research and comprises sensor modules, a microcontroller unit (MCU), and a real-time dashboard accessible via the internet, which continuously displays and records environmental parameters inside the pig house. This research highlights the IoT system that was designed as a cost-effective alternative, with an installation cost of no more than USD 200 (approximately 6000 THB), significantly lower than traditional gas analysis systems such as gas chromatography (GC), which can cost much and need an expertise person. Moreover, the system allows real-time data collection and minimizes human error, making it more efficient compared to using a single air quality sensor separately. In terms of data collection efficiency, the IoT system in this study uploads sensor data every 20 min, ensuring continuous monitoring of environmental parameters. This is a significant improvement over manual monitoring methods, which would require periodic data collection and analysis, potentially introducing delays and inconsistencies. It is particularly well suited for small- to medium-sized pig farms in Thailand seeking a cost-effective and user-friendly solution.
Environmental management in pig farming is especially important in Thailand, as pigs are highly sensitive to changes in temperature and humidity, which can significantly affect their health, growth, and productivity. Poor environmental control can lead to the accumulation of harmful gases such as ammonia (NH3) and hydrogen sulfide (H2S), which are byproducts of manure and organic matter decomposition. These gases pose serious health risks to both animals and farm workers. Therefore, adopting IoT technology presents an effective alternative for monitoring and managing the environmental conditions within pig housing systems.

5. Conclusions

This study concludes that effective environmental management within pig housing is essential for ensuring the health and productivity of pigs, particularly in Thailand’s hot and humid climate. The integration of IoT technology, along with ventilation systems and roof water spraying, has proven to be effective in improving air quality and mitigating risk factors that could negatively impact both pigs and farm workers. The environmental conditions across Zones 1, 2, and 3 demonstrated significant variations in air quality and temperature regulation.
Zone 1, which lacked any form of ventilation, exhibited the highest concentrations of NH3 and H2S, along with elevated temperatures and humidity levels. This combination created an environment that was not only detrimental to pig health but also likely to impede productivity. Zone 2, equipped with ventilation fans, saw notable improvements in air quality and temperature control compared to Zone 1, though certain environmental parameters remained suboptimal. Zone 3, featuring both ventilation fans and a roof water spraying system, displayed the best environmental conditions. The combination of these technologies reduced heat, humidity, and the accumulation of harmful gases, providing the most suitable environment for pig rearing.
In summary, the application of appropriate technologies, such as IoT monitoring systems and enhanced ventilation, can greatly improve both pig health and farm productivity. Additionally, these practices help mitigate risks associated with hazardous gases, thereby safeguarding farm workers’ health. The adoption of such environmental management strategies is highly recommended for other pig farms.

Author Contributions

Conceptualization, methodology, software, writing—original draft preparation, S.K.; visualization, investigation, writing—review and editing, N.S.; software, validation, S.I.; supervision, K.S.; project administration, S.W.; conceptualization, methodology, formal analysis, resources, supervision, T.K. All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported by the University of Phayao and Thailand Science Research and Innovation Fund (Fundamental Fund 2025, Grant No. 5057/2567).

Data Availability Statement

The raw/processed data relevant to this work can be shared upon request.

Acknowledgments

Nopparat Suriyachai was supported by the Unit of Excellence (UOE5041/2567) from the University of Phayao.

Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

References

  1. Chantziaras, I.; De Meyer, D.; Vrielinck, L.; Van Limbergen, T.; Pineiro, C.; Dewulf, J.; Kyriazakis, I.; Maes, D. Environment-, health-, performance- and welfare-related parameters in pig barns with natural and mechanical ventilation. Prev. Vet. Med. 2020, 183, 105150. [Google Scholar] [CrossRef] [PubMed]
  2. Ignatkin, I.; Kazantsev, S.; Shevkun, N.; Skorokhodov, D.; Serov, N.; Alipichev, A.; Panchenko, V. Developing and Testing the Air Cooling System of a Combined Climate Control Unit Used in Pig Farming. Agriculture 2023, 13, 334. [Google Scholar] [CrossRef]
  3. Gautam, K.R.; Rong, L.; Zhang, G.; Bjerg, B.S. Temperature distribution in a finisher pig building with hybrid ventilation. Biosyst. Eng. 2020, 200, 123–137. [Google Scholar] [CrossRef]
  4. Collins, L.M.; Smith, L.M. Review: Smart agri-systems for the pig industry. Animal 2022, 16, 100518. [Google Scholar] [CrossRef]
  5. University, C.M. Pig Sensing Technology Aids Farmers in Thailand. Available online: https://engineering.cmu.edu/news-events/news/2019/08/05-pig-sensing.html (accessed on 22 February 2025).
  6. Vitawat, S.; Gridsada, P.; Lunchakorn, W.; Widhyakorn, A.; Chairat, P. Development Project of Smart Pig Farm Using LoRaWAN. NBTC J. 2021, 5, 215–236. Available online: https://so04.tci-thaijo.org/index.php/NBTC_Journal/article/view/238421 (accessed on 22 February 2025).
  7. Sena, P.; Kaiwman, B. The Use of Internet of Things technology to develop a smart farm prototype for pig farming. SNRU J. Sci. Technol. 2022, 14, 245673. [Google Scholar] [CrossRef]
  8. United Nations. Transforming our world: The 2030 Agenda for Sustainable Development (A/RES/70/1). 2015. Available online: https://sustainabledevelopment.un.org/content/documents/21252030%20Agenda%20for%20Sustainable%20Development%20web.pdf (accessed on 22 February 2025).
  9. Meechoovet, Y.; Siriwato, S. Thailand’s smart agriculture and its impacts on Thai farmers: A case study of smart agriculture in Ayutthaya, Thailand. Asian Political Sci. Rev. 2023, 7, 1–17. [Google Scholar] [CrossRef]
  10. Heederik, D.; Sigsgaard, T.; Thorne Peter, S.; Kline Joel, N.; Avery, R.; Bønløkke Jakob, H.; Chrischilles Elizabeth, A.; Dosman James, A.; Duchaine, C.; Kirkhorn Steven, R.; et al. Health Effects of Airborne Exposures from Concentrated Animal Feeding Operations. Environ. Health Perspect. 2007, 115, 298–302. [Google Scholar] [CrossRef]
  11. Vitali, M.; Santolini, E.; Bovo, M.; Tassinari, P.; Torreggiani, D.; Trevisi, P. Behavior and Welfare of Undocked Heavy Pigs Raised in Buildings with Different Ventilation Systems. Animals 2021, 11, 2338. [Google Scholar] [CrossRef]
  12. Hossain, M.M.; Cho, S.B.; Kim, I.H. Strategies for reducing noxious gas emissions in pig production: A comprehensive review on the role of feed additives. J. Anim. Sci. Technol. 2024, 66, 237–250. [Google Scholar] [CrossRef]
  13. Lee, C.; Giles, L.R.; Bryden, W.L.; Downing, J.L.; Owens, P.C.; Kirby, A.C.; Wynn, P.C. Performance and endocrine responses of group housed weaner pigs exposed to the air quality of a commercial environment. Livest. Prod. Sci. 2005, 93, 255–262. [Google Scholar] [CrossRef]
  14. Buoio, E.; Cialini, C.; Costa, A. Air Quality Assessment in Pig Farming: The Italian Classyfarm. Animals 2023, 13, 2297. [Google Scholar] [CrossRef] [PubMed]
  15. Costa, A.; Domeneghini, C. Pollutants in Livestock Buildings. In Ammonia and Dust Interplay with the Respiratory Tract; CRC Press: Boca Raton, FL, USA, 2018; pp. 49–58, Chapter 44. [Google Scholar]
  16. Wathes, C.; Demmers, T.; Xin, H. Ammonia Concentrations and Emissions in Livestock Production Facilities: Guidelines and Limits in the USA and UK. Am. Soc. Agric. Biol. Eng. 2003, 034112. [Google Scholar]
  17. Health and Safety Authority (HSA). Chemical Agents and Carcinogens CoP 2024. Available online: https://shorturl.asia/0hztm (accessed on 22 February 2025).
  18. Banhazi, T.; Seedorf, J.; Rutley, D.; Pitchford, W. Identification of Risk Factors for Sub-Optimal Housing Conditions in Australian Piggeries: Part 3. Environmental Parameters. J. Agric. Saf. Health 2008, 14, 41–52. [Google Scholar] [CrossRef]
  19. Groot Koerkamp, P.W.G.; Metz, J.H.M.; Uenk, G.H.; Phillips, V.R.; Holden, M.R.; Sneath, R.W.; Short, J.L.; White, R.P.; Hartung, J.; Seedorf, J.; et al. Concentrations and emissions of ammonia in livestock buildings in Northern Europe. J. Agric. Eng. Res. 1998, 70, 79–95. [Google Scholar] [CrossRef]
  20. Drummond, J.G.; Curtis, S.E.; Simon, J.; Norton, H.W. Effects of Aerial Ammonia on Growth and Health of Young Pigs1. J. Anim. Sci. 1980, 50, 1085–1091. [Google Scholar] [CrossRef]
  21. De Boer, S.; Morrison, W.D. The Effects of the Quality of the Environment in Livestock Buildings on the Productivity of Swine and Safety of Humans; University of Guelph: Guelph, ON, Canada, 1988. [Google Scholar]
  22. Smith, J.H.; Wathes, C.M.; Baldwin, B.A. The preference of pigs for fresh air over ammoniated air. Appl. Anim. Behav. Sci. 1996, 49, 417–424. [Google Scholar] [CrossRef]
  23. Jones, J.B.; Burgess, L.R.; Webster, A.J.F.; Wathes, C.M. Behavioural responses of pigs to atmospheric ammonia in a chronic choice test. Anim. Sci. 1996, 63, 437–445. [Google Scholar] [CrossRef]
  24. Gustafsson, G.; Nimmermark, S.; Jeppsson, K.H. Control of Emissions from Livestock Buildings and the Impact of Aerial Environment on Health, Welfare and Performance of Animals-a Review. In Livestock Housing: Modern Management to Ensure Optimal Health and Welfare of Farm Animals; Oxford University Press: Oxford, UK, 2013; pp. 261–280. [Google Scholar]
  25. Zhang, X.; Wang, A.; Chen, Y.; Bao, J.; Xing, H. Intestinal barrier dysfunction induced by ammonia exposure in pigs in vivo and in vitro: The protective role of L-selenomethionine. Ecotoxicol. Environ. Saf. 2022, 248, 114325. [Google Scholar] [CrossRef]
  26. Wiepkema, P.R.; Koolhaas, J.M. Stress and Animal Welfare. Anim. Welf. 1993, 2, 195–218. [Google Scholar] [CrossRef]
  27. Brglez, Š. Risk assessment of toxic hydrogen sulfide concentrations on swine farms. J. Clean. Prod. 2021, 312, 127746. [Google Scholar] [CrossRef]
  28. ClassyFarm. IZSLER and Italian Ministry of Health. 2023. Available online: https://www.classyfarm.it/ (accessed on 30 November 2024).
  29. Donham, K.J. The Concentration of Swine Production: Effects on Swine Health, Productivity, Human Health, and the Environment. Vet. Clin. N. Am. Food Anim. Pract. 2000, 16, 559–597. [Google Scholar] [CrossRef] [PubMed]
  30. Ni, J.Q.; Erasmus, M.A.; Croney, C.C.; Li, C.; Li, Y. A critical review of advancement in scientific research on food animal welfare-related air pollution. J. Hazard Mater. 2021, 408, 124468. [Google Scholar] [CrossRef] [PubMed]
  31. Hoff, S.J.; Bundy, D.S.; Nelson, M.A.; Zelle, B.C.; Jacobson, L.D.; Heber, A.J.; Ni, J.; Zhang, Y.; Koziel, J.A.; Beasley, D.B. Emissions of Ammonia, Hydrogen Sulfide, and Odor before, during, and after Slurry Removal from a Deep-Pit Swine Finisher. J. Air Waste Manag. Assoc. 2006, 56, 581–590. [Google Scholar] [CrossRef]
  32. Ferrari, S.; Costa, A.; Guarino, M. Heat stress assessment by swine related vocalizations. Livest. Sci. 2013, 151, 29–34. [Google Scholar] [CrossRef]
  33. Mount, L.E. The assessment of thermal environment in relation to pig production. Livest. Prod. Sci. 1975, 2, 381–392. [Google Scholar] [CrossRef]
  34. Jeffrey, J.Z.; Locke, A.K.; Alejandro, R.; Kent, J.S.; Gregory, W.S.; Jianqiang, Z. Diseases of Swine, 11th ed.; John Wiley & Sons: Hoboken, NJ, USA, 2019. [Google Scholar]
  35. Michael, R.M.; Thomas, J.L.A.; John, C. Managing Pig Health: A Reference for the Farm (2nd Edition); 5m Books: Essex, UK, 2013. [Google Scholar]
  36. Pitarma, R.; Marques, G.; Caetano, F. Monitoring Indoor Air Quality to Improve Occupational Health. In New Advances in Information Systems and Technologies; Springer: Berlin/Heidelberg, Germany, 2016; pp. 13–21. [Google Scholar]
  37. Elijah, O.; Rahman, T.A.; Orikumhi, I.; Leow, C.Y.; Hindia, M.N. An Overview of Internet of Things (IoT) and Data Analytics in Agriculture: Benefits and Challenges. IEEE Internet Things J. 2018, 5, 3758–3773. [Google Scholar] [CrossRef]
  38. Rejeb, A.; Rejeb, K.; Abdollahi, A.; Al-Turjman, F.; Treiblmaier, H. The Interplay between the Internet of Things and Agriculture: A Bibliometric Analysis and Research Agenda. Internet Things 2022, 19, 100580. [Google Scholar] [CrossRef]
  39. Angrecka, S.; Herbut, P.; Nawalany, G. Influence of wind on air movement in a free-stall barn during the summer period. Ann. Anim. Sci. 2013, 13, 109–119. [Google Scholar]
  40. Jairo Alexander, O.; Ilda Ferreira, T.; Hector Jose, C. Ammonia: A review of concentration and emission models in livestock structures. Dyna 2009, 76, 88–99. [Google Scholar]
  41. Zahner, M.; Schrader, L.; Hauser, R.; Keck, M.; Langhans, W.; Wechsler, B. The influence of climatic conditions on physiological and behavioural parameters in dairy cows kept in open stables. Anim. Sci. 2004, 78, 139–147. [Google Scholar] [CrossRef]
  42. Farooq, M.S.; Sohail, O.O.; Abid, A.; Rasheed, S. A Survey on the Role of IoT in Agriculture for the Implementation of Smart Livestock Environment. IEEE Access 2022, 10, 9483–9505. [Google Scholar] [CrossRef]
  43. Mishra, S.; Sharma, S.K. Advanced contribution of IoT in agricultural production for the development of smart livestock environments. Internet Things 2023, 22, 100724. [Google Scholar] [CrossRef]
  44. Provolo, G.; Brandolese, C.; Grotto, M.; Marinucci, A.; Fossati, N.; Ferrari, O.; Beretta, E.; Riva, E. An Internet of Things Framework for Monitoring Environmental Conditions in Livestock Housing to Improve Animal Welfare and Assess Environmental Impact. Animals 2025, 15, 644. [Google Scholar] [CrossRef]
  45. Oliveira, C.E.A.; Avelar, T.A.; Tinôco, I.d.F.F.; Coelho, A.L.d.F.; Sousa, F.C.d.; Barbari, M. Development and Validation of Data Acquisition System for Real-Time Thermal Environment Monitoring in Animal Facilities. AgriEngineering 2025, 7, 45. [Google Scholar] [CrossRef]
  46. Mahfuz, S.; Mun, H.-S.; Dilawar, M.A.; Yang, C.-J. Applications of Smart Technology as a Sustainable Strategy in Modern Swine Farming. Sustainability 2022, 14, 2607. [Google Scholar] [CrossRef]
  47. Arulmozhi, E.; Bhujel, A.; Deb, N.C.; Tamrakar, N.; Kang, M.Y.; Kook, J.; Kang, D.Y.; Seo, E.W.; Kim, H.T. Development and Validation of Low-Cost Indoor Air Quality Monitoring System for Swine Buildings. Sensors 2024, 24, 3468. [Google Scholar] [CrossRef]
  48. Pu, S.; Rong, X.; Zhu, J.; Zeng, Y.; Yue, J.; Lim, T.; Long, D. Short-Term Aerial Pollutant Concentrations in a Southwestern China Pig-Fattening House. Atmosphere 2021, 12, 103. [Google Scholar] [CrossRef]
  49. Pedersen, S.; Blanes-Vidal, V.; Jørgensen, H.; Chwalibog, A.; Haeussermann, A.; Heetkamp, M.J.W.; Aarnink, A. Carbon Dioxide Production in Animal Houses: A literature review. Agric. Eng. Int. 2008, 10, 1–9. [Google Scholar]
  50. Blunden, J.; Aneja, V.P.; Westerman, P.W. Measurement and analysis of ammonia and hydrogen sulfide emissions from a mechanically ventilated swine confinement building in North Carolina. Atmos. Environ. 2008, 42, 3315–3331. [Google Scholar] [CrossRef]
  51. Konapathri, R.; Azimov, U. Assessment of ammonia distribution in a livestock farm using CFD simulations. Smart Agric. Technol. 2024, 7, 100376. [Google Scholar] [CrossRef]
  52. Peng, S.; Zhu, J.; Liu, Z.; Hu, B.; Wang, M.; Pu, S. Prediction of Ammonia Concentration in a Pig House Based on Machine Learning Models and Environmental Parameters. Animals 2022, 13, 165. [Google Scholar] [CrossRef] [PubMed]
  53. Vitaliano, S.; D’Urso, P.R.; Arcidiacono, C.; Cascone, G. Ammonia Emissions and Building-Related Mitigation Strategies in Dairy Barns: A Review. Agriculture 2024, 14, 1148. [Google Scholar] [CrossRef]
  54. Oliveira, M.D.; Sousa, F.C.; Saraz, J.O.; Calderano, A.A.; Tinôco, I.F.F.; Carneiro, A.P.S. Ammonia Emission in Poultry Facilities: A Review for Tropical Climate Areas. Atmosphere 2021, 12, 1091. [Google Scholar] [CrossRef]
  55. Singh, R.; Kim, K.; Park, G.; Kang, S.; Park, T.; Ban, J.; Choi, S.; Song, J.; Yu, D.-G.; Woo, J.-H.; et al. Seasonal and Spatial Variations of Atmospheric Ammonia in the Urban and Suburban Environments of Seoul, Korea. Atmosphere 2021, 12, 1607. [Google Scholar] [CrossRef]
  56. Saha, C.K.; Ammon, C.; Berg, W.; Fiedler, M.; Loebsin, C.; Sanftleben, P.; Brunsch, R.; Amon, T. Seasonal and diel variations of ammonia and methane emissions from a naturally ventilated dairy building and the associated factors influencing emissions. Sci. Total Environ. 2014, 468, 53–62. [Google Scholar] [CrossRef] [PubMed]
  57. Jo, G.; Ha, T.; Jang, Y.; Hwang, O.; Seo, S.; Woo, S.; Lee, S.; Kim, D.; Jung, M. Ammonia Emission Characteristics of a Mechanically Ventilated Swine Finishing Facility in Korea. Atmosphere 2020, 11, 1088. [Google Scholar] [CrossRef]
  58. Kaasik, A.; Maasikmets, M. Concentrations of airborne particulate matter, ammonia and carbon dioxide in large scale uninsulated loose housing cowsheds in Estonia. Biosyst. Eng. 2013, 114, 223–231. [Google Scholar] [CrossRef]
  59. Bluteau, C.; Massé, D.; Leduc, R. Ammonia emission rates from dairy livestock buildings in Eastern Canada. Biosyst. Eng. 2009, 103, 480–488. [Google Scholar] [CrossRef]
  60. Ni, J.-Q. Factors affecting toxic hydrogen sulfide concentrations on swine farms ― sulfur source, release mechanism, and ventilation. J. Clean. Prod. 2021, 322, 129126. [Google Scholar] [CrossRef]
  61. Godyń, D.; Herbut, P.; Angrecka, S.; Corrêa Vieira, F.M. Use of Different Cooling Methods in Pig Facilities to Alleviate the Effects of Heat Stress—A Review. Animals 2020, 10, 1459. [Google Scholar] [CrossRef]
  62. Popa, R.A.; Popa, D.C.; Mărginean, G.E.; Suciu, G.; Bălănescu, M.; Paștea, D.; Vulpe, A.; Vochin, M.; Drăgulinescu, A.M. Hybrid Platform for Assessing Air Pollutants Released from Animal Husbandry Activities for Sustainable Livestock Agriculture. Sustainability 2021, 13, 9633. [Google Scholar] [CrossRef]
Figure 1. Schematic diagram of the Internet of Things (IoT) system, a sensor-based monitoring network for the environment in pig housing.
Figure 1. Schematic diagram of the Internet of Things (IoT) system, a sensor-based monitoring network for the environment in pig housing.
Agriengineering 07 00165 g001
Figure 2. (A) Example of research environment using Internet of Things (IoT) technology in a pig housing. (B) Layout of the environmental control system installation in a livestock barn (top view).
Figure 2. (A) Example of research environment using Internet of Things (IoT) technology in a pig housing. (B) Layout of the environmental control system installation in a livestock barn (top view).
Agriengineering 07 00165 g002
Figure 3. Concentrations NH3 of pig housing (Zone 1) with no environmental control (natural ventilation), (Zone 2) with ventilation fans but no water spraying system, and (Zone 3) with both ventilation fans and a water spraying system on the roof.
Figure 3. Concentrations NH3 of pig housing (Zone 1) with no environmental control (natural ventilation), (Zone 2) with ventilation fans but no water spraying system, and (Zone 3) with both ventilation fans and a water spraying system on the roof.
Agriengineering 07 00165 g003
Figure 4. Concentrations H2S of pig housing (Zone 1) with no environmental control (natural ventilation), (Zone 2) with ventilation fans but no water spraying system, and (Zone 3) with both ventilation fans and a water spraying system on the roof.
Figure 4. Concentrations H2S of pig housing (Zone 1) with no environmental control (natural ventilation), (Zone 2) with ventilation fans but no water spraying system, and (Zone 3) with both ventilation fans and a water spraying system on the roof.
Agriengineering 07 00165 g004
Figure 5. (a) Correlation of concentrations between NH3 and H2S in pig housing. (b) Statistics of the relationship between NH3 and H2S: (Zone 1) with no environmental control (natural ventilation), (Zone 2) with ventilation fans but no water spraying system, and (Zone 3) with both ventilation fans and a water spraying system on the roof. (c) ANOVA-based comparison of gas concentrations across different zones represents the concentration of NH3 and H2S.
Figure 5. (a) Correlation of concentrations between NH3 and H2S in pig housing. (b) Statistics of the relationship between NH3 and H2S: (Zone 1) with no environmental control (natural ventilation), (Zone 2) with ventilation fans but no water spraying system, and (Zone 3) with both ventilation fans and a water spraying system on the roof. (c) ANOVA-based comparison of gas concentrations across different zones represents the concentration of NH3 and H2S.
Agriengineering 07 00165 g005
Figure 6. Temperature of pig housing (Zone 1) with no environmental control (natural ventilation), (Zone 2) with ventilation fans but no water spraying system, and (Zone 3) with both ventilation fans and a water spraying system on the roof.
Figure 6. Temperature of pig housing (Zone 1) with no environmental control (natural ventilation), (Zone 2) with ventilation fans but no water spraying system, and (Zone 3) with both ventilation fans and a water spraying system on the roof.
Agriengineering 07 00165 g006
Figure 7. Humidity (%RH) of pig housing (Zone 1) with no environmental control (natural ventilation), (Zone 2) with ventilation fans but no water spraying system, and (Zone 3) with both ventilation fans and a water spraying system on the roof.
Figure 7. Humidity (%RH) of pig housing (Zone 1) with no environmental control (natural ventilation), (Zone 2) with ventilation fans but no water spraying system, and (Zone 3) with both ventilation fans and a water spraying system on the roof.
Agriengineering 07 00165 g007
Table 1. Negative effects on pig health [15].
Table 1. Negative effects on pig health [15].
PollutantEffect
Ammonia (NH3)Negative effects on pig health include eye and/or respiratory tract inflammation, loss of appetite (anorexia), irritation of the respiratory mucous membranes, weakened immune function, and susceptibility to specific diseases.
Hydrogen sulfide (H2S)Negative effects on pig health include eye and/or respiratory system inflammation, smell disturbances, loss of appetite (anorexia), nausea, and diarrhea.
Table 2. Optimal temperature requirements in pigs indicated in the ClassyFarm system [34].
Table 2. Optimal temperature requirements in pigs indicated in the ClassyFarm system [34].
WeightTemperature Range
5–14 kg24–29 °C
14–23 kg21–27 °C
23–34 kg16–21 °C
34–82 kg13–21 °C
>82 kg10–21 °C
Table 3. Parameters for determining pollutant concentration levels and air quality inside pig housing.
Table 3. Parameters for determining pollutant concentration levels and air quality inside pig housing.
ConditionAcceptable ConcentrationReference
NH3 (Ammonia)5–10 ppm[14]
H2S (Hydrogen Sulfide)0.5–5 ppm[14]
T (Temperature)<29 °C[34]
RH (Humidity)50–75% [35]
Table 4. Technical specifications of measurement sensors.
Table 4. Technical specifications of measurement sensors.
ParameterMeasuring RangeResolutionAccuracySensor Model and Manufacturer
NH35–500 ppm1 ppm±5%ppmMQ137 Ammonia NH3 Gas Sensor Module
H2S1–200 ppm1 ppm±5%ppmModule sensor MQ-136 (Hydrogen sulfide gas sensor)
T−40~125 °C0.1 °C±0.3 °CAM2305 Original High-Quality Temperature and Humidity Sensor
RH0~99.9%RH0.1%RH±2%RHAM2305 Original High-Quality Temperature and Humidity Sensor
Table 5. ANOVA analysis results for gas concentration differences between zones.
Table 5. ANOVA analysis results for gas concentration differences between zones.
Differences Gas Concentration Zone Comparison Zone p-Values
NH3 concentration between zonesZone 1 > Zone 2 > Zone 3<0.05
H2S concentration between zonesZone 1 > Zone 2 > Zone 3<0.05
(NH3 + H2S) between zonesSignificant multivariate difference across zones<0.05
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Khaowdang, S.; Suriyachai, N.; Imman, S.; Suwannahong, K.; Wongcharee, S.; Kreetachat, T. Application of Internet of Things Technology for Ventilation and Environmental Control in Conventional Open-Air Pig Housing Systems in Thailand. AgriEngineering 2025, 7, 165. https://doi.org/10.3390/agriengineering7060165

AMA Style

Khaowdang S, Suriyachai N, Imman S, Suwannahong K, Wongcharee S, Kreetachat T. Application of Internet of Things Technology for Ventilation and Environmental Control in Conventional Open-Air Pig Housing Systems in Thailand. AgriEngineering. 2025; 7(6):165. https://doi.org/10.3390/agriengineering7060165

Chicago/Turabian Style

Khaowdang, Suphalerk, Nopparat Suriyachai, Saksit Imman, Kowit Suwannahong, Surachai Wongcharee, and Torpong Kreetachat. 2025. "Application of Internet of Things Technology for Ventilation and Environmental Control in Conventional Open-Air Pig Housing Systems in Thailand" AgriEngineering 7, no. 6: 165. https://doi.org/10.3390/agriengineering7060165

APA Style

Khaowdang, S., Suriyachai, N., Imman, S., Suwannahong, K., Wongcharee, S., & Kreetachat, T. (2025). Application of Internet of Things Technology for Ventilation and Environmental Control in Conventional Open-Air Pig Housing Systems in Thailand. AgriEngineering, 7(6), 165. https://doi.org/10.3390/agriengineering7060165

Article Metrics

Back to TopTop