Skip to main content
Graduate II
September 18, 2023
Solved

ADC error

  • September 18, 2023
  • 4 replies
  • 5964 views

I have connected 100k NTC  with 100K PU resistance. ADC is measuring voltage on NTC is 1580 mV. While multimeter shows 1410 mV. 1410mV is correct number as it gives 32 degC  temperature.

I am using ADC in polling mode. I added HAL_ADCEx_Calibration_Start also and ADC measurement changes to 1650 mV. 

please suggest on how to remove error. 

 

    This topic has been closed for replies.
    Best answer by ONadr.1
    For high-impedance temperature sensors, connecting a ceramic capacitor (capacity of 1uF-10uF) in parallel to the analog pin and analog GND has worked very well for me. It is the best to place the capacitor as close to the pin as possible. The time consatnt is quite high, but the temperature response of the sensor is usually slower.
     

    4 replies

    Super User
    September 19, 2023

    With a high impedance source, increasing the sampling time to max is going to have the largest effect.

    Many more general suggestions can be found in:

    https://www.st.com/resource/en/application_note/an2834-how-to-get-the-best-adc-accuracy-in-stm32-microcontrollers-stmicroelectronics.pdf

     

    Graduate
    September 19, 2023

    If maximum sampling time isn't adequate (or you need to convert faster), connect the signal to an op amp then the op amp to the ADC. A software correction can also be used, but that can be cumbersome in a production environment.

    Graduate II
    September 21, 2023

    Hi,

     

    I've used this method and using the op-amp it is easy to create a low pass filter to get rid of noise.

    Regards

    Rob

    ONadr.1Answer
    Graduate
    September 19, 2023
    For high-impedance temperature sensors, connecting a ceramic capacitor (capacity of 1uF-10uF) in parallel to the analog pin and analog GND has worked very well for me. It is the best to place the capacitor as close to the pin as possible. The time consatnt is quite high, but the temperature response of the sensor is usually slower.
     
    Nico3Author
    Graduate II
    September 21, 2023

    yes,, this worked for me also..

    Visitor II
    February 29, 2024

    Hi Rob,

    Could you please share your method using op-amp? thanks