OpenCO2 Sensor is an open-source indoor air quality sensor made in Germany. Measurements are displayed via an 1.54" E-Ink display, RGB LED in traffic light colors, or Wi-Fi, e.g., to Home Assistant. The Arduino code for the ESP32-S2 and Sensirion SCD40 is available here on GitHub.
Buy it here on Open-Sensor.com
Especially in winter, when windows stay closed, reminders to ventilate regularly help health and comfort. Poor indoor air quality can lead to lower productivity and learning difficulties. This open-source project helps you keep an eye on this at all times using the E-Ink display and LED. Take the small sensor with you wherever you go to monitor air quality – the battery life is up to 11 weeks.
Based on the SCD40 from Sensirion, a completely new, miniaturized CO2 sensor with photoacoustic measurement principle. The integrated, industry-leading humidity and temperature sensor delivers high accuracy with low energy consumption.
- Automatic self-calibration ensures maximum long-term stability
- CO2 measuring range: 400 ppm – 40,000 ppm
- Accuracy:
- CO2: ±(50 ppm + 5% of measured value)
- Temperature: ±0.8 °C
- Humidity: ±6%
1.54" in size with high resolution (200 x 200 pixels). Enables low power consumption and a wide viewing angle. Display refreshes every 5 seconds during normal operation; in battery mode it refreshes ~every 30 seconds.
For displaying air quality as a traffic light (green, yellow, red, magenta). Brightness and color are adjustable via the Menu.
Add this config to the configuration.yaml of your Home Assistant. Below Version 5.4 please change OpenCO2 to the IP address.
rest:
scan_interval: 60
resource: http://OpenCO2:9925/metrics
method: GET
sensor:
- name: "CO2"
device_class: carbon_dioxide
unique_id: "d611314f-9010-4d0d-aa3b-37c7f350c82f"
value_template: >
{{ value | regex_findall_index("(?:rco2.*})(\d+)") }}
unit_of_measurement: "ppm"
- name: "Temperature"
unique_id: "d611314f-9010-4d0d-aa3b-37c7f350c821"
device_class: temperature
value_template: >
{{ value | regex_findall_index("(?:atmp.*})((?:\d|\.)+)") }}
unit_of_measurement: "°C"
- name: "Humidity"
unique_id: "d611314f-9010-4d0d-aa3b-37c7f350c822"
device_class: humidity
value_template: >
{{ value | regex_findall_index("(?:rhum.*})((?:\d|\.)+)") }}
unit_of_measurement: "%"
Size: 4.9 x 3.8 x 2 cm
Press the Menu button on the back. Long press (≥1 s) selects, short press cycles to the next item. Choose between:
LEDcontrol color, brightness and when the LED should be enabled.Displaycan be inverted. Max battery charge percentage threshold. Also change the Temperature unit, language and font.Calibrateput the sensor outside for 3+ minutes (only run this, if calibration is needed).Historydisplay up to 24h of CO2, temperature and humidity as a graph. Values can also be exported via QR codes containing 1h of CO2 measurements each.Wi-Fienable or disable wireless connections. Setup via connecting to the Network "OpenCO2 Sensor".Infoshows MAC Address, serial numbers, uptime, version and battery details.Funlittle easter eggs
Enable Wi-Fi via the Menu button. When power is connected, an access point OpenCO2 Sensor is enabled. Connect to it and navigate to http://192.168.4.1 (it will open automatically on modern Smartphones). Insert your home Wi-Fi credentials under Configure WiFi. Choose your network name from the list in the top and insert the password. Click Save. The sensor will now be automatically connected. Navigate to openco2:9925 to see a graph of CO2, Temperature and Humidity measurements.

Connect the sensor to your Wi-Fi network and find out the IP of the sensor in your home network via the ui of your router or on the sensor itself via the button under Menu -> Info .
curl [IP]:9925/metrics
Result:
# HELP rco2 CO2 value, in ppm
# TYPE rco2 gauge
rco2{id="Open CO2 Sensor",mac="7C:DF:A1:96:B9:72"}571
# HELP atmp Temperature, in degrees Celsius
# TYPE atmp gauge
atmp{id="Open CO2 Sensor",mac="7C:DF:A1:96:B9:72"}25.37
# HELP rhum Relative humidity, in percent
# TYPE rhum gauge
rhum{id="Open CO2 Sensor",mac="7C:DF:A1:96:B9:72"}55.15
Use internet-pi to store the CO2 / Temperature / Humidity data on your Pi. First connect the OpenCO2 Sensor to your Wi-Fi network and follow the instructions https://www.youtube.com/watch?v=Cmr5VNALRAg Then download the https://raw.githubusercontent.com/davidkreidler/OpenCO2_Sensor/main/grafana_OpenCO2_Sensor.json and import it into Grafana.

- Download
FIRMWARE.BINfrom the latest release - Plug a data USB-C Cable
- Restart the OpenCO2 Sensor using the switch on the side
- Copy
FIRMWARE.BINto the USB device
- Download
FIRMWARE.BINfrom the latest release. - Enable Wi-Fi via the Menu button, in an area where no previously known network is active.
- Make sure that power is connected.
- Connect you PC/mobile to the WiFi network
OpenCO2 Sensorand navigate to http://192.168.4.1 - Under
Updateselect theFIRMWARE.BINfile and clickUpdate. - The Sensor will restart.

- Copy the esp32-waveshare-epd folder to your
Arduino/libraries/directory - Install the ESP32 support for Arduino IDE
- Choose
ESP32S2 Dev ModuleunderTools -> Board -> esp32 - Connect the Sensor via USB and flip the power switch to on while holding the button on the back
- Choose the new COM Port in the Arduino IDE under
Tools -> Port -> COMXX




