adafruit / Adafruit_Si7021

Arduino library for Adafruit Si7021
34 stars 28 forks source link

Add CRC8, add SHT2x support #8

Closed stickbreaker closed 3 years ago

stickbreaker commented 5 years ago

This is output from an ESP32 with a SHT25 (controlEverything.com SHT25 Rev.D)

Si7021 test! Found model SHT25 Rev(1) Serial #4146979B1510080 Humidity: 22.99% Temperature: 26.11 Humidity: 23.11% Temperature: 26.11 Humidity: 23.19% Temperature: 26.11 Humidity: 23.19% Temperature: 26.11

This code is untested with Si70nn devices. I do not have any available for testing.

stickbreaker commented 5 years ago

Corrected output

Si7021 test! Found model SHT25 Rev(1) Serial #4146979B01510080 Humidity: 22.16% Temperature: 26.63 Humidity: 22.16% Temperature: 26.64 Humidity: 22.20% Temperature: 26.65 Humidity: 22.44% Temperature: 26.65

ladyada commented 5 years ago

we wont be merging until someone tests with Si7021 thanx!

d235j commented 5 years ago

@stickbreaker it looks like the implementation of the calcCrc() method is missing? I get a link error; this should not link even for SHT2x as-is.

stickbreaker commented 5 years ago

@d235j Yea, copy paste error when I manually made a patch branch. That's what I get for assumptions. It should work now. but, I'm not in a position to test it. Please try it.

Chuck.

d235j commented 5 years ago

@stickbreaker @ladyada Seems to work correctly with Si7021 now. I don't have an SHT2x — @stickbreaker any chance you could test it with that sensor?

stickbreaker commented 5 years ago

@d235j I have tested it , and it is working with a SHT25, I don't have SHT20 or SHT21. The datasheet says they are interchangeable, except they have lower accuracy. So. I don't expect any any problems with them.

Chuck.

ladyada commented 5 years ago

hiya would this be a better addition to https://github.com/adafruit/Adafruit_SHT31 ? maybe the same family, has more similarities

caternuson commented 3 years ago

Agree that this repo does not seem like a good place for hosting SHT2x support. The SHT2x is made by Sensirion. The Si7021 is made by Silicon Labs.

Closing for now. If the CRC check is something still desired, can resubmit a new PR based on latest library updates.