Core reads wrong voltage [FIXED]

I built the Thermometer project using the sensor in my kit. Trouble was it was reading the wrong voltage. I would read A/D value of 350 or about .28 VDC, but it should have read 875 or about .7 VDC. The voltage checked correct with an external voltmeter. I tried to read the voltage while my external voltmeter was connected and guess what ?, it read 875 as it should as long as the external meter was connected.

I think this is because the external voltmeter added a tiny bit of capacitance which fixes a typical problem with A/D converters called aliasing. Many A/D chips call for a small filter capacitor on their inputs to prevent this problem.

I added a .01uF cap to the input pin and it works great every time. Called a anti-aliasing capacitor.

Good practice would be to add a small cap to all A/D inputs or even an opp amp buffer with a small cap.

Randy

2 Likes

Great info. You suggest maybe an opp amp buffer with a small cap. Where would you put the small cap? On the input of the opp amp, or on the output of the opp amp?
Thanks, Jack

Input only, caps on the output of an op amp are a no no.
data sheet for typical A/D below, see 6.2

http://ww1.microchip.com/downloads/en/DeviceDoc/21034F.pdf
Randy

1 Like

Folks, just a reminder that a LOT of discussions regarding the STM32 analog inputs can be found here: :smiley: