Nan Values for the "hum" and "temp" Variables for Soil Sensor V2.2


#1

I’m trying to use your esp-soil-moisture-sensor.ino sourced from here and when I serial print the following variables:
Serial.println(hum);
Serial.println(temp);

It prints the following lines:
nan
nan

Do note that if I do:
Serial.println(soil_hum);

It prints values in the 900s which I can only assume are correct.

I have the Soil Sensor V2.2 board and have not adjusted the code, other than the two serial print lines. Do you know why this occurs and how I can fix it?

In addition, what do the values in the 900s mean? Is it a measurement of some sort of the humidity, for example water concentration and if so, what what is the unit of measurement?

Thanks


#2

Please try this sketch instead


#3

Thanks. It worked. Greatly appreciate it!