Twitter icon
Facebook icon
LinkedIn icon
Google icon
Reddit icon
StumbleUpon icon icon

CO2 levels monitoring and Airflow control using Wio Terminal

Added to IoTplaybook or last updated on: 12/24/2021
CO2 levels monitoring and Airflow control using Wio Terminal


Carbon dioxide (CO2) is the fourth most abundant gas in the earth's atmosphere. CO2 is a byproduct of normal cell function when it is breathed out of the body. It is also produced when fossil fuels are burned or decaying vegetation. Surface soils can sometimes contain high concentrations of this gas, from decaying vegetation or chemical changes in the bedrock.

We measure the CO2 level in ppm units. This number tells us how many parts of CO2 there are in one million parts of air. For example, if CO2 is at 800 ppm, that means in one million particles of air there are 800 particles of CO2.

Exposure to CO2 can produce a variety of health effects. These may include headaches, dizziness, restlessness, a tingling or pins or needles feeling, difficulty breathing, sweating, tiredness, increased heart rate, elevated blood pressure, coma, asphyxia, and convulsions.

The levels of CO2 in the air and potential health problems are:

  • 400 ppm: average outdoor air level.
  • 400-1000 ppm: typical level found in occupied spaces with good air exchange.
  • 1000-2000 ppm: level associated with complaints of drowsiness and poor air.
  • 2000-5000 ppm: level associated with headaches, sleepiness, and stagnant, stale, stuffy air. Poor concentration, loss of attention, increased heart rate and slight nausea may also be present.
  • 5000 ppm: this indicates unusual air conditions where high levels of other gases could also be present. Toxicity or oxygen deprivation could occur. This is the permissible exposure limit for daily workplace exposures.
  • 40,000 ppm: this level is immediately harmful due to oxygen deprivation.

In this project I built a simple and portable device using Seeed Wio Terminal which displays indoor CO2 level, temperature and percentage relative humidity on its LCD screen. When the CO2 level is exceeded by a set threshold value the inbuilt buzzer starts beeping and a 5V USB powered ventilation fan turns on to keep the circulation going and reduce CO2 levels. This device is useful especially during sleep when CO2 level can increase due to poor air circulation and can affect health.

This project was conceived by my own requirement in the bedroom where airflow was severely affected but I had no idea about it and after working on another data collection project it was revealed that the air circulation in the bedroom was not good and the CO2 level was increasing during the night.

Things used in this project

Hardware components

Wio Terminal
Seeed Wio Terminal
× 1 Seeed
Grove - Relay
Seeed Grove - Relay
× 1


Seeed Grove - CO2 & Temperature & Humidity Sensor - SCD41
× 1


Generic USB powered Fan
× 1  
Jumper wires (generic)
Jumper wires (generic)
× 1


USB Micro-B breakout (Generic)
× 1 SparkFun
USB A Femaleto Micro B Male Adapter
× 1  

Software apps and online services

Arduino IDE
Arduino IDE

Hardware Setup

We will be using Grove CO2 sensor (SCD41) for CO2 level measurement. The SCD41 from Sensirion is a high quality Photoacoustic based CO₂ sensor capable of detecting 0 to 40000ppm with high accuracy over 400-5000ppm ±(40ppm+5%).

To control a ventilation fan, we will be using Grove Relay which is powered by the 5V from the 40-pins Wio Terminal headers. A USB micro B breakout is used to connect the fan and power supply from the Grove Relay. The ground connection is taken from the Wio Terminal headers. The wiring diagram can be found in the Schematics Section.

Development Environment

The application is developed, compiled and flashed using Arduino IDE. Please download the latest Arduino IDE and follow the instructions to install from here: To install the Wio Terminal board library, open the Arduino IDE, click on File > Preferences, and copy below URL to Additional Boards Manager URLs:

Click on Tools > Board > Board Manager and Search Wio Terminal and click on install.

You would need to select the board and port using the Tools > Board menu.

To install library for the Grove CO2 Sensor (SCD41), click on Tools > Manage Libraries... to open Library Manager and search Sensirion I2C Scd4x and click on install.

We do not need to install any library for Grove Relay which is driven by Digital GPIO pins.


The code bundle can be downloaded from the Github repository. After downloading, unzip the bundle and open the Wio_Terminal_CO2_Monitor/Wio_Terminal_CO2_Monitor.ino sketch in the Arduino IDE and click on Sketch > Upload to compile/upload the firmware.


The sensor readings are updated to the Wio Terminal LCD display at 5 minutes interval. The free icon images for CO2, temperature and humidity were downloaded from Flaticon and were converted to X BitMap (XBM), a plain text binary image format, using Convertio.



This device has many other possibilities such as we can collect the time-series environmental sensor data and save them using inbuilt SD card module which can be used for further analysis of the CO2 levels trends or finding anomalies. It can be connected to the Cloud services using the inbuilt Wifi module.

I would like to thank SeeedStudio for manufacturing such a great choices of environmental sensors as a Grove module which is super easy to integrate into most of the development boards with Grove or Qwiic/Stemma connector using an adapter. Also, Wio Terminal is a beginner-friendly development board for quick prototyping.




metanav / WioTerminal_CO2_Monitoring

 Read More

Latest commit to the master branch on 11-11-2021

Download as zip




Bioinformatician, Researcher, Programmer, Maker, Tinkerer, Community contributor Machine Learning Tokyo

This content is provided by our content partner, an Avnet developer community for learning, programming, and building hardware. Visit them online for more great content like this.

This article was originally published at It was added to IoTplaybook or last modified on 12/24/2021.