Page 1 of 1

ESP32S3 IO3 as ADC pin

Posted: Wed Mar 11, 2026 11:58 am
by ashrafkamel5
Hi,
I am trying to read a 1 cell lithium ion battery voltage with ADC channel 2 at IO3 on esp32s3
the batt+ is connected to a voltage divider two 10k resistors then connected to IO3 pin.
Screenshot 2026-03-11 133832.png
Screenshot 2026-03-11 133832.png (8.67 KiB) Viewed 107 times
Screenshot 2026-03-11 135636.png
Screenshot 2026-03-11 135636.png (22.95 KiB) Viewed 107 times
The bug I encountered

before initializing the Pin as ADC input
the pin reads 2.1V which is normal on multi-meter.
after initializing as ADC by calling

Code: Select all

analogReadMilliVolts(3);
the pin reads 3.6V to GND on multi-meter.
and it shows 3.2v in code

I know it shares JTAG pin MTMS but how does it effect the system?

another behavior is:
when I disconnect the supply voltage to the circuit
and the circuit is powered by the battery cell only
it reads the correct voltage again on AVO and on code.

I tried calling

Code: Select all

gpio_reset_pin(GPIO_NUM_3);
before reading ADC values with no effect.

what could be the cause of this bug?

best regards,
Ashraf Kamel