Read battery voltage on GPIO 41 (ESP32-S3 and Arduino IDE)
Posted: Wed Dec 21, 2022 7:56 pm
Hello,
I have built a code for reading a battery voltage - initially on pin GPIO_NUM_35 on normal ESP32
There was no setup for this pin, I only did analogRead(GPIO_NUM_35) and I was getting some values (0-4095) that afterwards I convert in voltage.
My problem is, I have the same code but on ESP32-S3 and GPIO_NUM_41
The code was not modified, the hardware itself was not modified - only the ESP32 was upgraded to ESP32-S3.
analogRead(GPIO_NUM_41) is returning 0 all the time.
It seems the default of this pin is MTDI (and not GPIO) and the GPIO default function is F0 (type I1 - input only). I see type I/O/T is for function F1, but I guess input only is fine for what I need. So not sure if I need any configuration or something.
Does anyone have any idea why analogRead is retuning 0 all the time on this pin?
Is it because there is no Analog Function on ESP32-S3 GPIO 41?
Any help is very much appreciated!
Thank you,
Marius
I have built a code for reading a battery voltage - initially on pin GPIO_NUM_35 on normal ESP32
There was no setup for this pin, I only did analogRead(GPIO_NUM_35) and I was getting some values (0-4095) that afterwards I convert in voltage.
My problem is, I have the same code but on ESP32-S3 and GPIO_NUM_41
The code was not modified, the hardware itself was not modified - only the ESP32 was upgraded to ESP32-S3.
analogRead(GPIO_NUM_41) is returning 0 all the time.
It seems the default of this pin is MTDI (and not GPIO) and the GPIO default function is F0 (type I1 - input only). I see type I/O/T is for function F1, but I guess input only is fine for what I need. So not sure if I need any configuration or something.
Does anyone have any idea why analogRead is retuning 0 all the time on this pin?
Is it because there is no Analog Function on ESP32-S3 GPIO 41?
Any help is very much appreciated!
Thank you,
Marius