Skip to content

Monitoring CO2 levels, and temperature with an ESP8266 D1 Mini microcontroller and a Sensirion SCD40 CO2 sensor.

Notifications You must be signed in to change notification settings

alifeee/CO2-monitoring

Repository files navigation

CO2 Monitoring

Monitoring CO2 levels, and temperature with an ESP8266 D1 Mini microcontroller and a Sensirion SCD40 CO2 sensor.

To be connected to a time-series database like InfluxDB...

Screenshot of InfluxDB dashboard, showing "1,366 ppm" of CO2, 18.6℃ temperature, and 59.0% humidity.

...or used to manually probe data via the serial monitor...

screenshot of graph of CO2 over time

Sensor used

Sensirion SCD40 -> Sensirion_SCD4x_Datasheet.pdf

Microcontroller used

ESP8266 D1 Mini

Requirements

Platform IO for VSCode. Follow their guide to get started.

How to build

This is setup to use InfluxDB. First, set up an InfluxDB instance on a server following the guide.

Secrets file

Project secrets are stored in ./src/secrets.h. There is an example secrets file ./src/secrets.example.h.

This contains:

  • InfluxDB secrets (URL, organisationm access token, bucket)
  • WiFi secrets (SSID, password)

Build

  1. Select correct board (D1 Mini) with Platform IO.
  2. Build & upload with Platform IO
  3. Connect to COM Port with serial monitor

Plot data manually

Live-plot example data: use PuTTY to create a log file (putty.log), and use bash's watch to plot the data, e.g., using gnuplot/eplot - see guide.

About

Monitoring CO2 levels, and temperature with an ESP8266 D1 Mini microcontroller and a Sensirion SCD40 CO2 sensor.

Topics

Resources

Stars

Watchers

Forks