Measure voltage with esp32

i try to measure voltage with esp32 with this formula:

esp32_voltage * (analogRead / 1023) * 13.1951
i get 13.1951 from (R1+R2)/R2

  analogReadResolution(10); // Set analog read resolution: 6biots(0-63),  8 bits(0-255), 10 bits (0-1023)

 float result = (3.3 * ((float)analogRead(35) / 1023)) * 13.1951; 

here is schematic

in my case AnalogRead is 236 and input voltage is 12.24v
but based on this formula result is10.0v and not around 12

What is the max input of your A/D and is there any resistor dividers in front of it already installed on the ESP module.

@arpa123
Use analogReadMilliVolts();
analogRead is un-calibrated and will give you the wrong answer.

max 42V

Post a link to technical details on your board.

i connected io35 to volage_measure label (schematic image above)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.