Hi All,
This is my first time posting and I would like to learn about using the UNO R4 to read millivolts. I am trying to read a voltage source from 0V to 8V. I know the maximum ADC input is 5V so I am using a voltage divider to drop the source. The code and circuit seemed to work fine when the source is above 100 mV, but I found that the ADC values started to behave unexpectedly when the source was below that. I am using a 10mV source as an example here. During troubleshooting, the Arduino can read a correct ADC (config 2) before the voltage divider, but it gives unexpected values after the voltage divider (config 1). I have a suspension that my voltage divider is the issue here, but I am not sure why that is and how to move forward. Any advice here would be appreciated.
Thank you and happy holidays everyone!
int sensorValue;
float Vcc;
float convert = 16383.0;
void setup() {
// initialize serial communication at 9600 bits per second:
analogReadResolution(14); //change to 14-bit resolution
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
sensorValue = analogRead(A0);
Vcc = analogReference();
Serial.print("ADC = ");
Serial.println(sensorValue);
Serial.print("Voltage = ");
Serial.println(sensorValue*(Vcc/convert)*1000);
delay(100);
}
config 1
config 2


