Closed mguntli closed 6 years ago
@mguntli What's your progress on addressing the CI errors? I was about to implement the 'set_Humidity' function as documented in the SGP30 datasheet and could help with this request.
My implementation is according to the SGP30 datasheet (see function setHumidity). I have forked an own SGP30 library for the particle platform (https://github.com/mguntli/particle-lib-sgp30), and wanted to share back my additions with this pull request.
I would be happy if you could have a look at the CI errors, thanks for that!
Note: The approximation formula to get the absolute humidity [mg/m^3] based on temperature [°C] and humidity [%RH] is the recommended one from Sensirion SGP30 Driver Integration chapter 3.16 https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/9_Gas_Sensors/Sensirion_Gas_Sensors_SGP30_Driver-Integration-Guide_SW_I2C.pdf
with AH in g/m^3, RH in 0-100%, and t in °C
hiya just a note - if this isnt compiling, it wasnt tested & we wouldnt merge unless it was tested!
Ordered the breakout board because of the SGP30 setHumidity feature and was disappointed to not see it exposed yet. Branch author has setHumidity interface working on his own forked project but renamed the class. Just trying to get that function where more people can use it (also addresses #3).
I can confirm that I have tested the humidity compensation feature on my Adafruit SGP30, but only with my own fork of the library with different class naming (https://github.com/mguntli/particle-lib-sgp30/pull/1).
SGP30 and SHT31-D:
Absolute Humidity Values in mg/m^3:
All Values of SGP30 and STH31-D:
@ladyada Any chance you will merge this pull request?
it would need to be tested with a sensor and arduino...if you do that on this repo please let us know!
@ladyada I finally had time to test the code from his branch "mguntli:feature/adafruit-humidity-compensation" (using commit d5e793e5e0500feb442de5760b8b12b36b49848d) on a Huzzah ESP8266 (using Arduino IDE). It works without errors, both with the setHumidity function commented out (default in his sgp30test example) and with it using the given constant temp+humidity sample values. I also printed the boolean responses from readWordFromCommand to ensure the commands in setHumidity were working. Let me know if you want additional proof of my testing/verification! (Like do you also want it tested on an Arduino?)
sounds good! pulled :) thank you!!!
The SGP30 features an on-chip humidity compensation for the air quality signals (CO2eq and TVOC) and sensor raw signals (H2-signal and Ethanol_signal). To use the on-chip humidity compensation an absolute humidity value from an external humidity sensor like the SHTxx is required.