Hi,
Im trying to measure precise values with the Arduino Due. The First Problem I have is an offset of about 0.5V.
Im Using the multimeter on the same Port as the Arduino does. The Value is 3.2V but the Arduino Measures something around 2.7V...
Also, I don't get the Analog reference on the DUE. Where does it get its Reference Value from, is it ADVREF on Pin 75? Is it possible to change the Analog Reference on the DUE?
Here is my Code for the measurement, pretty simple.
#define NTC2Pin A7
#define AnalogReadSampleRate 20
#define AnalogOffset 0.0
float NTCValue[8] = {0,0,0,0,0,0,0,0};
loop(){
SerialUSB.print("NTC1 Value: ");
SerialUSB.print(readNTC(),4);
SerialUSB.println("V");
SerialUSB.println("");
delay(1000); // wait for a second
}
float readNTC() {
float values;
for (int i = 0; i < AnalogReadSampleRate; i++) {
values += (analogRead(NTC1Pin));
}
int sensorValue = values / AnalogReadSampleRate;
NTCValue[1] = ((sensorValue * 3.3) / 1023.0) - AnalogOffset; // + 0,04V due to Resistor tolerance
return NTCValue[1];
}