

The ESP32 ADC pins don’t have a linear behavior. You can also set the resolution of your channels on the code and the ADC range. This means that you can get analog readings ranging from 0 to 4095, in which 0 corresponds to 0V and 4095 to 3.3V. The ADC input channels have a 12-bit resolution. So, if you’re using Wi-Fi and you’re having trouble getting the value from an ADC2 GPIO, you may consider using an ADC1 GPIO instead.

Note: ADC2 pins cannot be used when Wi-Fi is used. The ESP32 has 18 x 12 bits ADC input channels (while the ESP8266 only has 1x 10 bits ADC). These are the GPIOs that can be used as ADC and respective channels: Learn how to use the touch pins with Arduino IDE: ESP32 Touch Pins with Arduino IDE Analog to Digital Converter (ADC) Those internal touch sensors are connected to these GPIOs: The capacitive touch pins can also be used to wake up the ESP32 from deep sleep. These pins can be easily integrated into capacitive pads and replace mechanical buttons. So they can detect variations induced when touching the GPIOs with a finger. These can sense variations in anything that holds an electrical charge, like the human skin. The ESP32 has 10 internal capacitive touch sensors.

So, don’t use these pins in your projects: However, these pins are connected to the integrated SPI flash on the ESP-WROOM-32 chip and are not recommended for other uses. GPIO 6 to GPIO 11 are exposed in some ESP32 development boards. They can’t be used as outputs, so use these pins only as inputs: These pins don’t have internal pull-up or pull-down resistors. GPIOs 34 to 39 are GPIs – input only pins. Outputs PWM signal at boot, strapping pinĬontinue reading for a more detail and in-depth analysis of the ESP32 GPIOs and its functions. Outputs PWM signal at boot, must be LOW to enter flashing modeĬonnected to on-board LED, must be left floating or LOW to enter flashing mode The pins highlighted in red are not recommended to use as inputs or outputs. The ones highlighted in yellow are OK to use, but you need to pay attention because they may have an unexpected behavior mainly at boot. The pins highlighted in green are OK to use. The following table shows what pins are best to use as inputs, outputs and which ones you need to be cautious.

Additionally, there are pins with specific features that make them suitable or not for a particular project.
