The left leg is 3.3v, the right leg is GND and the middle leg is an analog voltage representing the temperature of the following formula. TempC = (millivolts – 500) / 10
So 750 millivolts gives a temperature of 25 C
There seems to be some problems here. The temperature from the normal mercury thermometer is much lower than from the TMP36 and the readings are not very consistent – there is little jitter or noise.
The TMP36 sensor emits a voltage proportional to the temperature. This must be read by the A / D converter before the temperature is calculated. Let's read the voltage directly from the sensor's center leg with a multimeter and compare it to the result from A / D. The reading from the middle leg with my multimeter is 722 millivolts, much lower and a very stable reading.
There are two things we can try. Replace a potentiometer for the TMP36 and adjust the voltage in the calculation to the current voltage of the microcontroller. We then see if the calculated voltage is closer and if the noise / jitter is reduced.
Let's measure the current voltage used by my microcontroller and A / D. This was assumed to be 3.3v but is actually only 3.275v.