I’m working on a project that includes a couple of SHT-31 temperature/humidity sensors; they are a great, reasonably inexpensive sensor with ± 2% accuracy, 0.1% repeatability and 0.01 % resolution for humidity and ± 0.3 ℃ accuracy, 0.06 ℃ repeatability, and 0.015 0.3 ℃ resolution. There is also a more accurate version the SHT-35. What drew me to it was the fact that it has proper I2C and two user selectable addresses.
The already ported Adifruit library works well but while considering writing some additional functions to take advantage some of the extra features I came across a much more fully featured library written by these people out of the UK, https://www.tindie.com/stores/closedcube/. For what it’s worth it’s also my favorite breakout for the sensor, the Adifruit one is nice, the ones I currently have are from China, and the orientation of the address pin is not ideal (see below)
to switch the address from 0x44 to 0x45 you need to jump the pin on the top right with the one on the bottom left.
In contrast, the ClosedCube one has jumpers
There is also a cutout around the sensor, I cannot find where Sensirion suggests this at the moment, but you can see on their dev board that they have included it.
Finally, ClosedCube has made it easy to add the filter cap if you need it.
I’ve “ported” the library over; I use quotes because all I needed to do was change the includes and add one or two type-casts from char * to uint_t* or something along those lines, I assume because of a small difference in how particle handles the Wire.H library.
There is a lot there, and I am going to go through the process of documenting it when I get the chance then share in the library manager, but I wanted to share it here first in case anyone with more experience writing documentation wanted to help. It’s pretty self-explanatory, but I figure documentation couldn’t hurt. I also will probably namespace the library to be safe.
For now, you can check it out at