Skip to main content
Senior
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. 

 

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

TDK
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

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
raptorhal2
Lead
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.

Garnett.Robert
Senior III
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.1
ONadr.1Answer
Senior III
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
Senior
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