
I Got Cooked by Delhi's Air, So I Built a Smoke Radar That Warns You Two Days Early
Every November, Delhi wakes up to a grey sky that seems to have come from nowhere. It didn't. It left Punjab two days earlier. This is the story of how I taught a few AWS services to see it coming.
The morning my sky disappeared
It was a Tuesday in November, and I woke up to a sky the color of a wet cement wall. My phone said AQI 412. My little cousin's school had announced "outdoor PE as usual" at 7:40 a.m., and by 8:15 half the class was coughing in the playground.
Everyone acted shocked, but the smoke had not appeared out of nowhere. Somewhere in Punjab, two days earlier, a farmer had set his paddy stubble on fire because he had about two weeks to clear the field before sowing wheat. The wind took that smoke on a road trip straight to our lungs, and the whole journey was visible on satellites. Nobody told us, which felt like getting a spoiler for your own life after the movie ends.
That's when the question hit me: if the smoke is trackable, why are we only finding out when it's already in our house?
The idea: treat smoke like a delivery you can track
Think of your food delivery app. You don't find out your biryani exists when it knocks on your door. You see the rider, the route, the ETA.
I wanted that for smoke. Fires are the restaurant, wind is the rider, and Delhi is you, hungry and unaware. If I knew where the fires were and which way the wind was blowing, I could estimate the ETA of bad air. The pitch became: no more surprise AQI, just a heads-up with a countdown.
The plan (no cap, it's simple)
- Spot the fires. NASA's FIRMS satellite data pings fire locations every few hours.
- Check who's actually aimed at us. Not every fire matters. Only the ones with wind blowing toward Delhi count. I wrote an "upwind score" that weighs each fire by its size, its distance, and whether the wind is pointed at the city.
- Predict the pain. A LightGBM model uses that score plus weather and current PM2.5 to forecast the next 24 and 48 hours, with a range instead of one overconfident number.
- Tell humans in human language. Not "PM2.5 predicted 287 µg/m³" but "Keep kids indoors tomorrow morning. Skip outdoor PE."
Why this stack (I'm lowkey proud of this)
I had never touched AWS before, so I picked tools that wouldn't make me cry.
- Lambda runs my code only when needed, no server to babysit.
- EventBridge is the alarm clock that triggers it every three hours.
- S3 holds raw data and my model file.
- DynamoDB stores the latest forecast, no setup drama.
- API Gateway gives my web page a front door.
- SNS sends the alerts.
- Amplify hosts the site.
- SAM CLI let me build and test everything on my laptop before touching the cloud. It was the rizz of the whole stack: smooth and no surprise bills.
The best part is that it's all serverless, so it costs almost nothing while idle. A smoke alert shouldn't need a server running all year.
What fought back (it was a boss fight)
1. The wind is not a straight line. My upwind score uses one wind reading for all fires, but real smoke bends and wanders. It's a simplification, and I say so out loud in the demo. I'd rather be honest than fake.
2. The model looked like a genius until it didn't. My first results looked amazing, then I realized I'd split the data randomly, so the model had basically peeked at the future. I redid it by time, training on older seasons and testing on newer ones. The score dropped and the model became trustworthy. Painful, but worth it.
3. Satellites can't see through clouds. On cloudy days, fire data goes quiet and the app could falsely look calm. So I added a "data age" label so users know how fresh the info is.
4. AWS gave me main-character errors. Access denied here, CORS blocked there, a Lambda that timed out because it re-downloaded the model on every call. Each one taught me something: permissions live in the template, models load once outside the handler, and the console is region-specific.
5. SMS in India was a no. I wanted text alerts, but sending SMS to Indian numbers needs sender registration. So v1 sends email, and SMS and WhatsApp became the next-step slide in my video.
The moment it clicked
I replayed last November through the system. On the day the sky went full grey, my forecast would have lit up about a day and a half before. For the first time, the bad day had a warning label.
What it is (and isn't)
This isn't a magic shield. Stubble smoke is one cause, and Delhi also has vehicles, dust and industry. So the app reports a stubble contribution signal instead of pretending it explains everything. It won't clean the air. It gives parents, schools and outdoor workers something they've never had: time to prepare.
What's next
- More cities: Gurugram, Noida, Chandigarh.
- A school mode that gives principals a one-line call each evening.
- Hindi alerts, because warnings only work in the language people speak.
- Smarter smoke paths using trajectory models.
If one family keeps their kid inside on the right day because of a message that arrived early, the whole weekend was worth it. And honestly, that's the vibe: not just building cool tech, but giving people a head start on the thing that was always coming.
Built with AWS Lambda, EventBridge, S3, DynamoDB, API Gateway, SNS, Amplify and SAM CLI.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article