---
title: "IoT Air Quality Monitoring: A CO2 Case Study | Coding Delta"
description: "How we monitor CO2 in a large office building with LoRaWAN sensors, InfluxDB, Telegraf, Kapacitor and Chronograf to improve air quality and save energy."
canonical_url: "https://codingdelta.com/blog/optimizing-air-quality-monitoring-with-iot"
last_updated: "2024-07-08T00:00:00.000Z"
meta:
  "og:description": "How we monitor CO2 in a large office building with LoRaWAN sensors, InfluxDB, Telegraf, Kapacitor and Chronograf to improve air quality and save energy."
  "og:image": "https://codingdelta.com/content/images/cover-iot-air-quality.jpg"
  "og:image:alt": "Cover: 'Fresh air, measured.' with a CO₂ chart dropping below the safe limit and the LoRaWAN to InfluxDB stack"
  "og:image:height": "900"
  "og:image:type": image/jpeg
  "og:image:width": "1600"
  "og:title": "IoT Air Quality Monitoring: A CO2 Case Study"
---

> Index of every page on this site: [llms.txt](https://codingdelta.com/llms.txt)

[Journal](https://codingdelta.com/blog)

IoT architecture8 July 2024·3 min read

# **Optimizing Air Quality Monitoring with IoT: A Case Study**

How we use 100s of sensors to improve air quality.

![Cover: 'Fresh air, measured.' with a CO₂ chart dropping below the safe limit and the LoRaWAN to InfluxDB stack](https://codingdelta.com/content/images/cover-iot-air-quality.jpg)

A large office building had a problem with high CO2 levels. Our task was to bring them under control and, while we were at it, cut energy use. We built an IoT stack of LoRa sensors, Telegraf, InfluxDB, Kapacitor and Chronograf. It measures air quality continuously, alerts building managers the moment CO2 crosses a safe threshold, and gives them the data they need to run the building more efficiently.

## TL;DR

- **The problem:** high CO2 levels in a large office building.
- **The stack:** LoRaWAN CO2 sensors, The Things Network, Telegraf (MQTT), InfluxDB, Kapacitor and Chronograf.
- **The outcome:** CO2 levels kept within safe limits, and a reduction in peak energy consumption of 80% once building managers could act on motion and CO2 data.

## Project goals

The project aimed to:

- Gather and analyze air quality data continuously.
- Notify building managers when air quality changes.
- Reduce energy consumption significantly by turning the data into actionable insights.

## The technology stack

Sensor data flows through the stack like this:

**LoRaWAN sensors → The Things Network → MQTT → Telegraf → InfluxDB → Kapacitor (alerts) and Chronograf (dashboards)**

### 1. LoRa network: sensors across the building

- **Long-range communication:** LoRa transmits data over long distances with minimal power consumption, which made it a good fit for monitoring an entire building.
- **Deployment:** we installed LoRaWAN-enabled CO2 sensors throughout the building for full coverage and real-time data transmission to central gateways.

### 2. Telegraf: collecting the data

- **Data collection:** Telegraf agents gather the data from the LoRa sensors and feed it directly into InfluxDB.
- **Integration:** the MQTT input plugin moves the sensor data collected on The Things Network (TTN) into the central database, so the data is available in real time.

### 3. InfluxDB: time-series storage

- **Built for time series:** InfluxDB handles high-frequency, time-stamped data efficiently, which is crucial for continuous monitoring.
- **Data storage:** the database stores CO2 levels, temperature and humidity with precise timestamps, enabling detailed analysis over time and a review of historical data.

### 4. Kapacitor: real-time alerts

Kapacitor processes and analyzes the data in real time and notifies building managers instantly when CO2 levels exceed safe thresholds.

### 5. Chronograf: dashboards

Chronograf visualizes the data from all sensors, giving building managers a clear picture of what they need to do to keep air quality at the right level.

![Chronograf dashboard titled "CO2 Motion Visualization", showing time-series charts of sensor readings](https://codingdelta.com/content/images/chronograf.png)

## Results

- **Better air quality:** continuous monitoring and alerts to building managers kept CO2 levels within safe limits, contributing to a healthier indoor environment.
- **Lower energy use:** with notifications on motion and CO2 levels, building managers could manage the HVAC systems and reduced peak energy consumption by 80%.
- **Real-time insight:** the combination of LoRa, InfluxDB, Telegraf, Kapacitor and Chronograf made it possible to manage air quality and energy use proactively instead of reactively.

## Why this stack works

Each component does one job well: LoRa for connectivity, Telegraf for data collection, InfluxDB for data management, and Kapacitor and Chronograf for real-time alerts and visualization. Together they form a robust system that improved air quality and optimized energy use at the same time.

## Planning an IoT or automation project?

At Coding Delta we build custom IoT solutions around specific business needs, designed to be scalable and reliable. If you want sensor data to trigger alerts and actions automatically, see how we approach [**AI and automation**](https://codingdelta.com/automation), or use the button below to discuss your project with us.

## **Curious what this could do for you?**

We're happy to think along — over coffee on the Keizersgracht or on a video call.

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://codingdelta.com/#website","@type":"WebSite","description":"Boutique software studio in Amsterdam for web apps, platforms, mobile apps and AI agents.","inLanguage":"en-US","name":"Coding Delta","url":"https://codingdelta.com/","publisher":{"@id":"https://codingdelta.com/#identity"},"workTranslation":{"@id":"https://codingdelta.com/nl#website"}},{"@id":"https://codingdelta.com/blog/optimizing-air-quality-monitoring-with-iot#webpage","@type":"WebPage","dateModified":"2024-07-08T00:00:00.000Z","datePublished":"2024-07-08T00:00:00.000Z","description":"How we monitor CO2 in a large office building with LoRaWAN sensors, InfluxDB, Telegraf, Kapacitor and Chronograf to improve air quality and save energy.","name":"IoT Air Quality Monitoring: A CO2 Case Study","url":"https://codingdelta.com/blog/optimizing-air-quality-monitoring-with-iot","breadcrumb":{"@id":"https://codingdelta.com/blog/optimizing-air-quality-monitoring-with-iot#breadcrumb"},"isPartOf":{"@id":"https://codingdelta.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://codingdelta.com/blog/optimizing-air-quality-monitoring-with-iot"]}],"primaryImageOfPage":{"@type":"ImageObject","url":"https://codingdelta.com/content/images/cover-iot-air-quality.jpg","inLanguage":"en-US","contentUrl":"https://codingdelta.com/content/images/cover-iot-air-quality.jpg"}},{"@id":"https://codingdelta.com/#identity","description":"Boutique software studio in Amsterdam: strategy and scoping, product design, engineering (web apps, platforms, mobile) and AI & automation.","iso6523Code":"0106:77615999","legalName":"Coding Delta B.V.","name":"Coding Delta","url":"https://codingdelta.com","@type":["Organization","LocalBusiness","ProfessionalService"],"address":{"@type":"PostalAddress","streetAddress":"Keizersgracht 241","postalCode":"1016 EA","addressLocality":"Amsterdam","addressCountry":"NL"},"brand":[{"@type":"Brand","name":"Chatsome","url":"https://chatsome.co/","description":"AI agents for customer service and sales"},{"@type":"Brand","name":"Delta Security","url":"https://delta.codingdelta.com/","description":"Website security scans"},{"@type":"Brand","name":"RoundE","url":"https://rounde.nl/","description":"Employee participation for startups"}],"identifier":{"@type":"PropertyValue","propertyID":"KVK","value":"77615999"},"image":{"@id":"https://codingdelta.com/#/schema/image/1"},"knowsAbout":["Software development","Web application development","Product design","Mobile app development","AI agents","Business process automation"],"knowsLanguage":["en","nl"],"sameAs":["https://www.linkedin.com/company/codingdelta/"]},{"@id":"https://codingdelta.com/blog/optimizing-air-quality-monitoring-with-iot#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://codingdelta.com","position":1},{"@type":"ListItem","name":"Blog","item":"https://codingdelta.com/blog","position":2},{"@type":"ListItem","name":"Optimizing Air Quality Monitoring with IoT: A Case Study","position":3}]},{"@id":"https://codingdelta.com/blog/optimizing-air-quality-monitoring-with-iot#article","dateModified":"2024-07-08T00:00:00.000Z","datePublished":"2024-07-08T00:00:00.000Z","description":"How we monitor CO2 in a large office building with LoRaWAN sensors, InfluxDB, Telegraf, Kapacitor and Chronograf to improve air quality and save energy.","headline":"Optimizing Air Quality Monitoring with IoT: A Case Study","inLanguage":"en-US","thumbnailUrl":"https://codingdelta.com/content/images/cover-iot-air-quality.jpg","@type":["Article","BlogPosting"],"articleSection":["IoT architecture"],"author":{"@id":"https://codingdelta.com/#identity"},"image":["https://codingdelta.com/content/images/cover-iot-air-quality.jpg"],"isPartOf":{"@id":"https://codingdelta.com/blog/optimizing-air-quality-monitoring-with-iot#webpage"},"keywords":["IoT architecture"],"mainEntityOfPage":{"@id":"https://codingdelta.com/blog/optimizing-air-quality-monitoring-with-iot#webpage"},"publisher":{"@id":"https://codingdelta.com/#identity"}},{"@id":"https://codingdelta.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://codingdelta.com/og-image.png","inLanguage":"en-US","url":"https://codingdelta.com/og-image.png"},{"@id":"https://codingdelta.com/#logo","@type":"ImageObject","caption":"Coding Delta","contentUrl":"https://codingdelta.com/logo.png","inLanguage":"en-US","url":"https://codingdelta.com/logo.png"},{"@id":"https://codingdelta.com/#organization","@type":"Organization","logo":"https://codingdelta.com/logo.png","name":"Coding Delta","url":"https://codingdelta.com","address":{"@type":"PostalAddress","streetAddress":"Keizersgracht 241","postalCode":"1016 EA","addressLocality":"Amsterdam","addressCountry":"NL"},"sameAs":["https://www.linkedin.com/company/codingdelta/"]}]}
```

## Sitemap

See the full [sitemap](https://codingdelta.com/sitemap.md) for all pages.
