Grove temperature sensor 1.2

So I’m currently working on a project where i need to utilize body temperature to alter other variables. I have a v1.2 temperature sensor for grove, which seems to work fine, but i’m having some issues. I’m assuming the sensor has an analog output range of 0-1023, but looking at the thermistors temperature-to-resistance graph I’m noticing that it’s not linear, which makes sense.

What i’m wondering is how I can calculate the temperature from the output value, as I’m assuming I can’t just map it from 0 - 1023 to -40 - 125 and expect that to work. All help is appreciated :slight_smile:



-Aslak

Hi Aslak



We base on below graph from datasheet. then we come out the formula as below. thanks.



temperature = 1.0/(log(R/R0)/B+1/298.15)-273.15; // convert to temperature via datasheet



Great! Thank you :slight_smile: