So im trying to measure the correct voltage from an input stream on my analog pins. I already used a diode to restrict the maximum voltage to 5.0 volt. The problem is: The numbers that are measured and printed with Serial.print(), seem to be wrong. They are different values then the acutal ones. So for example: if we have 500 millivolts in reality, the arduino seem to measure something from 4.4-4.7 volt.
Anybody have an idea why this is happening? The code im using to measure the voltage is for example:
int closeposition = analogRead(A3);
// to convert it to volt
float closevoltage = closeposition * (5.0 /1023.0);
Is there anyhting that im not seeing that may be messing with the values?
Thank you in advance for all responses