UncleRus / esp-idf-lib

Component library for ESP32-xx and ESP8266
https://esp-idf-lib.readthedocs.io/en/latest/
1.37k stars 426 forks source link

Support for Sensirion STS3X #531

Closed slimcdk closed 1 year ago

slimcdk commented 1 year ago

Device name

STS3X

Device description

Device is a digital temperature sensor. It communicates using I2C.

Device product page URL

https://www.sensirion.com/search/products?q=STS3x

Datasheet URL

https://www.sensirion.com/media/documents/1C706A20/6164200F/Sensirion_Temperature_Sensors_STS3xA_Datasheet.pdf

Can the device be purchased at any of the followings?

URLs to purchase the device

https://eu.mouser.com/c/sensors/temperature-sensors/board-mount-temperature-sensors/?m=Sensirion&series=STS3x-DIS

Other implementations

No response

slimcdk commented 1 year ago

Pull request opened #532

UncleRus commented 1 year ago

Thank you!

UncleRus commented 1 year ago

Hmm... Did you check your PR on real device? The datasheet says that the raw data size is 3 bytes. And in your code, the raw data size is 6 bytes.

изображение

#define STS3X_RAW_DATA_SIZE 6

typedef uint8_t sts3x_raw_data_t[STS3X_RAW_DATA_SIZE];
UncleRus commented 1 year ago

I'm rolling back the merge of your PR until I get confirmation that the driver works with the actual device.

slimcdk commented 1 year ago

Sorry for the radio silence! Still have a bit of vacation left, so I'll explain what I have currently tested. You are right, that the size is only 3 bytes due to the lack of humidity compared to the SHT (which this implementation is an exact copy off). I have tested the driver with an ESP32-S3 and STS31 at 100 MHz and didn't encounter any issues for the week I have been using it.

I'll adjust the size allocation next week and test before submitting a new PR.

slimcdk commented 1 year ago

@UncleRus I have verified that the smaller allocation works.

slimcdk commented 1 year ago

Had some conflicts with the files were added and then removed from upstream, so I couldn't figure out to sync properly, so I made a new branch.

Driver is tested on real hardware and is reporting correct measurements.

UncleRus commented 1 year ago

Thank you. A new branch and a new PR is exactly what is required.