CO2 Gadget Low Power CO2 monitor with Lilygo TTGO T5 ePaper and Sensirion SCD41 Sensor

Last modified 3 weeks

One of the easiest ways to have an energy-efficient CO2 meter is to use the CO2 Gadget Advanced firmware in conjunction with a LilyGo TTGO T5 2.13″ LilyGo TTGO T5 2.13″ board with ePaper and a Sensirion SCD41 Sensor with CO2, temperature and humidity readings.

This combination is not the most energy-efficient possible, but it is very easy to replicate, with guaranteed results and parts are easy to source.

And while it may not be the most energy-efficient combination possible, it does offer you a simple way to up to three months of battery life on a single charge.

Incidentally, and this may seem obvious, but it is no less important: the effect of the e-ink display, with its excellent view is unbelievable.

The ESP32 Lilygo TTGO T5 board

The LilyGo TTGO T5 2.13″ LilyGo TTGO T5 2.13″ board is optimised for low power consumption and integrates a ESP32 microcontroller, a e-Ink display (ePaper, as the manufacturer calls it), the display controller and a battery charger, all integrated on a single board.

One of the best features of this board (along with its low power consumption and integrated battery charger) is that it includes a 2.13″ E-ink display.

The main advantage of e-ink displays is that they are able to keep the image on the screen without consuming power. That is: once we paint what we want on the screen, we can even cut the power supply and the image will continue to be displayed for months without any energy consumption.

Lilygo TTGO T5

The Sensirion SCD41 CO2 sensor

Until recently, buying an energy-efficient CO2 sensor was complicated (they were not easy to find) and, above all, expensive (they did not usually cost less than €60 or more).

CO2, temperature and humidity sensor Sensirion SCD41 Blue Plate

All this has changed with the advent of the Sensirion SCD41 Sensor and, above all, with the possibility of buying it very easily on sites like AliExpress at very interesting prices (about 20€ with shipping included). It is really good at measuring, flexible and its energy consumption is more than acceptable.

CO2 monitor build with TTGO T5 and SCD41

The assembly is really easy: You only need to connect the Sensirion SCD41 Sensor to the LilyGo TTGO T5 2.13″ LilyGo TTGO T5 2.13″ board via only four wires Can it get any easier?

The CO2 Gadget Advanced firmware

The CO2 Gadget Advanced firmware is probably the most complete and advanced maker firmware available.

This firmware can be installed on most ESP32-based CO2 monitors (I would say 99% of them), as is or with minimal modifications.

As it is Open Source and all its source code is published, you can adapt and modify it as you wish. If you are a programmer, or you are just curious, you can find the source code and much more information at the CO2 Gadget repository on GitHub.

I suggest you read the general post about CO2 Gadget to discover all its possibilities:

You can easily install it from the installer that you will find in the same article, with just a couple of clicks in your browser. No need to install anything on your PC.

As of 30 March 2024: The functionalities for the support of e-ink and low-power displays are currently under development, at an advanced stage, and are likely to be ready for beta testing in the coming weeks.

For more information, or if you would like to become a beta tester, visit the CO2 Gadget repository on GitHub.

CO2 monitor autonomy

The autonomy of this meter, the firmware CO2 Gadget Advancedis about three monthsdepending on how you configure it (based on your needs).

For example, with this fairly typical configuration: Every 5 minutes it takes a measurement of CO2, temperature and humidity, displays it on the screen and sends it via Bluetooth, (where it can be received on the mobile phone or you can introduce it into your home automation system as a Home Assistant with a Bluetooth Proxy to store and display the data): The estimated autonomy of the meter will be about 90 days.

Let's get a little technical (not to set a precedent):

Here is the consumption of the meter, with the above configuration, for 10 minutes of its life:

As you can see, most of the time it is sleeping, doing nothing, and every five minutes you can see in the graph that there is a consumption peak corresponding to the sensor measurement, the display on the display and the sending of data via Bluetooth.

Specifically, it is a continuous cycle consisting of 398.3 seconds of doing nothing and 8.618 seconds of measuring, displaying on screen and sending via Bluetooth (and then it starts again).

As calculating the battery life can be a bit tedious, we are going to make use of artificial intelligence and ask it what the battery life is with a prompt like this one:

