4. Pin Description - WefaaRobotics/Smorphi GitHub Wiki

Input Only Pins

  • GPIO 36

This pin cannot be configured as outputs, they can be used as either digital inputs, analog inputs, or for other unique purposes.

ADC Pins

  • GPIO 2, 4, 12, 13, 14, 15, 25, 26, 27, 36

These pins can be used to convert analog voltage on the pin to a digital number. It is a 12-bit ADC which allows it to map input voltages between 0 and the operating voltage 3.3V into integer values between 0 and 4095.

Warning: ADC2 pins cannot be used when Wi-Fi is enabled. If your project requires Wi-Fi, consider using the ADC1 pins instead

DAC Pins

  • GPIO 25, 26

These pins can be used to convert digital signals into true analog voltages. It is a 8-bit DAC which means that values between 0 and 256 will produce an analog voltage somewhere between 0 and 3.3V.

Touch Pins

  • GPIO 2, 4, 12, 13, 14, 15, 27

When a capacitive load (such as a human finger) is in close proximity to the GPIO, the ESP32 detects the change in capacitance.

These capacitive touch pins can be used to wake the ESP32 from deep sleep.

SPI Pins

  • GPIO 2, 5, 12, 13, 14, 15, 18, 19, 23

The ESP32 features 4 SPIs (SPI0, SPI1, HSPI and VSPI) in slave and master modes.

Only VSPI and HSPI are usable SPI interfaces whereas SPI0 and SPI1 are used by the integrated flash memory chip.

I2C Pins

  • GPIO 21, 22

The ESP32 has a single I2C bus that allows you to connect up to 112 sensors and peripherals, The SDA and SCL pins are, by default, assigned to the following pins. However, you can bit-bang the I2C protocol on any GPIO pins with wire.begin(SDA, SCL) command.

UART Pins

  • GPIO 16, 17

The ESP32 has 2 UART interfaces, i.e. UART0 and UART2, which provide asynchronous communication and IrDA support, and communicate at up to 5 Mbps.

UART0 pins are connected to the USB-to-Serial converter and are used for flashing and debugging. Therefore, it is not recommended to use the UART0 pins.

UART2, on the other hand, are not connected to USB-to-Serial converter. This means that you can use them to connect to UART-deevices such as GPS, fingerprint sensor, etc.

PWM Pins

  • All pins except GPIO36

These pins are controlled by PWM controller. The PWM output can be used for driving digital motors and LEDs.

The controller consists of PWM timers and the PWM operator. Each timer provides timing in synchronous or independent form, and each PWM operator generates the waveform for one PWM channel.

RTC GPIO Pins

  • GPIO 2, 4, 12, 13, 14, 15, 25, 26, 27, 36

Some GPIOs are routed to the RTC low-power subsystem, they are called RTC GPIOs.

These are special pins thats are used to wake the ESP32 from deep sleep when the Ultra Low Power (ULP) co-processor is running.

Power Pins

  • VIN, 3.3V

The VIN pin can be used to directly supply the ESP32 and its peripherals, if you have a regulated 5V voltage source. The 3.3V pin is the output of an on-board voltage regulator.

This pin can be used to supply power to external components.

Ground Pin

  • GND

It is the ground pin of the ESP32.

Enable Pin

  • EN

It is used to enable ESP32. The chip is enabled when pulled HIGH. When pulled LOW, the chip works at minimum power.