Low-power CO2 monitor
I started playing with electronics, especially but not limited to ESP32-based boards, and I find it interesting to try to minimise the power consumption for my projects. Apart from being fun, this opens up the possibility of turning my projects into being portable, battery-powered or even solar-powered.
My project is a CO2, temperature and pressure monitor that combines a SCD41 sensor with an Adafruit QTPy ESP32-C3 to drive it and to send the collected data over WiFi to a remote InfluxDB instance.
Choose the right components
The first step into building low-power systems is to choose the right components. This might seem obvious but getting it right is really important. When I started my project I only wanted to build a CO2 monitor and didn’t know I wanted to make it low-power and I could have made better choices.
SCD41 is a solid choice. It offers a "single shot" mode that gives us control over the measurement frequency. It also supports a "power-cycled single shot" that allows to completely power off the sensor between two measurements. Sensirion has a nice guide on the implications of these modes of operations that can be summarised with this excerpt:
Because the sensor requires one single shot measurement to stabilize after power cycling, the CO2 reading of the initial single shot after startup should always be discarded. This makes power cycled single shot operation preferable to idle single shot operation only when the average sampling period is above 380 seconds.
ESP32-C3 is a good choice when it comes to power efficiency but Adafruit was forced to make a decision between maximum efficiency and having a NeoPixel and (understandably) they opted to offer a board with features on-par with the rest of their QtPy line:
The ESP32-C3 does not have any spare pins so we could not add a NeoPixel power pin. The deep sleep current suffers for it but we think having a NeoPixel is so useful, its worth the current draw
If I wanted to optimise further I’d probably pick another board (maybe a Seeed studio Xiao ESP32C3) to still have WiFi connectivity, reuse all my existing code and get an integrated battery charging chip.
Pick a reasonable update frequency
I care more about general trends than about the precise CO2 values at any given instant. This allows me to set a data collection frequency of about a sample every 10 minutes. The rest of the time the device doesn’t have anything to do so it can spend as much time as possible in deep sleep.
Use radios as little as possible
Transmitting data over WiFi is the most power hungry operation my device does. An easy way to reduce power usage is to minimise the transmission time, for example, by batching updates together. The trade off here is a slight delay on when the server receives the data versus an improvement of the power efficiency.
Thanks for reading. Feel free to reach out for any comment or question.