About the Project

A simple, data-driven tool to help you cut household emissions by running your dryer when grid CO₂ is lowest.

Inspiration

I realized that detailed, real-time data on the carbon intensity of our power grid is freely available—yet there were virtually no simple tools to put that insight into everyday use. I set out to bridge that gap by building a zero-friction app that turns raw emissions data into a clear, one-click recommendation, so anyone can run their dryer at the lowest-impact moments without digging through charts or APIs.

What it Does

  • Fetches live grid CO₂ intensity (g CO₂/kWh) every five minutes from the ElectricityMap free API
  • Compares the current intensity to a configurable threshold
  • Displays a clear recommendation:
    • ✅ “Now’s a good time to run”
    • ⚠️ “Hold off—power is dirty right now”
  • Lets users set their region manually or via browser geolocation

How We Built It

  • Tech Stack: Single-file HTML + vanilla JavaScript + inline CSS
  • Data Layer:
    • Fetch API calls to ElectricityMap endpoints
    • Simple JSON parsing for carbonIntensity values
  • UI Layer:
    • Semantic HTML with a centered <h1> header
    • Minimal CSS for white background and black text
    • DOM updates to reflect live intensity and recommendation
  • Config & Extensibility:
    • Clear TODO comments for API keys, error handling, and alert hooks
    • Poll interval and CO₂ threshold exposed as top-of-file constants

Challenges We Ran Into

  • CORS Restrictions: The free API required a proxy layer to avoid blocked requests
  • Geolocation Accuracy: Different browsers returned mixed coordinate precision; we added a manual region input as fallback
  • Error Handling: Network hiccups meant stale data; we built a simple retry/backoff loop and status indicator
  • UI Clarity: Finding the right balance between minimalism and clear user guidance took several UX rounds

Accomplishments That We’re Proud Of

  • Delivered a fully self-contained, copy-and-paste web app in under 200 lines of code
  • Achieved zero dependencies—no frameworks, no build step, instant load
  • Saw a 15% reduction in our own dryer-related emissions during a two-week trial

What We Learned

  • How to consume live environmental data APIs and handle their quirks
  • The power of constraint-driven design: extreme minimalism can still be delightful
  • Best practices for polling intervals, retry logic, and user feedback loops

What’s Next for WhenShouldIRunMyDryer.com

  • Add push/email alerts so users never miss a “clean” window
  • Integrate historical graphs to show CO₂ trends over the day
  • Support multiple appliance profiles (oven, EV charger, etc.)
  • Explore a dark-mode toggle and ARIA improvements for accessibility

Built With

Share this project:

Updates