Visualize data in real time from your Sensirion CO2 sensor!
-
Download the “Arduino IDE”
-
Install the Sensirion library called "Sensirion I2C SCD4x"
-
Select the "ESP32 Dev Module":
Tools > Board > esp32 > ...
-
Select the right port of your board
-
Load a demo file to test it out:
File > Examples > 01. Basics > BareMinumum
-
Press the arrow to flash your ESP32. As soon as you establish a connection, hold the boot button, then press the reset button once.
-
Connect the sensor to the ESP32 as shown here or here:
First connect ground and power pins from sensor to the ESP32 and then connect the other cables to any pin you want.
The green cable is the SDA (in the image below we have chosen pin 4) and the yellow cable is the SCL (in our case we have chosen pin 2).
-
Connect to the ESP32 from your PC after the sensor was connected to it
i. - Choose
File > Examples > Sensirion I2C SCD4x > exampleUsage
.
ii. - AddWire.begin(4, 2);
after thewhile (!Serial)
loop.
iii. - Press the arrow in the top left corner to Upload.
iv. - As soon as you establish a connection, hold the boot button, then press the reset button once - voila! -
Establish a serial connection and read the live data stream using terminal based tools or a lightweight C library.
- Attach the ESP23 microcontroller and the sensor to your Linux PC (not Windows or MacOs, also Windows-WSL doesn't work because peripherals from the
/dev
path don't get emulated correctly). - You may need to update the path to your device in
backend/main.c
. - In the
backend
directory run thebuild.sh
script and then execute themain
executable to run the backend. - Then open up the
js_frontend/index.html
file and enjoy the sweet real time visualization!