SHT20 Strange behavior

Testing SHT20 sensor.
I run test with arduino mega 2560, the measurements are ok.
Currently in my room there is 17.32 degrees.

When I connect to cubecell board start reading 27.26 and after 2 minutes read 31.16.
always increasing.

Also if I only want to read temperature (I comment humidity) I get the error value for temperature -273.00.
This test pass on mega2560.

I attach proof screenshots and code.

/****************************************************************

  • ReadSHT2x
  • An example sketch that reads the sensor and prints the
  • relative humidity to the PC’s serial port
    ***************************************************************/

#include <Wire.h>
#include <SHT2x.h>

void setup()
{

pinMode(Vext, OUTPUT);
Serial.begin(115200);

}

void loop()
{
digitalWrite(Vext, LOW);
delay(50);

Wire.begin();

// Serial.print("Humidity(%RH): “);
// Serial.print(SHT2x.GetHumidity());
Serial.print(” Temperature1©: ");
Serial.println(SHT2x.GetTemperature());
Wire.end();

digitalWrite(Vext, HIGH);

delay(3000);

}

Which SHT library do you use?

@wasn hi, I use the embedded on framework (SHT2X) and also try the original Sodaq_SHT2x.
I try with include example:

https://github.com/HelTecAutomation/ASR650x-Arduino/blob/master/libraries/Sensor_ThirdParty/examples/SHT2x/ReadSHT2x/ReadSHT2x.ino

Hello again. Any update here ?

had no time to investigate.
but why not read both values and use only the temperature.
from the power consumption point it should not take much more.

@wasn hi yes I will do that, it’s only to show there is a strange behavior when I use cubecell.
With arruino I have no issues like I expose in this post.
I can’t use the sensor because the temperature value is fake.

I want to add:
I run test with this library: https://github.com/u-fire/uFire_SHT20

Now I can read SHT20 normally if I use VDD direct. If I use VEXT read sensor the first time after reset but after cut power and sleep when come to weakup again I cant read device.
(I am power again the device in the code of course)

the issue only is present when I power the SHT20 with VEXT after first sleep. If I power with constant VDD voltage the sensor are read fine

SOLVED.

I solve the issue https://github.com/u-fire/uFire_SHT20

Remove from setup()
pinMode(Vext, OUTPUT);
digitalWrite(Vext,LOW);
Wire.begin();
sht20.begin();

prepareTxFrame(){

pinMode(Vext, OUTPUT);
digitalWrite(Vext,LOW);
Wire.begin();
sht20.begin();

float temperature = (float)(sht20.temperature());
float humidity = (float)(sht20.humidity());
Wire.end();
digitalWrite(Vext,HIGH);

vext activation should not be done in the setup.
glad you have solved the problem

1 Like

Check this for my working sketch: Wrong temperature measurement with your demo