AWS Builder Center
How We Used AWS CDK & Serverless AI to Fix a Hidden Kilowatt-Hour Leak in Urban ACs

How We Used AWS CDK & Serverless AI to Fix a Hidden Kilowatt-Hour Leak in Urban ACs

An inside look at building Aero-Audit for the Bharat Builds Hackathon: tackling AC thermal short-circuiting using AWS Amplify, Lambda, and multimodal AI vision under strict latency constraints.

I’ve always noticed how outdoor air conditioner condensers in Chennai apartments are shoved into impossibly tight balconies, practically kissing the brick walls. But it wasn't until this weekend’s Bharat Builds Environmental Hacks that I realized the scale of the disaster.
The Problem When an AC unit is jammed into a 6-inch gap, it breathes its own hot exhaust air. This is thermal short-circuiting. The compressor panics, runs continuously at maximum load, and spikes power consumption by up to 30%. When you multiply that across thousands of residential buildings during a heatwave, you aren't just looking at high power bills—you are looking at massive, preventable strain on the urban electrical grid. We decided to build Aero-Audit to turn this physical airflow bottleneck into actionable data.
The Stack With a ticking clock, we couldn't waste hours clicking around a cloud console. We needed a serverless architecture that deployed fast and had zero cold-start waste.
AWS Amplify: We hooked this up to our GitHub repo for the React/TypeScript frontend. Pushing code and seeing it live globally in minutes kept our momentum alive.
AWS CDK (TypeScript): We used infrastructure-as-code to programmatically define our entire cloud backend. If we broke something, we could tear it down and reliably rebuild it without guessing.
Amazon API Gateway & AWS Lambda: API Gateway caught our REST endpoints and funneled spatial parameters to Lambda, which executed our thermodynamic calculation scripts and orchestrated the multimodal AI vision model.
Amazon DynamoDB: We needed a place to store our clearance penalty tables and dynamic regional electricity slabs without hardcoding them into the app.
What Fought Back Building a real-time vision and math engine on a serverless stack during a timed sprint meant hitting a few sharp walls. Around 2 AM, things started breaking.
  1. The API Gateway Timeout Wall Our first major roadblock hit when we tried testing the app with a real mobile camera photo. We were passing raw, full-resolution image payloads through API Gateway to Lambda for vision processing. API Gateway immediately choked and threw timeout limits. The Fix: We couldn't wait for heavy files to transfer. We built a client-side canvas compression function in React that aggressively crushed the image before encoding it to Base64. It slashed our request size by over 80% and brought end-to-end API response times under 4 seconds.
  1. The CORS and IAM Nightmare We configured custom HTTP headers across API Gateway and Lambda inside AWS CDK, but the moment we ran our first frontend integration test, our browser console lit up red with CORS pre-flight blocks. The Fix: AWS CDK is strict, which is a feature, not a bug. We had to dive into the CDK stack definition, explicitly define CORS response headers inside the Lambda integration response constructs, and attach strict, scoped IAM execution policies instead of relying on wildcard roles.
  1. Translating Pixels to TANGEDCO Slabs Detecting a "< 15cm airflow restriction" with AI is cool, but telling a user they have a 15cm restriction doesn't change behavior. We needed to translate that physical distance into cold, hard cash penalties. The Fix: We engineered a pricing engine inside Lambda. It takes the spatial restriction multiplier, queries the DynamoDB penalty matrix, applies it to the user's baseline kilowatt-hour consumption, and runs that final number through TANGEDCO's complex, multi-tiered progressive tariff structure.
The Impact By simply giving choked outdoor units room to breathe, Aero-Audit gives consumers a financial reason to fix their installations, which in turn cuts megawatt-scale demand on the grid. It’s a small physical fix, backed by a resilient AWS serverless cloud, that makes a measurable dent in urban emissions.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article