RobTillaart / SHT31_SW

Arduino library for the SHT31 temperature and humidity sensor - using SoftWire

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

demo sketch fails for SHT85

RobTillaart opened this issue · comments

Test with sht85 fails, while expected to be compatible with sht31.

  • UNO
  • SHT85
  • SW(SDA = 6, SCL = 7)
  • 100KHz + 50KHz

See also - RobTillaart/SHT85#16 (comment)

Replacing the SoftWire library by SoftwareWire libray seems successful.

Need to confirm.

@MFahreza69

Confirmed to work with UNO

Looks good on UNO too. Compiling demo sketch
SoftWire.h => 9520 bytes + 593 RAM
SoftwareWire => 9004 bytes + 593 RAM

So the SoftwareWire has a smaller footprint too.

@ghaug
I am starting on a 0.2.0 version that uses SoftwareWire library.
As it is not much work I expect a develop branch later today.
If you have time could you verify if it still works for you?

@MFahreza69

Created a 0.2.0 branch with softwareWire.h and the build failed "all over the place".
Apparently the SoftwareWire is optimized for AVR (UNO/ MEGA).
This is a reason for me not to go ahead with the SoftwareWire library for now.

Development branch renamed to SoftwareWire-version-0.2.0-==-AVR-only

So more investigations are needed, which will be done later (no date planned).
To be continued.

created a new develop branch for future investigation.

When an SHT85 is connected (with 1K pull ups)

Preliminary observations

  • writing a command seems to work occassionally
  • requestBytes() fails in every call

SHT85 and/or SoftWire seem to be timing sensitive?

Made a patch version 0.1.1 that has the code for the AVR specific SoftwareWire in it.
Need time to investigate why SHT85 does not work, for now it has become low priority.

Just tested this with a SHT31 connected to ATTINY84 @ 1MHz with several I2C speeds and slow/fast reading mode.
SoftWire fails for me, SoftWarewire works.
Maybe add compile switch or #define to switch more easily between these libraries.

@alecks68
I'll makes a new issue from this one, to be continued.