Main Content

Watchdog of high CO2 levels

I often work for hours in a close room so I got an idea to make my own appliance - my CO2 cube - to warn me if there are higher levels of CO2 in the room. Then it is the time to bring a fresh air in the room.

My portable CO2 cube contains:

- CCS811 sensor to measure the CO2
- pasive buzzer to make a sound if the CO2 level is high
- KY-001 temperature sensor
- OLED display 128x32
- push-button to show values on display
- 3.7V battery from an old mobile
- micro USB 5V Lithium Li-ion 18650 Battery Charger Module
- switch to turn ON/OFF my CO2 cube
The challenge of a portable arduino project is always about its consumption. To extend the battery life after charging there are following features:

- the measurement is every 4th second, during this time we put arduino to sleep
- we wake up CCS811 sensor only if we need a value from it, the rest time we put it to sleep
- the brightness of the OLED display is reduced
- if there are acceptable values of CO2, the OLED display is OFF, we can display values for a short time by pushing the button
- if values of CO2 are higher, the OLED display starts to show them permanently and we are warned by the buzzer. By pushing the button we can turn off or turn on the OLED display

The swith connects Arduino directly to the lithium battery to its 3.3V pin.

All the components are connected to this 3.3V pin of Arduino.

The code lower is divided into more sheets to be transparent. The sheet PIN_scheme describes easily how to connect all the components correctly.

If you copy the code, copy the CO2Cube sheet as the first code, then others.

The making of the box for my CO2 cube took a lot of fun. The only problem I had was, that if I closed the CO2 sensor in the box with a small hole, it showed very weird values. I had to leave the sensor outside in the air.”

Link to article