This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LMT70EVM: convert Digital output of ADC to temperture in °C

Part Number: LMT70EVM
Other Parts Discussed in Thread: LMT70

Hello , i use LMT70 with the ADC of STM32 , in debugging mode i obtained 1330 as digital output of the adc , i tried to convert it firstly to an analog voltage :

1330/2^12 = 0.32 (resolution of 12-bits)

0.32*5v= 1.623v = 1623mv    because  Vref=5v

then i used the second order formula in page 13 of the datasheet which is T(°C) = a Vtao ^2 + b Vtao + c  and i replaced vtao with 1623mv but i obtained a weird result which is -105.2 °C lol

Please i need your help !!!

  • Hello Bastian,

    Do you have a schematic of your setup that you can share? Or if you can take a reading of the LMT70 output voltage directly, with a multi meter or another device, that would tell us whether the problem was on the sensor side or the ADC side. 

    I suspect that your MCU may have a separate pin or another supply that provides the ADC reference voltage. If your reference were actually 3 volts for example, you would be reading a temperature of about 26 C. 

    Best Regards,
    Brandon Fisher

  • Hi Mr Brandon , firstly thank you for your reply , yes you're right , when Vref is 3v the result become perfect for the place in which i made the measure , maybe vref is 3v as you said but i don't know how to be sure .

  • Bastian,

    Do you have a complete part number for your STM32 MCU? The datasheet or reference manual for the micro-controller should specify if it has an internal voltage reference available for the ADC, or if there is an external pin that another voltage reference may be supplied to (probably called VREF or something similar).

    Best Regards,

    Brandon Fisher

  • I am using STM32F429i-Disco which contains ARM cortex m4 micro-controller  , i found the datasheet of the MCU and i found this into it , so it means that Vref = Vref+ and 1.8<vref<3.6 ? so what value should i choose ?

  • Bastian,

    Because you are using their evaluation kit and the MCU is already on board they have likely selected Vdda for you. In the case of your kit, the schematic on page 29 of this document seems to indicate that Vdd is 3V provided that JP3 is connected. 

    And on page 32 of the same document it shows that Vdda and Vref+ are both connected to Vdd. So the ADC reference voltage on this kit does appear to be 3V. So you are actually reading a temperature of around 26 C. 

    Excellent work getting the ADC on this device up and running. Since the STM32 is not a part we are familiar with, I would recommend checking through the schematic of the kit just to confirm for yourself that this is the correct reference voltage, but I hope this solves your issue. 

    Best Regards,
    Brandon Fisher

  • Ok i will check it but I think this schematic confirm that the correct referance voltage is 3v , yes your explication and your clarifications solved my issue . Thank you very much Mr Brandon , you're amazing , i can't find the words to thank you <3