Dynamic-Response Modeling and Real-Time Compensation of Multi-Gas Sensors in Smart Livestock Housing During Ventilation Transients
Low-cost CO2 and NH3 sensors are widely used in smart livestock housing, but their slow dynamic response during ventilation-fan transitions can cause substantial measurement errors that steady-state monitoring approaches overlook. This study aimed to quantify these transient errors and compensate for them in real time. Chamber experiments reproducing pig-barn ventilation rates (2–20 ACH) were combined with field measurements in a commercial finishing-pig barn. A hybrid framework coupling a physics-based dual first-order lag model with a GRU residual-correction model was evaluated using event-level five-fold cross-validation, held-out week-2 field data from the same farm, and ablation analysis. Transient error reached up to 12.97 times the steady-state level and was associated with the ratio of the sensor time constant to the room dilution time constant. Hybrid compensation reduced transient MAE by 82.7% for CO2 and 66.9% for NH3 and shortened the equivalent CO2 t90 by 70.9%; improvements of 73.3% and 59.3% were maintained on the held-out field data. The hybrid model outperformed physics-only and deep-learning-only models. After 8-bit quantization, processing on a Raspberry Pi 4B(Raspberry Pi Ltd., Cambridge, UK) required 4.58 ms per gas and 9.54 ms for both gases. Dynamic compensation can therefore improve gas-data reliability during ventilation transients, although validation across seasons and farms remains necessary.
Authors
- Meonghun Lee (ORCID: https://orcid.org/0000-0001-8863-7580)
- Hyeonchang Jeong (ORCID: https://orcid.org/0009-0005-4856-1864)
- Kyeong Il Ko
Institutions
- Sunchon National University (KR)
Publication Details
- Journal
- Electronics
- Published
- 2026-10-15
- DOI
- https://doi.org/10.3390/electronics15204758
- Primary Topic
- Smart Agriculture and AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00