Case Study

Real-Time AQI
Data-Driven
Motion Dashboard

A motion system built in After Effects that connects to live APIs, calculates EPA-standard air quality values, and updates its interface every minute — with no plugins required.

by Shuvra Sengupta
Instagram LinkedIn Portfolio
Role
Motion Designer / Technical Motion Systems Developer
Time Frame
20/02/2026 – 22/02/2026
Project Type
Live Data-Driven Motion System
Adobe After Effects Node.js OpenWeather API JSON AE Expressions
AQI Dashboard — Paris, Good
01 / Overview

Beyond static animations —
building a motion system driven by real data.

This real-time AQI dashboard integrates live APIs with After Effects, computes EPA-standard air quality values, manages timezone complexity, and dynamically updates its interface every minute. The goal wasn't just animation — it was building a reliable, data-driven motion framework.

A motion dashboard built in After Effects that connects to a live API and visualizes real-time Air Quality Index (AQI) data for any city in the world. It dynamically fetches data, calculates standard AQI values based on real pollutant concentrations, updates every minute, and smoothly animates visuals — all with no plugins required.

Live Mode Auto

Automatically fetches from the OpenWeather API and updates the dashboard every minute — no manual input needed.

Demo Mode Manual

All values controlled via sliders in After Effects. Great for teaching, presenting, or testing edge cases interactively.

02 / Motivation

Why I Built This

Most motion dashboards are pre-rendered, static, or purely mockups — great for visuals, but limited in real-world applicability. I wanted to explore something different.

I wanted to explore:

03 / The Result

A fully functioning, real-time AQI dashboard that can:

Fetch live data for any city in the world
Calculate EPA-standard AQI using pollutant concentrations
Handle timezones correctly per city
Refresh automatically every minute
Smoothly animate all visual values
Switch between demo and live data modes
Be presented interactively in workshops
Live Demo — City Switch in Action
City Change Live Demo

Type city → press Enter → dashboard updates instantly

Dashboard Screenshots — Live Data
Paris AQI 7 - Good
Delhi AQI 140 - Unhealthy
Chad AQI 240 - Hazardous
Paris AQI 7 - Good alternate
04 / Context & Problem

I wanted more than just an animation.
I wanted a tool.

The dashboard needed to:

Unlike typical motion projects, this required real back-end thinking, data-flow logic, and live connectivity.
JavaScript — AQI Calculation
// ================ AQI CALC ================
function calculateAQI(concentration, breakpoints) {
  for (let bp of breakpoints) {
    if (concentration >= bp.C_low && concentration <= bp.C_high) {
      return Math.round(
        ((bp.I_high - bp.I_low) / (bp.C_high - bp.C_low)) *
        (concentration - bp.C_low) +
        bp.I_low
      );
    }
  }
  return 0;
}
05 / System Architecture

How it Works

Below is the simplified architecture that drives the entire system:

🌐
OpenWeather API Geocoding + Weather + Air Pollution endpoints
Node.js fetch.js Fetches data, computes EPA AQI, handles timezone offset
{ }
Writes aqi_data.json Structured JSON file placed in the project directory
Ae
After Effects imports JSON File reference auto-refreshes on each render tick
⟨/⟩
Expressions drive UI Every layer, color, scale, and label reads from JSON values
Dynamic, live dashboard Updates every 60 seconds automatically
06 / Technical Deep-Dive

Key Technical Components

01

API Integration with Node.js

To fetch data from OpenWeather, the Node.js script chains three API calls:

  • Geocoding API → city name → latitude/longitude
  • Weather API → timezone offset
  • Air Pollution API → pollutant concentrations

The script then writes a structured JSON file for After Effects to consume.

JSON — Example Output
{
  "city": "Tokyo",
  "aqi": 66,
  "pm25": 19.4,
  "pm10": 46.21,
  "no2": 7.99,
  "o3": 103.77,
  "timestamp": "2026-02-23T22:30:21.000"
}
02

