AWS Builder Center
How I built SunSense: rooftop solar payback for any Indian home, on AWS Lambda in 3 days

How I built SunSense: rooftop solar payback for any Indian home, on AWS Lambda in 3 days

A 3D globe flies to your roof and tells you the solar size, cost after the PM Surya Ghar subsidy, your new bill and the payback year, with a PVGIS simulation running on AWS Lambda. Built for WeMakeDevs x AWS Environmental Hacks.

Final-year Electrical Engineering student, IEM Kolkata | Solar & renewable energy

The problem

Rooftop solar conversations in India stall on three questions: what size do I need, what will it cost after the PM Surya Ghar subsidy, and when do I get my money back? I built SunSense to answer them for any home, for the WeMakeDevs x AWS Environmental Hacks (Waste and Energy track).

What it does

Search an address and a 3D globe flies to your roof. Enter your monthly units and roof area, and SunSense gives the system size, cost after subsidy, new bill, payback years, CO2 avoided and a 25-year grid vs solar comparison, using real slab tariffs for 33 states and union territories.

Where AWS fits

The accurate numbers come from PVGIS, which blocks browser calls, so it runs on a small serverless backend in Mumbai:
API Gateway exposes /calculate and /pvgis with CORS and throttling. Lambda (Python 3.12, arm64) validates input and calls PVGIS and NASA POWER. S3 caches solar data per location. CloudWatch keeps the logs. One CloudFormation template, inside the free tier.

What I learned

Matching PVGIS exactly took the right inputs: for Kolkata, 1 kWp at 35 degrees now gives 1408.08 kWh a year, same as the official site. Only PVGIS-ERA5 covers India. A custom domain broke CORS until I fixed the API settings, so the app now explains failures in plain words and falls back to a quick estimate.

Try it

Live: https://sunsense.sagniknath.in
Code: https://github.com/sagnikvolt/SunSense
Demo: https://youtu.be/ps6ogEY2H48
Built with Claude (Anthropic) as an AI coding assistant.
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