Home Air Quality Monitoring System

System overview of a personal IT project to monitor air quality at my house

See it running: https://aqi.markandrews.com.au/

The Problem


We moved close to a busy road and I wanted to know what the air quality was like. Why buy a commercial unit like Purpleair when you can do it yourself for double the cost in time!

The Solution: A Serverless IoT System


I wanted to use dotnet and C# for the backend so Azure was the natural choice, for Functions and CosmosDB document database. It could have just as easily been AWS Lambda + DynamoDB.

Architecture diagram

Architecture diagram showing the 3 tiers of the system: data collection, Azure backend, and Next.js frontend

Data Flow

  1. The Arduino polls the SPS-30 sensor every 10 seconds
  2. A JSON payload is sent via encrypted http POST to an Azure Function endpoint
  3. The function validates the API key, processes data, and stores it in Cosmos DB
  4. Scheduled aggregation jobs create optimised datasets for the frontend
  5. A Next.js application visualises the data through interactive D3 charts

Components & Costs

  • Sensiron SPS-30 Air Quality Sensor (AUD$60)
  • Arduino (microcontroller for data processing - AUD$60)
  • ESP8266 WiFi Module (AUD$30)
  • Azure backend - free tier (one CosmosDB free)
  • Vercel frontend - free tier