How to read float values from analog pin?

Hello,

i connected a TMP36 to my core. But the tinker app just displays “0” when try analogread. The problem is, the TMP give a Voltage as float (for instance 0.27 is 22C) which needs to be converted to C or F. The tinker app shows only integers and either requested via API there is only an “0”.

What to do?

thanks
Peter

Hi @klofisch,

analogRead should give a number between 0 and 4095. 0 corresponds to 0V and 4095 corresponds to 3.3V. If tinker app shows only zero, check your wiring and check you have connected the tmp36 output to an analog pin, and connected the 0V and 3.3V. Use a multimeter to check the voltage at the TMP36 output pin. What does it show?

Paul

1 Like