sciosense / ens16x-arduino

Arduino library for the ENS16x digital metal-oxide multi-gas sensor family
https://www.sciosense.com/ens16x-digital-metal-oxide-multi-gas-sensor-family/
MIT License
6 stars 3 forks source link

Deep Sleep mode #2

Closed romaricr closed 3 months ago

romaricr commented 8 months ago

I've been dow ENS16x datasheet and this is not clear to me how to use deep sleep mode. My objective is to build a battery powered air quality device and one example would be great.

hal-patryk commented 8 months ago

In the Datasheet, Chapter 15 describes the state diagram (Figure 14), The short description there describe the DEEP SLEEP mode as a "low power standby" state. This mode is intended to shut down the sensor to minimize power consumption. So, all sensor resources are turned off and there is no gas sensing functionality. The ENS161 offers two “OPERATING Modes” for low power applications:

In both modes an algorithm runs in the background and takes care on a proper air quality index calculation. The two modes differ from each other in terms of sampling frequency, which results in differences in power consumption. The LOW POWER mode has a higher sampling rate (1 sample/minute). This higher sampling frequency allows the sensor to respond to short term events. and achieve a greater accuracy, than the ULTRA LOW POWER mode. In the ULTRA LOW POWER mode the sampling rate is 1 sample/5 minutes. This results in a much lower power consumption, but it may affect the sensor response to some short term gas events.

romaricr commented 8 months ago

Thank you so much for your fast answer. Actually, the state diagram was quite clear to me. But I was wondering about the behaviour of the chip once it has been set back to a Low Power or Ultra Low power mode. Should I wait for 2 minutes for the chip to warm up before any measure ? Or may be it’s not necessary ? I’m trying to reach very low power consumption. My other devices (temp, humidity,…) are able to have an average 100uA or below intensity on batteries. Coming back to my first question, I may try to post one example on this repository ?

hal-patryk commented 8 months ago

Once you set a ENS161 to a STANDARD, LOW POWER or ULTRA LOW POWER mode, then don't change the operation mode, this will ensure that the algorithm continued to calculate the AQI values. A jump form an "OPERATING mode" back to IDLE or DEEP SLEEP stops the algorithm and reset it's parameters. So, if you enter an "OPERATING mode" again the algorithm is going to start from beginning. This will affect you accuracy. In LOW POWER mode the first reading will appear after the 1 minute. To be sure that new data is available check the STATUS register (address 0x20). This first two least significant bits are set if new data obtained.