Bf-021 is an open-source printed circuit board by smoca-ag, from the smoca-ag/m5stack_co2_sensor repository on GitHub. It is a 2-layer board of 50 × 50 mm with 12 parts on 25 nets, routed with 58 tracks and 3 vias.
It is built around the SCD40-D-R2. Its parts include 2 resistors and 1 connector. It belongs with the sensors and measurement boards of this library.
CO₂ levels measured indoors can be used as an indicator of air quality.
Outdoor air has a CO₂ ppm level of 400 ppm. Humans exhale air with 40000 ppm. You can calculate the percentage of exhaust air you are breathing by dividing measured CO₂ level above outdoor by the human exhaust level. Used air might contain aerosols which might contain the corona virus.
High indoor CO₂ levels also have an impact on the cognitive performance of humans.
Smoca AG decided to build this easy to reproduce CO₂ measuring device to help slow the spread of the corona virus in offices.
It supports its users in deciding when ventilating the room begin monitored is advisable. It also raises awareness for the correlation between CO₂ level and air quality.
Flash the main.cpp script to your M5 Stack Core2 with pio run -t upload --upload-port {your_device}. You can see a list of your devices with pio device list. Dependencies are installed automatically.
Features
Calibration
The SCD30 can be calibrated manually or automatically. For manual calibration, the device must be placed outdoors for at least five minutes. Then the calibration can be adjusted. Fresh air has a CO₂ concentration of about 400 ppm. To use automatic calibration, the device must have access to fresh air for at least one hour a day.
WiFi
To use MQTT, synchronization and update functionality the device must have internet connection. To add WiFi credentials the device opens an access point with a web interface (Default IP is 192.168.4.1).
Data sharing via MQTT
MQTT can be used to send the sensors data to a custom MQTT broker. Server, Port, Topic, Device name, Username and Password can also be configured in the web interface. Each minute the device sends its data in the following format: {TOPIC}/{CATEGORY} {VALUE}. Here an example: sensor/co2 650.
Topics are able to have subtopics: office2/meeting_room1/co2 1100.
The following categories are provided by the device: /co2, /humidity, /temperature.
Time synchronization
To keep time up to date the device synchronizes with a time server each night between two and three o'clock.
Firmware updates
Is a new firmware available, it can manually be updated via WiFi.
SNMP
Using SNMP you are able to read the values of the co2, temperature and humidity sensors and also check the battery status of the device:
First you have to make sure you have net-snmp installed on your system. You can do this using your package manager or by downloading it from http://www.net-snmp.org/download.html
Second you have to find out where your mib files are stored using the command net-snmp-config --default-mibdirs.
Then you have to copy the mib file from /snmp-mib/sensorhub.mib into one of the listed directories. e.g. cp snmp-mib/sensorhub.mib ~/.snmp/mibs
Done that, you can now use snmptable to list the sensors:
snmptable -m +SENSORHUB-MIB -c public {IP-Address} shSensorTable
Which should output the following:
text
or to list the measurement values:
snmptable -m +SENSORHUB-MIB -c public {IP-Address} shMeasurementTable
Which should output something like this:
text
SNMP table: SENSORHUB-MIB::shMeasurementTable
shMeasurementType shMeasurementValue
co2 617
temperature 207
humidity 433
voltage 3
electricCurrent 276
Usage
Disclaimer This is not a safety device. Always follow the local regulations regarding corona safety. No warranty is provided
Graphs
The graphs alway show the last six hours. Every line on the graph represents the measurement of one minute. The last value measured in the given minute is used for the graph.
To switch between different graphs (temperature / humidity / battery / co2) touch the corresponding value in the display
microsd
If a microsd card formated with fat is present, a csv file, data.txt will be written every 2 seconds with the timestamp, the co2 level, the humidity, the temperature and the current battery charge.
CO₂
level
color
description
< 600 ppm
blue
outdoor air
600 - 800 ppm
green
fresh indoor air
800 - 1000 ppm
yellow
indoor air, ventilate the room if possible, small possibility of virus transmission
1000 - 1400 ppm
orange
used indoor air, ventilate the room, cognition is impacted, possibility of virus transmission
> 1400 ppm
red
heavy used indoor air, heavy cognition impact, high possiblity of virus transmission, ventilation needed.
Extended uses (no code provided)
We use it at our office to control a couple of exhaust / inlet pwm computer fans to keep the CO₂ level below 800 ppm.
We log the measurement results to a influxdb with a grafana dashboard. The grafana instance sends alerts to telegram for CO₂ levels above 800 ppm.
SCD4x
There is a PCB in the PCB folder for SCD41 Support. The Code Supports transparently SCD40 and SCD30 at the moment.
Contact
If you have any suggestions for the project feel free to file an issue. If you want to build the device on a bigger scale / have any other development / prototyping needs, feel free to contact us: info@smoca.ch
License
Copyright (c) 2020 David Gunzinger / smoca AG www.smoca.ch
Code: GPL v3
Text / Graphics / Photographs: CC BY-SA
Battery-powered PCB that detects food spoilage in a fridge using a BME680 (VOC/humidity) and SCD40 (CO₂) sensor pair, an MSP430FR2355 MCU, and an IoT module header for phone connectivity.
60 parts1
Questions
How big is the Bf-021 PCB?
It measures 50 × 50 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Bf-021 use?
12 parts, built around the SCD40-D-R2. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the Bf-021 KiCad files?
From the smoca-ag/m5stack_co2_sensor repository on GitHub, at the commit this page was made from: the board is pcb/bf-021.kicad_pcb and its schematic pcb/bf-021.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Bf-021 design in my own project?
Its repository states no licence, so its author keeps all rights: ask smoca-ag before reusing the design.