Simple voltage divider - ADC giving wrong readings?
Posted: Sun Jul 30, 2023 1:52 pm
Hello everyone,
so I have been experimenting with an ESP32, building a simple voltage divider to test the ADC.
As i have been using R1 = R2 = 1000 Ohm I was expecting to read 1.65V or a data value of 4096/2 = 2048.
However I am just reading ~1700 which corresponds to ~1.36 V.
I checked this with a multimeter too, where i received exactly what i was expecting, 1.65 V.
I even added a capacitor as i read that that could help with false readings, but that didn't change anything
What could be the issue here? Code below and image from the board
so I have been experimenting with an ESP32, building a simple voltage divider to test the ADC.
As i have been using R1 = R2 = 1000 Ohm I was expecting to read 1.65V or a data value of 4096/2 = 2048.
However I am just reading ~1700 which corresponds to ~1.36 V.
I checked this with a multimeter too, where i received exactly what i was expecting, 1.65 V.
I even added a capacitor as i read that that could help with false readings, but that didn't change anything
What could be the issue here? Code below and image from the board
Code: Select all
const int analogPin=35;
int U2;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
U2 = analogRead(analogPin);
Serial.println(U2);
delay(500);
}