Inspiration

Air pollution is among the largest environmental health risks, and the WHO cut its PM2.5 annual guideline in half in 2021. Low-cost sensors could fill the huge gaps between expensive reference stations, but their data is rarely trusted: calibration drifts, devices freeze, values spike, and nobody can prove a record wasn't changed later.

I wanted a system where a resident, a researcher and a city agency can all look at the same evidence and trust it.

What it does

AirTrust runs a mesh of 12 IoT sensors across Istanbul, on both sides of the Bosphorus (simulated in this prototype). Every 5 seconds they stream PM2.5, PM10, NO₂, O₃, temperature, humidity, wind, battery and signal. Residents add what sensors can't see by reporting smoke, burning, dust, industrial emissions, odors, traffic or heat.

Every reading then goes through an explainable AI engine. It checks physical limits, the sensor's own 24-hour history, its 30-day hour-of-day profile, its neighbours (spatial consensus), a multivariate Isolation Forest, frozen-firmware detection and calibration drift. The result is two separate scores, one for how unusual the air is and one for how much the sensor can be trusted, plus a plain-language explanation.

When several sensors agree, the AI opens an environmental event such as biomass smoke, an industrial emission, dust, traffic or a heatwave, classified from pollutant signatures and wind. Citizen reports are scored from 0 to 100 against nearby sensors using distance, timing, pollutant increase and wind. Events are verified at 80% confidence or more, otherwise they are dismissed.

To make the record trustworthy, readings are hashed and anchored on-chain every 30 seconds as a Merkle root, and verified events get their own proofs in the AirTrustLedger smart contract. A public verification portal lets anyone recompute a record's fingerprint and ask the contract whether it is authentic. If someone edits a single value in the database, the portal reports "Integrity check failed".

The platform also issues critical alerts with recommended actions, 1/3/6-hour forecasts and maintenance alerts for faulty sensors. A "How it works" page, a 2-minute guided demo and an embedded AI assistant make it easy to understand. The assistant answers questions like "Is it safe to run in Beşiktaş?" in English, Turkish or Portuguese, using only live data.

How I built it

The smart contract is written in Solidity 0.8.24 with Hardhat and ethers v6. It stores reading, event and Merkle batch proofs, verifies batch membership on-chain, rejects duplicate hashes and only accepts authorised submitters. It runs on a local Hardhat chain by default and is ready for Polygon Amoy.

The backend is a Node.js 22 HTTP API with a WebSocket gateway, built-in SQLite, JWT and scrypt authentication, five user roles, rate limiting, audit logs and OpenAPI/Swagger documentation.

The AI was implemented from scratch and tested: Isolation Forest, regression forecasting with daily-cycle features and confidence intervals, spatial consensus, drift tracking, event reasoning and report correlation.

The front end is a dark mission-control command center in vanilla JavaScript and Leaflet, with a live risk map, wind and event overlays, an AI activity feed, event timelines, the verification portal, a scenario simulator, a research API page and an admin console. It supports keyboard and screen readers, and risk is never shown by color alone.

The prototype ships with 30 days of simulated history (about 26,000 readings) including 7 past scenarios, verified events, citizen reports, a drifting sensor and an offline sensor, all clearly labelled as simulated.

Challenges I ran into

The first challenge was separating "unusual" from "untrustworthy". A single score couldn't tell a real smoke plume from a glitching sensor, so I split it into an anomaly score and a confidence score and let neighbouring sensors decide.

The second was making the blockchain meaningful, not decorative. One transaction per reading doesn't scale, so Merkle batching keeps every reading individually provable with one transaction per batch.

The third was deciding what to hash. Events keep evolving after verification, so I only hash the fields that are frozen at the moment of verification.

Accomplishments that I'm proud of

The whole flow runs end to end with one command: sensor, AI, event, citizen correlation, on-chain proof, alert and public verification. The tamper demo shows exactly what the blockchain guarantees: change one value and the check fails immediately.

The project has 22 automated tests (9 for the contract, 13 for the backend). Anyone can understand it in two minutes through the guided demo, and the AI assistant answers questions about the live data.

What I learned

Trust in climate data is really two problems: is the measurement right (AI, calibration, consensus), and is the record unchanged (cryptography)? Neither one alone is enough.

What's next for AirTrust

Next steps include connecting real sensor gateways and calibrating against reference stations from OpenAQ and Türkiye's national air-quality network. I also plan per-device signing keys, satellite fire and aerosol layers, SMS and push alerts with a mobile citizen app, federation between cities, and new modules for water, noise and urban heat.

Who it is for

AirTrust is built for residents and community groups, schools and universities, environmental NGOs, city governments, researchers and data scientists, and journalists.

It is designed to scale. A sensor connects with a single HTTP call, thresholds are configurable per city, and Merkle batching keeps blockchain costs flat as the network grows. Residents can report without technical knowledge, and researchers get a documented API and exports where every row carries its AI status, confidence and proof.

Track fit

AirTrust answers the Climate Data & Environmental Monitoring track: "Enable reliable and accessible climate data systems." Its data is reliable because every reading is checked by explainable AI, verifiable because every reading is covered by a blockchain proof anyone can check, and accessible through an open API and exports.

Links and credits

Code: https://github.com/estercpaulino2007/airtrust

Demo video: https://youtu.be/UFu0PNrAswI

All sensor data in this prototype is simulated and clearly labelled as such. Demo video narration: AI voice generated with ElevenLabs. Map tiles: Esri and OpenStreetMap contributors. Map library: Leaflet.

Built With

Share this project:

Updates

Submission history