Per spec. sheet… Scale Factor, TMP36 −40°C ≤ TA ≤ +125°C 10 mV/°C
The TMP35/36 is 10 mv/C
The TMP37 is 20 mv/C
Your formula:
// gain = 20 mV/Deg C <----- ???
int mv = sensor.Read() - 500; // 500 = 0c <---- ???
return mv / 20f;
My formula:
mv = sensor.Read(); // temp C = mv / 10 mv/C
return mv / 10;
My formula for the TMP35/36 seems to work and measure correctly?