I took the liberty of splitting your post off to a new topic. It's good manners not to hijack other threads, and new topics are more likely to get noticed.
The temperature sensor simply reflects an analog reading of the thermister. as such there's no way to calibrate the sensor (which there can be with a more advanced sensor).
You have two options IMO: using the result from
CircuitPlayground.temperature() (temperaturF is based on that() or the raw
analogRead(CPLAY_THERMISTORPIN) (which is what temperature is based on).
Both involve taking readings with your trusted device throughtout the desired range alongside the CircuitPlayground's reading and writing a conversion function to produce an accurate value fro whichever type of reading you used.
For reference, here's the
temperature() function from the library:
Code: Select all
float Adafruit_CircuitPlayground::temperature(void) {
// Thermistor test
double reading;
reading = analogRead(CPLAY_THERMISTORPIN);
// Serial.print("Thermistor reading: "); Serial.println(reading);
// convert the value to resistance
reading = ((1023.0 * SERIESRESISTOR) / reading);
reading -= SERIESRESISTOR;
// Serial.print("Thermistor resistance: "); Serial.println(reading);
double steinhart;
steinhart = reading / THERMISTORNOMINAL; // (R/Ro)
steinhart = log(steinhart); // ln(R/Ro)
steinhart /= BCOEFFICIENT; // 1/B * ln(R/Ro)
steinhart += 1.0 / (TEMPERATURENOMINAL + 273.15); // + (1/To)
steinhart = 1.0 / steinhart; // Invert
steinhart -= 273.15; // convert to C
return steinhart;
}
My thought is that converting the result of
temperature() would be more straightforward and less work.
Dave