GPIO 12 and 14 as Analog Input Pins

userHead Hsin.Cheng 2023-08-09 03:46:33 287 Views3 Replies

Hi,

 

I am using Firebeetle ESP32 (DFR0478). The GPIO 12 and 14 are reserved for I2S communication.

 

I am doing a project that needs 7 analog input pins, so the default A0 to A4 analog pins are not enough for me. From the pin map of ESP32-WROOM-32 chip, GPIO 12 and 14 can also be analog inputs. Does it mean that I can use GPIO 12 and 14 as analog input pins if I do not need I2S communication?

 

Thank you for your time.

2023-08-10 02:58:59

Hello DFRobot community,

 

For anyone who is interested in this topic, I just tested GPIO 12 and GPIO 14. Both of them can function as an analog input. There is no problem with it.

userHeadPic Hsin.Cheng
2023-08-09 10:25:50

Theoretically yes, but I think the official SDK provided by DFRobot does not map these two pins.You can try to initialize these two pins as analog pins in Arduino IDE first.If it still doesn't work, you may need to use ESPIDF for development.

 

But a practical solution I came up with is to use an external ADC: ADS1115.

 

https://www.dfrobot.com/product-1730.html

This ADC expands 4 other analog input. And the I2C address could be set as two different address, which means you could connect two ADS1115 at the same time.

And this will lead out 8 different Analog input pin.

userHeadPic Yeez_B
Hsin.Cheng wrote:

Thank you so much. I just tested GPIO 12 and 14, and they can both act as analog inputs.

2023-08-10 02:59:39
1 Replies