Real AQI Calculation — EPA Standard

OpenWeather's built-in AQI scale (1–5) didn't align with real-world weather apps. So I implemented official EPA AQI logic:

  • Calculated real AQI from PM2.5 & PM10
  • Took the maximum as the final AQI value
  • Used official EPA breakpoints
  • Allows accurate comparison to phone app values
EPA AQI Basics for Ozone and Particle Pollution

This turns raw pollutant concentration into meaningful, standardised numbers.

Color Category AQI Range Health Impact
GreenGood0–50Air quality is satisfactory
YellowModerate51–100Acceptable; some risk for sensitive groups
OrangeUnhealthy for Sensitive101–150General public not likely to be affected
RedUnhealthy151–200Everyone may experience effects
PurpleVery Unhealthy201–300Health alert for entire population
MaroonHazardous301+Emergency conditions
03

Timezone Logic

A surprisingly complex challenge: the API gives timestamps in UTC and only one server chain — but we wanted city-local time, not viewer local time.

To fix this:

  • Get timezone offset via Weather API
  • Adjust the UNIX timestamp in Node script
  • Format the timestamp correctly in JSON
  • Avoid timezone re-conversion in AE
Result: Tokyo post-API shows Tokyo local time, not India time.
04

Hybrid Demo + Live Mode

To make this workshop-friendly, the system supports two fully-functional operating modes:

Demo Mode Manual
  • You control all values via sliders
  • Great for teaching and live presentations
Live Mode Auto
  • JSON pulls real data from API
  • Works automatically without manual input
Demo Mode — Bangalore · AQI Progression
AQI 0 Good
AQI 58 Moderate
AQI 106 Unhealthy
AQI 222 Hazardous
Good · 0 Moderate · 58 Unhealthy · 106 Hazardous · 222
05

User Interaction — Hybrid Toolkit

Instead of restarting scripts each time, the Node script was converted into a persistent interactive loop:

  • 🖊 Type city → press Enter
  • 🔄 Fetch immediately
  • ⏱ Refresh automatically every 1 minute
No waiting. No restart. Smooth flow for live demos.
07 / Problem Solving

Challenges & Solutions

🔧 Challenge 1 — Matching Real AQI With Weather Apps

OpenWeather's built-in AQI scale didn't match apps like Apple Weather.

Solution: Used real EPA formula with pollutant concentration → accurate AQI values.
🔧 Challenge 2 — Timezones

Timestamps were inconsistent:

  • API returned UTC
  • After Effects converted to viewer local time
Solution: Fetched city timezone offset from Weather API and computed local time entirely in Node.
🔧 Challenge 3 — After Effects Caching

AE sometimes cached an old JSON file, displaying stale data.

Solution: Ensured the JSON reference was re-imported, implemented purge cache logic, and corrected file paths.
08 / Design System

Visual Design Details

* Color-Linked System

The scale, indicator, and refresh dot all inherit consistent AQI color logic — every visual element reacts to the same data source.

Green AQI — Good
● Green
Red AQI — Unhealthy
● Red
Every visual element — scale fill, badge color, refresh dot, character mask — all inherit from the same single AQI expression.

* Human Character + Mask

A human character element reacted automatically to the AQI logic — showing visual health stress in unhealthy zones and clear appearance in clean air conditions. The mask opacity, color, and overlay all drive from the same AQI expression.

Character reacts to AQI — no mask → light mask → full mask
AQI 7 Good — no mask
AQI 7 · No mask
AQI 140 Unhealthy — light mask
AQI 140 · Light mask
AQI 240 Hazardous — full mask
AQI 240 · Full mask
09 / Roadmap

What's Next

Ideas for expanding this system further:

Add AQI trend graph over time
Add other APIs (marine traffic, weather, etc.)
Build UI wrapper on Node for non-terminal input
Publish as open toolkit on GitHub
Internal dashboard prototype for operations
10 / Watch & References

Demo Video

Credits / References