ESP32S3 IO3 as ADC pin
Posted: Wed Mar 11, 2026 11:58 am
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. 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
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
before reading ADC values with no effect.
what could be the cause of this bug?
best regards,
Ashraf Kamel
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. 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);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);what could be the cause of this bug?
best regards,
Ashraf Kamel