Closed felixNilo closed 3 years ago
Hello, I checked file sht21.cpp and it seams that reset function should work correctly, it only sends reset command using I2C and waits 15ms like it should according to datasheet.
https://github.com/e-radionicacom/SHT21-Arduino-Library/blob/master/SHT21.cpp#L39
Could it be that sensor isn't working properly?
Hello, I'm gonna close this now due to inactivity.
Hello. I'm working in a greenhouse automation system and using the SHT21 sensor in order to get the inside temperature and humidity. After several hours of getting measures, the sensor stops work sending the same measure, so I added a code block that reviews if is the sensor is sending the same measure. If is true I reset using the funcion of the library. I'm using Arduino DUE to read the sensor via I2C. The code block that I'm using to get the airTemperature is the following one:
` void getAirTemperature() {
The checkSensor funcion sned the measure to a buffer array as follows:
` void checkSensor(float measure) {
The isBugged function, review the buffer, if the buffer has the same values returns a true, in other case returns a false.
boolean isBugged() { //Serial.println("Checking"); for (int i = 1 ; i < 10 ; i++) { if (shtBuffer[i - 1] != shtBuffer[i]) return false; } return true; }
The logic is working, in fact, the arduino tries to reset the SHT via the function, but it does not work. I have seen that if I reset the arduino the SHT starts working again, or if I disconnect the sensor and reconnect again, the sensor also start working.
Maybe the resetting function is not working?
Thank you guys.