Copyright (c) 2022-2026 BitBank Software, Inc.
Written by Larry Bank
larry@bitbanksoftware.com
- Supports all of the power saving modes of the SCD40/SCD41/SCD43
- Simple C++ class with a minimum of methods
- Portable code runs on Arduino, Linux and esp-idf
I wrote this because the existing SCD41 libraries didn't do what I needed - specifically I wanted to communicate with the sensor on a random set of GPIO pins using bit banging. By using my BitBang_I2C library, this library can talk to the sensor in a more flexible way.
The SCD41 and SCD43 include a 'single shot' mode which allows triggering a single sample from idle mode. The sample takes 5 seconds to capture after being triggered. By triggering samples on an infrequent basis, the average power draw can drop well below 1mA. In idle mode the sensor draws on average 2mA. This is way too much for multi-month battery life, so it's necessary to put it in shutdown mode. NB: the last captured sample data will be discarded in shutdown mode. So... for lowest power usage it is necessary to trigger the sample, wait 5 seconds, then save the sample on the host CPU before shutting down the SCD4x.
If you find this code useful, please consider becoming a sponsor or sending a donation.
This project received funding through NGI Zero Core, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.


