ESP32 IoT monitoring swiftlet house — ammonia, temp, humidity, light to Firebase with GPS.
Swiftlet houses accumulate ammonia (NH3) from bird droppings decomposing on nesting planks. Without proper ventilation monitoring, ammonia levels can exceed 50 ppm — well above the safe threshold of 25 ppm for bird respiratory health. Prolonged exposure reduces nest production, weakens chicks, and can lead to colony collapse.
Traditional monitoring relies on manual inspection visits by farmers, who check conditions at most twice daily. Between visits, temperature spikes, humidity drops, and ammonia buildup go undetected for hours. In tropical regions like Banyuwangi, East Java, where ambient temperatures regularly exceed 30°C, the combination of heat and ammonia accelerates bird stress.
Existing commercial monitoring systems are designed for industrial poultry and are cost-prohibitive for small-scale swiftlet farmers. They also lack GPS-tagged data logging, making it impossible to correlate environmental conditions across multiple geographically distributed swiftlet houses owned by the same farmer.
The system integrates four sensors with an ESP32 microcontroller: MQ-135 for ammonia gas detection, DHT22 for temperature and humidity, BH1750 for light intensity, and NEO-6M GPS for geo-tagging. Sigit designed the sensor integration and data pipeline, implementing a sampling loop that reads all sensors every 5 seconds.
Each reading is timestamped and tagged with GPS coordinates before being pushed to Firebase Realtime Database over Wi-Fi. This enables remote monitoring from any web-enabled device — farmers can check conditions at multiple swiftlet houses from a single dashboard without visiting each location physically.
The ESP32 firmware implements a watchdog timer and reconnection logic for unreliable Wi-Fi conditions common in rural East Java. If the Firebase connection drops, readings are buffered locally and uploaded in batch when connectivity is restored, preventing data gaps during network outages.
Deployment across a 7-day monitoring period demonstrated the system's ability to detect ammonia spikes early. On Day 4, when ammonia reached 33 ppm due to reduced ventilation during a hot afternoon, the system registered the increase within 5 seconds — hours before a manual inspection would have caught it.
Temperature and humidity data revealed a strong inverse correlation: as midday temperatures rose above 30°C, relative humidity dropped below 75%, creating conditions that concentrate ammonia gas. The GPS-tagged data allowed the farmer to compare conditions across two swiftlet houses and identify the one with inferior natural ventilation for retrofit.
The composite health score, derived from weighted ammonia, temperature, and humidity readings, provided an intuitive single-number metric for daily bird welfare assessment. Scores above 80 indicated healthy conditions; below 70 triggered an automated alert to the farmer's phone via Firebase Cloud Messaging.
The MQ-135 ammonia sensor was calibrated against a known 50 ppm NH3 reference gas and positioned at bird-roosting height (approximately 3 meters above floor) on the central nesting plank. The DHT22 temperature/humidity sensor and BH1750 light sensor were co-located at the same height to capture the microclimate experienced by roosting birds.
The NEO-6M GPS module was mounted on the exterior roof to maintain satellite lock, with a 3-meter cable running to the ESP32 inside the house. GPS coordinates (latitude, longitude) are appended to every Firebase record, enabling spatial analysis and multi-site comparison for farmers managing several swiftlet houses across different locations.
Firebase Realtime Database was chosen for its low-latency push model — new readings appear on the dashboard within 2 seconds of sensor capture. The database schema stores readings as timestamp-keyed nodes under a per-device path, with each record containing: ammonia, temperature, humidity, light, latitude, longitude, and device battery voltage. Data retention is set to 90 days with automatic pruning of older records.
Sigit's contribution focused on the embedded firmware architecture — implementing non-blocking sensor reads, GPS NMEA sentence parsing, and Firebase REST API integration on the ESP32 platform. The system was tested at a commercial swiftlet house in Banyuwangi, East Java, operated by a farmer managing approximately 500 birds across two structures.
ESP32 firmware and Firebase integration for swiftlet house environmental monitoring.
ESP32 + MQ-135 + DHT22 + BH1750 + NEO-6M
ESP32 water quality monitor — 7 sensors + GPS, Firebase upload every 5s. Same architecture pattern.
ESP32 weather station parsing serial packets from Fine Offset sensor. Sibling Firebase IoT project.
IoT-based automation for hydroponics — nutrient monitoring and environmental sensors with ESP32.
This IoT monitoring system extends sigit's embedded systems expertise into precision agriculture and bird farming, applying the same ESP32 + Firebase architecture used in water quality (ArsenikV2) and weather monitoring (AirFeel WS) to a new domain.