
How We Built BreathAhead: Predicting Delhi’s Toxic Stubble Smoke 14 Hours in Advance with NASA Satellites and AWS
Shifting air quality management from reactive sensors to proactive defense using AWS EC2, Nginx, NASA VIIRS 375m satellite telemetry, and Python geospatial modeling to alert schools and citizens 12–24 hours ahead of toxic smog spikes.
Every autumn across northwestern India, an invisible crisis unfolds. Following the post-monsoon paddy harvest, farmers across Punjab and Haryana have a narrow 10 to 14-day window to clear agricultural fields before sowing wheat. The resulting open-field stubble burning injects tens of thousands of tons of particulate matter (PM2.5) into the sky. Driven by prevailing northwesterly winds, these toxic plumes travel hundreds of kilometers downwind, engulfing Delhi-NCR in catastrophic air pollution where AQI regularly crosses 450 to 500 (Hazardous).
For years, citizens, schools, and city administrators have relied on ground AQI monitoring stations. But traditional sensors have one fatal flaw: they are purely reactive.
A ground monitor in central Delhi only sounds the alarm when toxic smoke has already entered the neighborhood airshed. By the time a parent gets a phone alert at 2:00 PM, children have already spent six hours outside at school breathing toxic air.
We built BreathAhead to solve this fundamental problem. Instead of measuring pollution symptoms after they arrive, BreathAhead tracks the source from space—giving citizens, schools, and city authorities a 12 to 24-hour pre-emptive warning window.
Here is how we architected, modeled, and deployed BreathAhead on AWS.
🏗️ The Core Architecture: Connecting Satellites to Citizens
To give citizens true advance warning, we had to connect three disparate data layers in real time:
- Orbital Telemetry (NASA FIRMS VIIRS): Ingests near-real-time thermal anomaly detections from NASA’s Suomi-NPP and NOAA satellites at 375-meter spatial resolution, capturing fire coordinates, detection timestamps, and Fire Radiative Power (FRP).
- Atmospheric Wind Fields (Open-Meteo): Ingests hourly 10-meter surface wind speeds and direction vectors across northern India.
- Upwind Plume Transport Model: A Python-based geospatial engine that indexes the subcontinent into 0.1° (~10 km) grid cells, isolates active fires within an upwind arrival cone (±30° from prevailing wind direction), and calculates physical travel times (Distance / Wind Speed).
text
[ NASA FIRMS VIIRS Satellites ] [ Open-Meteo Wind Vectors ]│ │└──────────────────┬──────────────────┘│▼[ Python Geospatial Engine ]• 0.1° Spatial Grid Indexing• Upwind Cone Tolerance (±30°)• Physical Arrival ETA Calculation│▼[ Amazon EC2 + Nginx Webroot ]• Ubuntu 24.04 LTS Instance• Nginx High-Performance Host• Dynamic Leaflet Map & Action Playbooks│▼[ 12–24h Pre-Emptive Alerts ]• School Outdoor Cancellations• Automated Phone Notifications
Deploying on AWS: Why Amazon EC2 Was the Perfect Choice
During a fast-paced hackathon build, you cannot afford infrastructure friction. We needed a reliable cloud environment that could host our real-time geospatial dashboard, run automated Python data pipelines, and remain publicly available 24/7 for evaluation.
- Amazon EC2 (Ubuntu 24.04 LTS) We provisioned an Amazon EC2 instance (t3.micro) on Ubuntu Linux. The Linux environment allowed us to spin up our Python 3.12 virtual environment, install geospatial libraries (NumPy, Haversine math), and configure our data pipeline in under 15 minutes.
Because stubble fire telemetry updates continuously throughout the day, EC2 provided the persistent processing runtime needed to execute background ingestion scripts without execution timeout constraints.
- High-Performance Static Delivery with Nginx Because our frontend was built using high-performance Vanilla JavaScript, HTML5, and Leaflet.js, we didn't require complex Node.js container build steps. We configured Nginx as a reverse proxy and static web server directly on EC2:
server {
listen 80 default_server;
server_name _;
root /var/www/saans;
index index.html;
Plain text
location / {try_files $uri $uri/ =404;}
}
This gave us instantaneous page loads, zero client-side hydration delays, and seamless responsiveness on both desktop and mobile browsers.
- Amazon VPC Security Groups & Elastic IP We secured the instance using Amazon VPC Security Groups: • Inbound: Port 80 (HTTP) and Port 443 (HTTPS) open to 0.0.0.0/0 for public web traffic, while administrative SSH (Port 22) was restricted strictly to our development IP. • Outbound: Full outbound access allowed our Python ingestion workers to query NASA FIRMS and Open-Meteo APIs effortlessly. • Elastic IP: Attaching an Amazon Elastic IP ensured our public demo endpoint remained permanently fixed, so restarting or reconfiguring the instance never broke demo links for judges and testers.
Scientific Validation: Proving It Works
A predictive system is only as good as its validation. To prove BreathAhead wasn't relying on guesswork, we back-tested our heuristic model across 22 ground-truth peak season days (October 20 – November 20 across 2024 and 2025).
We benchmarked BreathAhead against standard baselines:
• Naive 24h Persistence: Assuming fires will simply ignite where they were yesterday.
• History Climatology: Static multi-year historical fire priors.
The Results:
• +53% Precision Gain: BreathAhead achieved 37.7% Precision@50 compared to just 24.6% for persistence baselines. Because agricultural fires move as harvesting machinery travels across districts, persistence fails. BreathAhead’s spatial neighborhood model accurately captured fire migration.
• 14 Hours of Proven Lead Time: On November 1, 2024 (Delhi AQI 480), BreathAhead’s satellite model flagged a Code Red alert 14 hours before ground monitoring stations crossed the hazardous 400 AQI mark.
Beyond Numbers: The Action Playbook
Raw AQI numbers don't protect lungs—timely actions do. BreathAhead automatically maps sector-specific ETAs to concrete mitigation protocols:
• Schools: Cancel morning outdoor sports and shift junior classes to hybrid learning the evening before.
• Households: Pre-seal windows and activate HEPA purifiers two hours before plume arrival.
• Vulnerable Citizens: Enforce outdoor exposure caps for asthmatic patients and outdoor delivery workers.
• Municipal Authorities: Deploy anti-smog guns and divert diesel truck corridors before pollution gets trapped under thermal inversions.
Builder Takeaways: What We Learned
- Keep Architecture as Simple as Possible: Starting with EC2 and Nginx allowed us to ship a rock-solid, production-deployed system in hours, avoiding over-engineering so we could focus on algorithmic accuracy.
- Design for Pre-emption, Not Just Monitoring: Environmental IoT is full of dashboards that show current pollution. The true value for public health lies in advance notice.
- Ground Truth Over Mock Data: Integrating live NASA satellite feeds directly into AWS cloud pipelines gave the project immediate real-world credibility.
Clean air shouldn't be an afterthought. By combining satellite telemetry with reliable AWS cloud infrastructure, BreathAhead proves that knowing what is coming—before it arrives—is now possible.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article