-->
Page 6 of 6

Re: Help with esp8266 sketch please: SHT21 temp/humid sensor

PostPosted: Mon Jan 04, 2016 3:32 am
by schufti
obviously the sensor isn't found.

This could be due to
a) wrong pins used (NodeMCU has different notation)
GPIO0 --> D3 GPIO2 --> D4
b) bad i2c implementation
there were issues with AM2321 too, see here:
viewtopic.php?f=32&t=4483&p=26342#p26342
c) other problems e.g. i2c speed, try i2c-scanner

Re: Help with esp8266 sketch please: SHT21 temp/humid sensor

PostPosted: Thu Mar 24, 2016 1:34 am
by Kaz260
You should use "No hold mode". I think it will work fine.

CODE:
typedef enum {
eTempNoHoldCmd = 0xF3,
eRHumidityNoHoldCmd = 0xF5,
} HUM_MEASUREMENT_CMD_T;

float SHT2xClass::GetTemperature(void){
float value = readSensor(eTempNoHoldCmd);
...
}

float SHT21xClass::GetHumidity(void) {
float value = readSensor(eRHeRHumidityNoHoldCmd);
...
}