I'm working on a low power monitor using an ESP32 and a CO2 sensor for my workshop, and I'm running into a wierd issue. I've set the whole thing up to go into deep sleep to keep the battery usage down, which is the main goal. Everything seems fine while it's awake and connected to my local server, but when the device wakes up from its sleep cycle, the CO2 sensor readings are just completley unstable for several minutes. I keep checking the serial output and it looks like the numbers are jumping all over the place before they finally settle down. I figured the sensor needs a moment to warm up, but it feels like it's taking way longer than the datasheet suggested. Does anyone know if there's a specific way to manage the power-up sequence or if I'm missing some critical setup step when using the sensor in a battery-powered setup?
Why is my CO2 sensor taking so long to give a stable reading after wake up?
Oct 29, 2026
Last reply: 10 hours ago
5 Replies
First reply
The instability you're seeing is almost certainly due to the sensor needing adequate time to stabilize after being completely powered off by deep sleep. Most chemical sensors don't just power up; they have internal heating elements or need to initialize their optics and…
Read the full replyThe instability you're seeing is almost certainly due to the sensor needing adequate time to stabilize after being completely powered off by deep sleep. Most chemical sensors don't just power up; they have internal heating elements or need to initialize their optics and processing unit, and that takes time. Reading the data immediately upon waking is like trying to read a gauge before the needle has settled after you flick it. If you're using a standard NDIR type sensor, the datasheet might list a quick power-on time, but that's usually for the digital communication to become available, not for the internal chemistry or heat sink to reach operational equilibrium. For reliable data, you usually want a wait period that is significantly longer than the minimum specification. It is defintely not just about the sensor warming up to a certain temperture; it is about its electronics settling.
Instead of just waking up and immediately running the reading function, you need to implement a careful power-up sequence. When the ESP32 wakes up, first turn on the sensor via its power pin, and then introduce a fixed delay. A good starting point might be waiting 30 to 60 seconds after the sensor power rail is asserted before attempting the first reading. This ensures the internal components have time to come up to temperature and settle its baseline.
If you are trying to minimize power usage, you might also consider keeping the sensor slightly powered on and just putting the ESP32 into a deeper sleep state while the sensor maintains its bias, though that changes the battery math considerably. For truly low power, the delayed start is your best bet for reliable data acquisition.
It’s true that the sensor needs time to settle, but I found that the power quality during that warm-up period often mattered as much as the waiting itself. I ran into similar issues when my workshop monitor started showing crazy noise, and adding a specific voltage regulator right to the sensor’s power rail made the initial data much cleaner.
Even if the ESP32 handles the timing perfectly, if the power supply is fluctuating when the sensor first fires up, you are going to see unstable output regardless of the delay. Try isolating the sensor's power supply and filtering the noise there. It’s a small component, but it can make a huge difference to the first stable reading.
I'm skeptical that the fixed delay is the main problem, even if settling time is involved. My tests showed that waiting a minute didn't necessarily fix the jumps; the instability was ussually worse right when the power rail transitioned. If the sensor is trying to pull a big spike of current when it powers up, it might be causing a voltage sag that messes with the ESP32's stability, regardless of the wait time. You should probably look into adding a capacitor or beefier power filtration right at the sensor's input to smooth that initial current draw instead of just guessing a time period.
I tried this setup last month and found that just waiting a minute wasn't the only fix needed. It wasn't just about the sensor coming up to temperature, but how the ESP32 handles the power transition itself. If you power the sensor right as the microcontroller restarts, the timing of the ESP32's internal setup might clash with the sensor's initial current draw. I found a lot of success just adding a hard reset sequence to the microcontroller after enabling the power rail for the sensor. That forces the ESP32 to reinitialize cleanly before the sensor starts talking. This usually cleans up the initial data spikes you see.
Update: adding a small regulator just for the sensor rail made a big difference, the numbers now hold steady after about 30 seconds instead of minutes. Still get a few junk readings right at the moment the ESP32 wakes though, which sounds like what you were saying about the power transition timing. Is there a clean way to hold the sensor powered thru sleep, or do I just throw away the first reading?
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required