Sensirion / gas-index-algorithm

Sensirion's Gas Index Algorithm provides a VOC and NOx Index output signal calculated from the SGP40/41 raw signals

Home Page:https://sensirion.github.io/gas-index-algorithm/

Repository from Github https://github.comSensirion/gas-index-algorithmRepository from Github https://github.comSensirion/gas-index-algorithm

Low Power implementation SGP41

peter3099 opened this issue · comments

Hi guys

We are using SGP41 together with ESP32(ESP-IDF framework) and everything is working fine for powered devices.

Now we are looking into implementing the SGP41 on low power mode. The ESP32 has an ULP(ultra low power processor) that runs while the uC is in deep sleep, this ULP can comunicate usign i2c but is is limitated in what it can do since it is programmed in assembler and has a set amount of memory avaiable.

Our workflow would be the following

uC goes to deep sleep -> ulp reads values from SGP41 every certain time(1s or 10s) and saves the SRAW values -> after 5 minutes uC wakes up from deep sleep retrieves those values and inject them in the algorithm.

Firstable is this viable? Can the SRAW values be injected as a "batch" once the uC is preparing the sample?

Do you have any experience with best approach to implement SGP41 with ESP32 or similar uC?

Thanks
Regards
Pedro

Hi @peter3099

Thanks for using our sensors.

Your described approach should work fine. There is no way to directly provide a collection to the algorithm, so you will have to feed the values one by one but the algorithm should still work as long as the sampling interval is the same over all the measurements.

Regarding ESP32, we usually use an ESP32 board to test our Arduino drivers but I have no experience with the ULP.

Hope this still helps!

Hi @sdmueller

Thanks for that, so basically I can feed all the data at the same time sequentitally provided that I sample it with the correct time range?

So basically when I wake up the uC I just do a loop of GasIndexAlgorithm_process(&voc_params, sraw_voc, &voc_index_value); with all the values I got with the ULP, correct?

In terms of desing for the ULP workflow should be

  1. Request a first measurement to turn the heater on
  2. Wait for the heater to reach temperature 170ms
  3. Request the actual measurement
  4. Turn the heater off
  5. Wait another X seconds for the next sample

Like in this example
https://github.com/Sensirion/gas-index-algorithm/blob/master/examples/raspberry-pi/low_power_example.c

Can I just power off the sensor in between samples?

Thanks and sorry for all the questions, we are trying to plan well what would be needed in order to reduce the amount of assembler we need to do

Regards

Hi @peter3099

Yes, you can follow the low power example.

Powering off the sensor in between samples should also be possible. Just be sure to then also account for the startup time of the sensor so you still have a constant sampling interval.

Perfect, thanks @sdmueller. I'll close the issue for now!