This is an extension for the MagicMirrorÂē.
It monitors CO2 level from SCD-30 sensor and draws a chart for a few last hours.
-
Navigate into your MagicMirror's
modulesfolder -
Clone repository
git clone https://github.com/Yours3lf/MMM-SCD-30 -
Go to newly created directory
-
Execute
npm installto install the node dependencies.
If you got error, try to execute
npm install chartjs
-
Connect the SCD-30 to your Raspberry Pi. See command:
pinout -
Make sure to enable I2C interface via raspi-config. Look for 0x61 on Bus 1. Check using
sudo apt install i2c-tools && i2cdetect -y 1 -
Make sure to mark the scd_30.sh script as executable:
sudo chmod +x scd_30.sh -
Make sure your user running magicmirror is in the i2c group (eg. user called pi):
sudo usermod -aG i2c pi
| Raspberry Pi | SCD-30 |
|---|---|
| 3.3V DC power | VIN |
| GPIO2 SDA1 | SDA |
| GPIO3 SCL1 | SCL |
| GPIO4 GPCLK0 | skip |
| Ground | GND |
https://learn.adafruit.com/adafruit-scd30/python-circuitpython
Add it to the modules array in the config/config.js file:
modules: [
...
{
module: 'MMM-SCD-30',
position: 'bottom_right',
config: {
updateInterval: 100 //seconds
}
},
...
]Configurations properties
| Property | Description |
|---|---|
titleText |
Type string, Default value Home weather |
updateInterval |
Type int, Default value 100, Minimal value 10, Wait interval between readings of sensor values in seconds |
-
python3(should be installed on Raspberry Pi) -
adafruit-circuitpython-scd30(Python library for the readings, installed the first time scd_30.sh runs )
- Navigate into your MagicMirror folder
- Run .sh script
./modules/MMM-SCD-30/scd_30_.sh(If script doesn't run, add exec parameter to it)sudo chmod +x modules/MMM-SCD-30/scd_30_.sh. - Script should print sensor values like this
566- that meansCO2 PPM in air

