knowit / snappysense

3 stars 1 forks source link

Wait 3 minutes before reading AIR sensor #83

Closed lars-t-hansen closed 1 year ago

lars-t-hansen commented 1 year ago

In the sampling window (which then needs to be at least 3 minutes or ideally, until the AIR has been read), wait 3 minutes before reading the AIR sensor. The spec says that it has a warm-up time of "less than 3 minutes". It's not clear what the consquence is of reading it before the 3 minutes are up.

lars-t-hansen commented 1 year ago

As noted on #53, it may be useful to start paying attention to the status code of the AIR sensor, now that we understand why it doesn't come back up after sleep.

lars-t-hansen commented 1 year ago

Testing suggests that warm-up time after power-on is significantly more than 3 minutes, readings seem to be reasonably stable and plausible after 10 minutes, more testing needed, the window could be smaller. This is a very long time to be up if we're on battery, it means the device is on almost 15 minutes every time it wakes up. This is a big deal; power measurements suggest that the device draws about 140 mA when I2C and other peripherals are active, and only 40 mA when peripherals have been powered down.

I guess it might be possible to place the AIR device on a separate I2C bus and to warm it up while the rest of the device is still sleeping. Not great though.

lars-t-hansen commented 1 year ago

It looks like the warmup window can be kept to about 3 minutes after all, by repeatedly reading the sensor within the warmup window but discarding the readings. (Based on a simple experiment.)