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);


void loop()
digitalWrite(Vext, LOW);


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

digitalWrite(Vext, HIGH);



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:

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:

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


I solve the issue

Remove from setup()
pinMode(Vext, OUTPUT);


pinMode(Vext, OUTPUT);

float temperature = (float)(sht20.temperature());
float humidity = (float)(sht20.humidity());

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