GithubHelp home page GithubHelp logo

Return 0.0C and 0.0% about sht31 HOT 5 CLOSED

robtillaart avatar robtillaart commented on July 24, 2024
Return 0.0C and 0.0%

from sht31.

Comments (5)

Lucamenghini avatar Lucamenghini commented on July 24, 2024 1

Hi i solved using the sensor on other declared pins for I2C

#define PIN_SDA2 18 // SDA SECOND I2C SHT30
#define PIN_SCL2 19 // SCL SECOND I2C SHT30

I didn't understand why they could not use the same pins for I2C with different address and same clock....
But forcing sensor on other PINs declaring a second I2C then problem is solved.

The air baud rate is setted very slow otherwise 50% packets were lost
thank you
bye

from sht31.

Lucamenghini avatar Lucamenghini commented on July 24, 2024

Now I've updated to V.0.3.3 and the result of the SHT31_IsConnected is
00:04:14.254 -> SHT31_LIB_VERSION: 0.3.3
00:04:14.254 -> 8010
00:04:14.254 -> 40 4115 -45.0 0.0
00:04:15.243 -> 1044 3989 -45.0 0.0
00:04:16.264 -> 2048 3989 -45.0 0.0
00:04:17.255 -> 3052 3989 -45.0 0.0
00:04:18.266 -> 4056 3989 -45.0 0.0
00:04:19.291 -> 5060 3989 -45.0 0.0
00:04:20.285 -> 6064 3989 -45.0 0.0

from sht31.

RobTillaart avatar RobTillaart commented on July 24, 2024

Hi,
There are a number of possible problems, I always start my analysis bottom up, so at the hardware

Do you have pull up resistors?
What is the cable length?
Does the sensor get enough voltage?


SHT31_IsCOnnected.ino

The status returned = 8010 ==> https://github.com/RobTillaart/SHT31/readme.md (or datasheet)

This is the default value of the status register so it looks like you make the connection correctly
(change 1 in 65536 that you got this value just by random noise)

00:04:14.254 -> 40 4115 -45.0 0.0
00:04:15.243 -> 1044 3989 -45.0 0.0
00:04:16.264 -> 2048 3989 -45.0 0.0
00:04:17.255 -> 3052 3989 -45.0 0.0

The time between measurements is about 1 second and the read time is stable.
However it looks like there is some error during the read(), lets try to catch it.

Can you change loop() to

void loop()
{
  if ( sht.isConnected()  )
  {
    start = micros();
    bool b = sht.read();         // default = true/fast       slow = false
    stop = micros();

    int error = sht.getError();
    uint16_t stat = sht.readStatus();

    Serial.print(millis());
    Serial.print("\t");
    Serial.print(stop - start);
    Serial.print("\t");
    Serial.print(b, HEX);
    Serial.print("\t");
    Serial.print(error, HEX);
    Serial.print("\t");
    Serial.print(stat, HEX);
    Serial.print("\t");
    Serial.print(sht.getTemperature(), 1);
    Serial.print("\t");
    Serial.print(sht.getHumidity(), 1);
  }
  else
  {
    connectionFails++;
    Serial.print(millis());
    Serial.print("\tNot connected:\t");
    Serial.print(connectionFails);
    // sht.reset();
  }
  Serial.println();
  delay(1000);
}

from sht31.

RobTillaart avatar RobTillaart commented on July 24, 2024

@Lucamenghini
Any progress to report?

from sht31.

RobTillaart avatar RobTillaart commented on July 24, 2024

As there is no reaction I assume problem is solved, otherwise reopen the issue and provide more information.

from sht31.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.