Good morning all, we have built a custom made circuit based on MkrZero (ATSAMD21G18A-AUT).
Everything is working fine.
We are now trying to have "precise" ADC measurments but we are facing a (what seems to be) common issue. But I couldn't find an answer using forum search or google.
The ADC pin is connected to an OPAMP. Measured voltage input value is a relatively clean 0V (0.0000V on multimeter, we assume very little noise) (we do supply the OPAMP with a -0.2V on negative supply).
Depending on the voltage reference, we get different values using analogRead()...
//Set AnalogReadResolution to 12
analogReadResolution(12);
//Analog reference voltage
analogReference(AR_DEFAULT);
//or
analogReference(AR_EXTERNAL);
With AR_DEFAULT => We have 9 (maximum of 4095)
With AR_EXTERNAL (ref pin voltage measured at 3.3000V) => We have 27 (still maximum of 4095)
Always with 0V on input pin.
Librairies included
#include <Wire.h>
#include "avdweb_AnalogReadFast.h"
Do I need to do a custom calibration for each module?
What could be our issue?
Could noise generate this problem? I didn't put any capacitor close to the input pins.
I will try to draw the line depending on different supplied voltage to see what kind of curve I get but before, I thought that maybe someone would have a simple explaination. I will also check with oscilloscope.
Thank you!
Francois