This is the (rather trivial) code for a simple LED-based CO₂ light meter (more or less a continuous CO₂ "traffic light") based on the following hardware components:
-
A Raspberry Pi or similar single board computer (SBC) with a 40-pin GPIO bar. In my case I first used an older Raspberry Pi 2B with an matte-black Pibow Midnight (Coupé) case which I bought in 2017 from Pimoroni. Later I used a Raspberry Pi Zero H with a 8086 Solderless Zero Dongle to be able to use it like a USB stick.
-
The Pimoroni LED Shim as LED bar.
-
The Pimoroni SCD41 CO₂ Sensor Breakout as CO₂ sensor.
-
One of following as socket for the CO₂ Sensor Breakout:
-
Optionally, if used with a fullsize Raspberry Pi, the Waveshare Raspberry Pi 400 GPIO Header Adapter to on the one hand turn the pHAT or HAT vertical (so I don't have to setup the Raspberry Pi vertically) and on the other hand allow to mount the LED Shim even if a case is used which encloses the GPIO pins to some height.
-
Optionally, if used with a Raspberry Pi Zero, either
-
the more recent Solderless Zero Dongle by 8086.net, or
-
the original ZeroStem which requires some soldering, but is more compact and still allows to attach a keyboard. (Also available at e.g. Pimoroni.)
-
The code in here is heavily based on two example scripts from Pimoroni's LED Shim and SCD4x Python libraries (which are needed anyways, too), namely on:
Since the code is heavily based on two scripts published under the MIT License, this code is licensed under the MIT License as well.
- Copyright 2017, 2018 Pimoroni Ltd.
- Copyright 2022 Axel Beckert