this probably seems like a very basic question but here goes…
I purchased the Autonomo LoRA kit with grove temp sensor. All works fine except for the temperature sensor. It is marketed “v1.2” and the readings are about 2 to 4 degrees too high when compared against other sensors. Here is the code I’m using:
// settings for Grove Temp Sensor (v1.2) http://www.seeedstudio.com/wiki/Grove_-_Temperature_Sensor_V1.2
const int B = 4275; // B value of the thermistor
const int R0 = 100000; // R0 = 100k
const int pinTempSensor = A2; // Grove - Temperature Sensor connect to A2
int a = analogRead(pinTempSensor );
float R = 1023.0 / ((float)a) - 1.0;
R = 100000.0 * R;
float temperature = 1.0 / (log(R / 100000.0) / B + 1 / 298.15) - 273.15; //convert to temperature via datasheet ;
Right now it says the temperature in my office is 25.25 degrees and it is definitely not that hot.
I think it might be due to the above calculations based on a 5.0V reference.
float R = 1023.0 / (((float)a) * (3.3 / 5.0)) - 1.0;
I tried that. That is yielding temps of circa 10 deg while the ambient temperature is circa 22 deg.
Are these Grove sensors known to be pretty reliable?
If you have a look at the datasheet, the thermister is rated to within 1% accuracy. Additionally, the nonlinearity seems to be lowest around the 25C range. The ±1.5 degrees is at the extremes of its measurement range.
I believe the issue is to do with the differences between the ADC on the Autonomo and the Uno. The example code is designed with a 5.0V reference on a 10bit ADC. The Autonomo uses a 3.3V reference, and the default resolution might also be 12bit.
Can you try explicitly setting the read resolution to 10 bits:
Then if you could provide me with one or possibly a couple of readings. It would be useful to have the output from the example sketch, the expected temperature, as well as the raw analog readings.
Hi…i am a new user here. It seems the issue is to do with the differences between the ADC on the Autonomo and the Uno. The example code is designed with a 5.0V reference on a 10bit ADC. The Autonomo uses a 3.3V reference, and the default resolution might also be 12bit.