Temperature Sensor v1.1 incorrect temp values

I have many Grove Starter Kits with v1.1 of the Grove - Temperature Sensor SKU: 101020015 & because a different thermistor has been used compared to the v1.0 twig, the equation for the temperature calculation now gives an incorrect value for temperature.

I have tried a few different temperature calculation equations as well as different B values after reviewing datasheets & no luck

Does anyone have a equation that generates the correct temperature values?

Thanks for writing to us.Did you try B value as 4250 in the equation?
Please let me know if it works.

Regards
Kavi

I’ve tried B values up to 5200 with little improvement.

The value obtained at room temp is around 5 degC & if the twig held to warm it up it only goes up to about 15 degC

I’ll try a few of the other twigs to see if it isn’t just an issue with the one I’m using

Just tried a few other twigs & all are giving the same but incorrect values.

I need to get my hands on a v1.0 (& v1.2) twig again & compare results - taking into account potential different values for B

I guess my question is - has anyone been successful in getting the correct values from using this version of the temperature sensor twig?

The code I’m using is the sample one from the wiki;

#include <math.h>
int a;
float temperature;
int B=4250; //B value of the thermistor
float resistance;

void setup()
{
Serial.begin(9600);
}

void loop()
{
a=analogRead(0);
resistance=(float)(1023-a)*10000/a; //get the resistance of the sensor;
temperature=1/(log(resistance/10000)/B+1/298.15)-273.15;//convert to temperature via datasheet ;
delay(1000);
Serial.print("Current temperature is ");
Serial.println(temperature);
}

We have updated the wiki for V1.1/V1.2
with new code,eagle files and data sheet.

Let us know if you still get incorrect values.

Thanks and regards
Kavi
Grove_Temperature_Sensor_V1_1.zip (770 Bytes)

Just tried the sketch but am getting the same results
5degC at room temp (actual 18degC)
15degC when sensor held in my hand (expect something around 30-36degC)

Can you please post a picture of your setup we will try to debug your issue.

OK have identified the problem

I used A0 for all of the tests

When I connected the temp sensor twig into A0 on a Lotus board - all worked perfectly - so thanks for creating the updated formula

When I used a Grove shield & plugged the twig into A0 we’d get the lower temp values.

It then dawned on me to look at the 3.3V-5V switch on the Grove shield & sure enough it had been bumped into the 3.3V position. Flicking it over to the 5V position & all working correctly!

Caught out by a trap for newbies

I’ve had students caught out with this 3.3V/5V switch not being set correctly on the Grove shields - just wondering if it would be possible to include a tri-colour LED indication near it so as to indicate which position it is in ie green for 5V & red for 3.3V in any updated versions?

Thanks for your suggestion.