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?
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);
}
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)
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!
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?