Hello ChatGPT,
Can you help me calculate the battery life for my circuit?
I want you to calculate the cycles and the full autonomy time. Here is the information:
1. Duration of active operation of the circuit (in seconds): 7.8 sec
2. Duration of deep sleep of the circuit (in seconds): 398.5 seconds
3. Hourly consumption during active operating time (in mA): 28.16mAh
4. Consumption per hour during deep sleep time (in µA): 519uAh
5. Battery capacity (in mAh): 2500mAh

ChatGPT will instantly respond something like this:

Sure, I can calculate the battery life for your circuit with that information. Let's do the calculations:

Convert active and deep sleep durations to hours:

  • Duration of active operation: 7.8 \, \text{seg} = 0.00217 \, \text{horas}
  • Duration of deep sleep: 398.5 \, \text{seg} = 0.11069 \, \text{horas}

Calculate the total energy consumption during an operating cycle and deep sleep:

  • Total consumption during the cycle:
    • Duration of active operation: 0.00217 \, \text{horas} \times 28.16 \, \text{mA} = 0.0611 \, \text{mAh}
    • Duration of deep sleep: 0.11069 \, \text{hours} \times 519 \, \µA} = 0.05742 \, \mAh}
  • Total consumption during the cycle: 0.0611 \, \text{mAh} + 0.05742 \, \text{mAh} = 0.11852 \, \text{mAh}

Calculate how many full duty cycles and deep sleep cycles fit into the total battery capacity:

  • Battery capacity: 2500 \, \text{mAh}
  • Number of complete cycles: \frac{2500 \, \text{mAh}}{0.11852 \, \text{mAh}} \approx 21100.85

Multiply this number of cycles by the total duration of a cycle to obtain the total autonomy time:

  • Total autonomy time: 21100.85 \, \text{ciclos} \times (0.00217 \, \text{horas} + 0.11069 \, \text{horas})
  • Total autonomy time: 21100.85 \, \text{ciclos} \times 0.11286 \, \text{horas} \approx 2383.76 \, \text{horas}

Therefore, with a battery capacity of 2500 mAh and the provided run and deep sleep cycles, the estimated autonomy of the circuit would be approximately 2383.76 hours, or about 99 days and 7 hours.

Update 5 April 2024

I continue to work on optimising the energy efficiency of the meter.

My efforts over the last week have focused on reducing energy during the time the meter is "active".

With the new improvements in the code, the active time (under the same conditions as the previous test) has been reduced from 7.8 seconds to just 6.8 seconds and also the consumption during that time has dropped from 28.16mAh to 23.14mAh. Consumption in deep sleep has also decreased slightly, from 519uAh to just 378.90uAh.

To get the estimate, we asked ChatGPT again:

Hello ChatGPT,
Can you help me calculate the battery life for my circuit?
I want you to calculate the cycles and the full autonomy time.
Here is the information:
1. Duration of active operation of the circuit (in seconds): 6.8 sec
2. Duration of deep sleep of the circuit (in seconds): 398.5 seconds
3. Hourly consumption during active operating time (in mA): 23.14mAh
4. Consumption per hour during deep sleep time (in µA): 378.90uAh
5. Battery capacity (in mAh): 2500mAh

To calculate the battery life in cycles and the total autonomy time for your circuit, we need to consider the power consumption during active operation and deep sleep.

Step 1: Calculate total energy consumption per cycle

Consumption during active time (in mAh):

  • Active hourly consumption: 23.14 mAh
  • Active cycle time: 6.8 sec
  • Convert active duration to hours (6.8 sec -> hours): \frac{6.8}{3600} hrs
  • Total consumption during active time per cycle: 23.14 \, \text{mAh} \times \frac{6.8}{3600} hrs

Consumption during deep sleep (in mAh):

  • Consumption in deep sleep per hour: 378.90 uAh (or 0.3789 mAh)
  • Duration in deep sleep per cycle: 398.5 sec
  • Convert deep sleep duration to hours (398.5 sec -> hours): (\frac{398.5}{3600} hrs
  • Total consumption during deep sleep per cycle: 0.3789 \, \text{mAh} \times \frac{398.5}{3600} hrs
Step 2: Calculate total consumption per cycle

We add up the consumption during active time and deep sleep:

\text{Consumo total por ciclo} = \text{Consumo en activo por ciclo} + \text{Consumo en deep sleep por ciclo}

Step 3: Calculating battery life in cycles

\text{Battery life (in cycles)} = \frac{Capacity of the battery}} = \text{Total consumption per cycle}}

