Hyperlocal AQI: Street-Level Air Quality for Your Neighborhood
Bangkok’s ~30 official PCD monitoring stations cover 1,569 km² with 5–8 km average spacing — far too coarse for neighborhood-level decisions. A Hyperlocal AQI Network aggregates PCD official stations, personal PurpleAir sensors, and OpenAQ community data to generate street-level PM2.5 maps.
Data Sources
Air4Thai API (PCD): Free public REST API providing AQI and PM2.5 from ~30 Bangkok official stations, updated hourly. PurpleAir PA-II (~5,500 THB): dual-laser optical sensor with 2-minute update interval; apply US EPA correction factor (CF=1 calibration) for accuracy. OpenAQ API: aggregates IQAir, Berkeley Earth, and community sensors with a 15km radius query around Bangkok center.
Kriging Interpolation for Continuous Maps
Ordinary Kriging (pykrige library) interpolates PM2.5 readings from discrete sensor locations onto a continuous grid (100m resolution over Bangkok). The resulting map uses a color gradient from green (<25 μg/m³) through yellow, orange, red, to purple (>150 μg/m³).
Home Assistant Dashboard
The Lovelace map-card overlays the Kriging PM2.5 raster with real-time sensor markers. Home alerts fire when the household PurpleAir sensor exceeds user-defined thresholds, with comparison to the nearest official station and Bangkok-wide average.
Practical Bangkok Applications
During January–March haze season, hyperlocal data enables: optimal outdoor exercise timing (PM2.5 daily minimum tracking), route comparison for cycling or jogging, and real-time decisions on ERV outdoor intake valve operation versus building pressurization mode.
