Comments (5)
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.
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.
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.
@Lucamenghini
Any progress to report?
from sht31.
As there is no reaction I assume problem is solved, otherwise reopen the issue and provide more information.
from sht31.
Related Issues (13)
- Exposing the raw temperature and humidity? HOT 6
- SHT31 library two I2C interfaces: example, advice needed HOT 31
- Add lastHeaterStopTime variable to prevent switching on the heater too early HOT 2
- isConnected returns true if voltaje to SHT31 is not connected. HOT 4
- SoftWire library + SHT31 library HOT 23
- prototype for 'bool SHT31::begin(uint8_t, uint8_t, uint8_t)' does not match any in class 'SHT31' HOT 6
- Using SHT31 in High Humidity Environment HOT 9
- check SHT2x functions added HOT 1
- Heater HOT 5
- SHT31 library with Arduino-ESP32 v2.0.5 HOT 8
- support Wire2 for ESP32
- Question on i2c error handling HOT 23
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sht31.