Inspiration
Rooftop solar and EVs are being adopted faster than residential grids were designed for. The problem isn't total energy use — it's timing: everyone plugging in their EV the moment they get home creates a sharp evening demand spike right as solar generation drops to zero, forcing utilities to lean on expensive, carbon-intensive "peaker" plants and driving costly grid infrastructure upgrades. We wanted to see how much of that spike could be eliminated with smarter scheduling alone, using nothing but existing hardware.
What It Does
GridBalance AI simulates a neighborhood of 10-60 homes, each with a randomized but realistic electricity demand profile, and optionally a rooftop solar system, a home battery, and/or an EV charger. It first computes a naive baseline: what grid demand looks like today, where EVs charge immediately at plug-in and batteries sit idle. It then runs a linear-programming optimizer that reschedules every battery charge/discharge decision and every EV charging session across the day — in 5-minute increments — to minimize the neighborhood's peak grid draw, while respecting every device's real physical limits (battery capacity, charge rate, each EV's total energy need and deadline). The result is shown live on an interactive dashboard: a before/after demand curve, solar utilization chart, and aggregate battery state-of-charge over the day.
In our test runs (30 homes, 50% solar adoption, 30% battery adoption, 35% EV adoption), the optimizer cuts neighborhood peak demand by roughly 55-60% — using the exact same devices and the exact same total energy needs, just smarter timing.
How We Built It Simulation layer (simulation.py): NumPy-based generation of per-house demand curves (morning/evening peaks with noise), solar generation curves (bell-shaped around solar noon with cloud noise), battery specs, and EV charging windows/energy requirements. Optimization layer (optimizer.py): A mixed time-coupled linear program, built with PuLP and solved with the CBC solver, that jointly schedules every house's flexible loads to minimize neighborhood peak demand subject to battery state-of-charge dynamics and EV energy/deadline constraints. Dashboard (app.py): A Streamlit + Plotly interface with live sliders for neighborhood size and solar/battery/EV adoption rates, headline impact metrics (peak reduction %, energy saved, estimated CO2 avoided), and three live charts. Challenges We Ran Into
Formulating battery and EV scheduling as a linear program (rather than needing a slower mixed-integer program) required careful constraint design — particularly avoiding simultaneous charge/discharge "cheating" in the LP relaxation and making sure the battery's state-of-charge dynamics were correctly chained across all 288+ time steps per house. Getting the solver to run in well under a second even at 40+ houses (each with dozens of time-indexed variables) took some care in how constraints were vectorized and pruned to only the relevant time windows per device.
Accomplishments We're Proud Of
The core result is a real, solved optimization, not a scripted or faked before/after comparison — the green "optimized" curve on the dashboard is the actual output of a linear solver running against the actual simulated baseline every time you click "Run." That's the difference between a demo and a system that would generalize directly to live IoT sensor feeds.
What We Learned
How directly a classic operations-research technique (linear programming) maps onto a real, current sustainability problem — the same mathematical structure used here is the backbone of real-world demand response and virtual power plant systems already being deployed by utilities today.
What's Next for GridBalance AI Swap the simulator for live data from real smart meters, EV chargers, and solar inverters via their existing APIs — the optimizer's input format is already compatible with real IoT sensor telemetry. Add electricity price signals (time-of-use/real-time pricing) as a second optimization objective. Extend to a multi-day horizon with weather-aware solar forecasting. Explore a "virtual power plant" layer that shares load-balancing capacity across multiple neighborhoods.
Log in or sign up for Devpost to join the conversation.