sparkfun / SparkFun_Indoor_Air_Quality_Sensor-ENS160_Arduino_Library

Other
2 stars 3 forks source link

Sensor does not need to be in Idle mode to update Temp/RH compensation #5

Closed kaysond closed 1 year ago

kaysond commented 1 year ago

Example 3 incorrectly says in the comments that you have to go into Idle to update temp/rh. Per an email conversation with a Sciosense AE, that is not the case (happy to forward it, if you'd like).

https://github.com/sparkfun/SparkFun_Indoor_Air_Quality_Sensor-ENS160_Arduino_Library/blob/d01ebc56643edec122226a0328f8ed4464a200f4/examples/example3_temp_rh_compensation/example3_temp_rh_compensation.ino#L64-L65

This can potentially cause confusion and issues if, like me, you want to regularly update the compensation values. The Status Flags for a brand new sensor starts at 2. The sensor has to be in operating mode for one hour for this flag to change to 0, and it has to be in that mode for 24 hours for the flag to get saved to non-volatile memory. If you go into Idle mode periodically (and unnecessarily) to update compensation values, then the flags will never change or get saved.

In my case, this caused a needless RMA.

https://github.com/sparkfun/SparkFun_Indoor_Air_Quality_Sensor-ENS160_Arduino_Library/blob/d01ebc56643edec122226a0328f8ed4464a200f4/examples/example3_temp_rh_compensation/example3_temp_rh_compensation.ino#L91-L99

I think it would be a good idea to update the example to remove the mode switch.

edspark commented 1 year ago

Yes you are absolutely correct. I double checked the datasheet and it specifically states that the relevant registers can be written "at any time". I really appreciate you taking the time to file an issue. Changes have been pushed and a new release will follow.

kaysond commented 1 year ago

Thanks!