Step 4: Calculate total battery life in hours

\text{Total battery life (in hours)} = \text{Battery life (in cycles)} \times \left( \frac{Duration in active per cycle}}{3600} + \frac{Duration in deep sleep per cycle}{3600} \right)

Now we do the calculations:

Calculations:
  1. Consumption during active time per cycle (in mAh):
    23.14 \, \text{mAh} \times \frac{6.8}{3600} \, \text{hrs} = 0.0432 \, \text{mAh}
  2. Consumption during deep sleep per cycle (in mAh):
    0.3789 \, \text{mAh} \times \frac{398.5}{3600} \, \text{hrs} = 0.0418 \, \text{mAh}
  3. Total consumption per cycle (in mAh):
    0.0432 \, \text{mAh} + 0.0418 \, \text{mAh} = 0.085 \, \text{mAh}
  4. Battery life in cycles:
    \frac{2500 \, \text{mAh}}{0.085 \, \text{mAh}} = 29411.76 \, \text{ciclos}
  5. Total battery life (in hours):
    29411.76 \, \text{ciclos} \times \left( \frac{6.8}{3600} + \frac{398.5}{3600} \right) \, \text{hrs}
    = 29411.76 \, \text{ciclos} \times \left( \frac{405.3}{3600} \right) \, \text{hrs}
    = 29411.76 \, \text{ciclos} \times 0.11258 \, \text{hrs}
    = 3308.82 \, \text{horas}
Answers:
  • The battery life in cycles would be approximately 29,412 cycles.
  • The total battery life for your circuit would be approximately 3,308.82 hours.

Therefore, with a battery capacity of 2500 mAh and the provided run and deep sleep cycles, the estimated autonomy of the circuit would be approximately 3308.82 hours, or almost 138 days.

Full refresh of the display or "Full refresh".

I will now take the opportunity to expand on the information for the range calculation with something that I have only touched on in passing. To do so, I will go through the range update of 5 April 2024.

It should be noted that with e-Paper displays, a full refresh is required from time to time (at which point the display flickers, switching between black and white several times).

This update will depend (both in time and frequency) on the screen we use.

When a "Full refresh" is performed, the screen is occupied for a longer time than with a partial refresh, and consumes more energy.

In the examples we have seen, the screen did not do a full refresh.

Let's see, in terms of energy consumption, the difference between a partial and a full upgrade.

In the following consumption profile, you have a partial update followed by a full update:

As you can see at a glance, the partial refresh (the first one) is faster and more energy efficient than the partial or "Full Refresh" (the second one).

We look at each of the two separately, beginning with the partial update:

You can see that it lasts approximately 6.8 seconds and that its average power consumption is 23.11mA.

Let's look at the "Full refresh":

As you can see, the total update time is about 10.8 seconds and the average power consumption is about 15.98mA.

As the ratio between partial and full refresh cycles is configured by you, you will have to take it into account according to your preferences.

Note that the effective difference between the two periods is not as great as it may seem. One consumes more for less time and the other consumes less for more time. I invite you to do some quick calculations to see what the real energy difference is.

The shopping basket

LilyGo TTGO T5 2.13″ LilyGo TTGO T5 2.13″ board . Be careful because there are several boards that look very similar (they even say they are the same version, but they are not). Not all boards are supported by CO2 Gadget. This is the link where I bought it. Make sure you order the one that says "DEPG0213BN 9102 Chip".

CO2, temperature and humidity sensor Sensirion SCD41 Blue Plate

Sensirion SCD41 SensorThe last SCD41 I bought on AliExpress, in this link on March 20th and on the 28th I had it at home. It is a shop with many positive votes (4.8 stars) and that has been working for many years (it has been on AliExpress since 2012), so I don't think you will have any problems. Make sure you buy the one that says "SCD41 blue board".

3D printed box

If you have access to a 3D printer, I have adapted a 3D printed box for this project.

It includes a space to house the SCD41 sensor with air inlets and isolated from the rest of the case to avoid as much as possible that it is influenced by the heat emitted by the electronics and that the temperature measurements are not affected (or, at least, to reduce the effect).

You have two backs for the box. One is designed to fit an 18650 type battery and the other, with less depth, is for narrower batteries.

You can find it at Tinkercad to download or even modify it to suit your needs.

Leave a comment