Sigit Dani Perkasa
ProjectsWorkAboutContact

Built with Next.js, R3F, drei - Last updated 2026-06-22

GitHubContact
Sigit Dani Perkasa
ProjectsWorkAboutContact
Projects/Swiftlet House IoT
Repo2024Banyuwangi, East Java

Swiftlet House IoT

ESP32 IoT monitoring swiftlet house — ammonia, temp, humidity, light to Firebase with GPS.

Swiftlet House Cross-Section — Banyuwangi, East JavaLIVE
NH3T/HLUXGPSMCU-8.2192, 114.3691A-Frame Cross-Section

Live Readings

Ammonia (NH3)
18 ppmSAFE
Temperature
27.2°CSAFE
Humidity
82% RHSAFE
Light
0 luxLOW
24h Ammonia Trend
DANGER 50ppm0:006:0012:0018:0024:00203040
System Parameters
MCUESP32NH3 SensorMQ-135T/H SensorDHT22LightBH1750GPSNEO-6MInterval5 seconds
2The Problem

Ammonia threatens swiftlet health

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.

Ammonia Thresholds

Safe< 25 ppm
Optimal — birds healthy, normal nest production
Warning25 – 35 ppm
Ventilation needed — reduced feeding activity
Danger> 50 ppm
Critical — respiratory damage, colony at risk
3The System

ESP32 IoT loop for swiftlet house monitoring

01
Sensors Read
NH3, Temp Humidity, Light
02
ESP32 Process
Analog read Digital parse
03
GPS Tag
Lat/Lng Timestamp
04
WiFi Upload
Firebase RTDB push
05
Dashboard Monitor
Real-time Bird health
Firebase RTDB — push every 5 seconds
GPS tagged: lat/lng per record

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.

Sensor Specifications
Sensor
Parameter
Range
Accuracy
Interface
Notes
MQ-135
Ammonia (NH3)
10 – 1000 ppm
±10%
Analog
Gas sensor for air quality; sensitive to NH3, benzene, smoke
DHT22
Temperature
-40 – 80°C
±0.5°C
Digital (1-Wire)
Also provides humidity; calibrated factory digital output
DHT22
Humidity
0 – 100% RH
±2% RH
Digital (1-Wire)
Capacitive humidity sensing element
BH1750
Light Intensity
1 – 65535 lux
±20%
I²C
Digital ambient light sensor; spectral response near human eye
NEO-6M
GPS Location
Global
2.5m CEP
UART (NMEA)
Tags each Firebase record with lat/lng for spatial analysis
4Results

Continuous monitoring protects bird health

Ammonia (NH3) — ppm
Day 1Day 2Day 3Day 4Day 5Day 6Day 720253035SafeWarningDanger
Temperature — °C
Day 1Day 2Day 3Day 4Day 5Day 6Day 726283032
Humidity — % RH
Day 1Day 2Day 3Day 4Day 5Day 6Day 772768084
Bird Health Score (composite index)
Day 1Day 2Day 3Day 4Day 5Day 6Day 765758595

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.

5Methodology

Sensor deployment and data pipeline

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.

6Related

Cross-references

GitHub Repository

ESP32 firmware and Firebase integration for swiftlet house environmental monitoring.

ESP32 + MQ-135 + DHT22 + BH1750 + NEO-6M

ArsenikV2

ESP32 water quality monitor — 7 sensors + GPS, Firebase upload every 5s. Same architecture pattern.

AirFeel WS

ESP32 weather station parsing serial packets from Fine Offset sensor. Sibling Firebase IoT project.

Hydroponics IoT

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.

Built with Next.js, R3F, drei - Last updated 2026-06-22

GitHubContact