Plotting Carbon Dioxide Levels With the Pimoroni Enviro+ FeatherWing and Adafruit SCD-30
Introduction: Plotting Carbon Dioxide Levels With the Pimoroni Enviro+ FeatherWing and Adafruit SCD-30
The Pimoroni Enviro+ FeatherWing has a wide range of sensors onboard and a connector for the optional Plantower PMS5003 particulate matter sensor. This FeatherWing board uses most of the pins on a Feather board but the i2c bus offers an easy way to add more sensors like the Sensirion SCD-30 for measuring atmospheric carbon dioxide.
In 2020, there was an increased interest in carbon dioxide levels inside buildings and enclosed spaces as it serves as a good indicator of poor ventilation, air-conditioning recirculation and over-crowding. This led to several projects:
* Montreal Gazette: Worry over ventilation in Quebec schools led one family to create a homemade carbon dioxide test also on Makezine: Plan CO2: Montreal Dad Makes a CO2 Monitor for His Daughter’s Classroom
* Make Magazin (Germany): Der CO2-Warner für die Schule (The CO2 warning for schools)
* Adafruit Learn: RGB Matrix Portal Room CO2 Monitor
This short article shows how to connect the Adafruit SCD-30 to an Adafruit Feather nRF52840 Express and an enhanced Pimoroni plotter program. The setup of the Enviro+ FeatherWing is covered in a previous article.
Many Adafruit boards now have a STEMMA connector or a (smaller) STEMMA QT connector. Unfortunately, the Feather nRF52840 Express board predates these connectors. A breadboard is used in this article to connect to the STEMMA QT connector on the Adafruit SCD-30.
The FeatherS2 board is a great Feather board with a STEMMA QT connector but unfortunately its ESP32-S2 microcontroller has unusual analogue to digital converters which can only measure 0V to 2.6V, rather than the full range of 0 to 3.3V. This makes it a poor choice for the Enviro+ FeatherWing as it cannot read the trio of (analogue) gas sensors properly.
Supplies
The items from Using the Pimoroni Enviro+ FeatherWing With the Adafruit Feather NRF52840 Express plus:
* Adafruit SCD-30 - NDIR CO2 Temperature and Humidity Sensor - STEMMA QT / Qwiic
* STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable - 150mm Long
* Breadboard
Step 1: Adding a Library and Upgrading the Plotter Program
If you are not familiar with CircuitPython then it's worth reading the Welcome to CircuitPython guide first.
If you are setting up the Enviro+ FeatherWing for the first time then follow the instructions in the Installing CircuitPython and Combined Plotter Example step of Instructables: Using the Pimoroni Enviro+ FeatherWing With the Adafruit Feather NRF52840 Express. 152
The additional steps/differences are:
1. Install this extra library from a bundle from https://circuitpython.org/libraries into the lib directory on the CIRCUITPY drive:
1. adafruit_scd30.mpy
2. Download the enhanced combined plotter example program to CIRCUITPY by clicking Save link as... on plotters_combined_with_scd30.py
3. Rename or delete any existing code.py file on CIRCUITPY, then rename the plotters_combined_with_scd30.py to code.py. This file is run when the CircuitPython interpreter starts or reloads.
The versions used for this guide were:
* CircuitPython 6.2.0
* CircuitPython library bundle adafruit-circuitpython-bundle-6.x-mpy-20210413.zip
* EnviroPlus-FeatherWing library Version 1.0
* pimoroni_circuitpython_adapter library 9-Dec-2020 f062036
Step 2: Connecting the SCD-30
The connections from the Feather board to the STEMMA QT on the Adafruit SCD-30 are:
* 3V - VIN (red),
* Gnd - GND (black),
* SCL - SCL (yellow),
* SDA - SDA (blue).
An i2c bus needs pull-up resistors on the SDA and SCL lines. 991