PinoutESP3238 pins

ESP32 Gold Edition pinout

All 38 holes on the Lonely Binary ESP32 Gold Edition — the four that can only ever be inputs, the five sampled at reset, and the six that are drilled, labelled and wired to nothing.

ESP32 Gold EditionInteractiveOpen the ESP32 in 3DTurn the real board over and click any of its 38 holes. Every pad is placed from this design’s own net list.Open in 3D →

Reading this board

Two 19-pin headers, 38 holes: 26 GPIO, six power, and six pads in no net at all. The rows are 25.4 mm apart on a 2.54 mm pitch — ten breadboard columns, so a build has one spare column either side of the board. The module is an ESP32-WROOM-32E, with 4, 8 or 16 MB of flash depending on the variant and no PSRAM on any of them.

Every pin below is read from this design's own net list, so the hole in the table is the hole on your desk. Open the board in 3D to turn it over and click one.

Fifteen of the 26 GPIO have nothing attached and nothing sampled at reset. Six more can be trusted with an analog input on a connected board. The rest are the next two sections.

The six pads that go nowhere

The holes silkscreened 6, 7, 8, 9, 10 and 11 are in no net. On almost every other classic-ESP32 board those six positions carry the module's flash bus, and driving one stops the chip dead. Here they are drilled, plated and labelled for pin-compatibility and then routed nowhere — so unlike most boards, you cannot crash this one by touching them. You also cannot use them. There is no copper on the other side of the pad.

Note what that does not mean. The flash inside the module still runs on the chip's GPIO6 to GPIO11; those lines simply never reach a header. Software that addresses those GPIO numbers is still talking to the flash bus, and still crashes — Serial1 on its default pins is the one people hit, because the Arduino core puts it on GPIO9 and GPIO10.

When it will not boot

GPIO0, 2, 5, 12 and 15 are sampled as the chip leaves reset, to pick boot mode, flash voltage and SDIO timing. Afterwards they are yours — but a board that flashes over USB and then will not start on its own supply is almost always one of those five. GPIO12 is the usual culprit: pulled high it selects the wrong flash voltage and the chip never gets as far as your code. Boot it bare, then add one wire at a time.

Three of the five — GPIO0, 5 and 15 — also emit a PWM burst while the chip starts. An LED on one flickers at power-up, and a servo or a MOSFET gate sees a few milliseconds of noise before setup() runs.

The RGB LED on GPIO2 is a worked example of getting this right by accident. It is a WS2812, and a WS2812 data line idles low — which is the level the strap wants, so the LED being there costs nothing. Wire something to GPIO2 that idles high and flashing stops working.

Input only, and it is not the ADC that suffers

GPIO34, 35, 36 and 39 have no output driver, no PWM, and no internal pull-up or pull-down. The last one is what bites: a button on one of these needs a real resistor, because INPUT_PULLUP has nothing to switch on.

They are also the best analog inputs the board has — see below — and that is not a coincidence worth working around. Reading a voltage never needed an output driver.

Power

5V is USB bus voltage, and it arrives through a Schottky diode. That matters in both directions: you can feed the board from this pin without pushing current back out into a plugged-in computer, and the pin sits a little below what the cable actually delivers.

3V3 is the output of an AMS1117-3.3, and the module, the bridge and both LEDs already draw from it. Budget about 500 mA for your own parts, less once the radio is transmitting — the regulator is the ceiling, not what the USB cable could deliver.

EN is the chip-enable line, pulled up, with a capacitor that holds the chip in reset for a moment after power arrives so it does not start running while the 3.3 V rail is still on its way up. Tie it to ground through a button and you have a second reset button; the one on the board does exactly that.

All three GND holes are the same net.

Buses

Nothing is fixed on this chip, but these are the defaults the Arduino core assumes and the ones the examples on this site use:

BusPinsNote
I²CSDA GPIO21, SCL GPIO22Remappable; 4.7 kΩ pull-ups needed if the module has none
SPI (VSPI)MOSI GPIO23, MISO GPIO19, SCK GPIO18, SS GPIO5SS lands on a strapping pin — see below
UART0TX GPIO1, RX GPIO3The USB serial console — leave it alone
UART2TX GPIO17, RX GPIO16Serial2, and yours

Serial1 is missing from that table on purpose. Its default pins are the flash bus, as above; use Serial2, or pass your own pins to Serial1.begin().

The chip-select landing on GPIO5 is the one worth designing around. A chip-select that twitches while the chip boots can make an SPI peripheral see a transaction nobody sent. If a display or an SD card is unreliable only on the first power-up after the supply comes on, move SS to an ordinary pin and set it high yourself before the first transfer.

ADC and DAC

The classic ESP32 has two ADCs and they are not interchangeable.

ADC1 works whatever the radio is doing. Eight channels on the die, six of them on this header: GPIO32, 33, 34, 35, 36 and 39. The other two are GPIO37 and GPIO38, which the WROOM module does not bring out at all.

ADC2 stops working the moment Wi-Fi starts. The driver hands the block to the radio front end, and from then on a read returns an error rather than a wrong number. That is GPIO0, 2, 4, 12, 13, 14, 15, 25, 26 and 27 — ten pins, every one of them still fine as digital I/O. An analog reading that goes dead exactly when you call WiFi.begin() is this, and the fix is to move the input to an ADC1 pin.

So the analog inputs you can trust on a connected board are the six ADC1 pins, and four of the six are the input-only pins from earlier. That is less awkward than it sounds: reading a voltage never needed an output driver.

GPIO25 and GPIO26 are real analog outputs — DAC1 and DAC2, eight bits each. This is the one thing the classic chip does that the S3 dropped completely: an actual voltage, not a filtered PWM. Both are ADC2 channels as well, which is a limit on reading them, not on driving them.

Capacitive touch is T0 to T9, on GPIO0, 2, 4, 12, 13, 14, 15, 27, 32 and 33.

Pins to leave alone

  • GPIO36Input only. No output driver, no PWM and no internal pull-up or pull-down, so a button on this pin needs a resistor of its own.
  • GPIO39Input only. No output driver, no PWM and no internal pull-up or pull-down, so a button on this pin needs a resistor of its own.
  • GPIO34Input only. No output driver, no PWM and no internal pull-up or pull-down, so a button on this pin needs a resistor of its own.
  • GPIO35Input only. No output driver, no PWM and no internal pull-up or pull-down, so a button on this pin needs a resistor of its own.
  • GPIO25ADC2, so analogRead stops working the moment Wi-Fi starts. Unaffected as a digital pin.
  • GPIO26ADC2, so analogRead stops working the moment Wi-Fi starts. Unaffected as a digital pin.
  • GPIO27ADC2, so analogRead stops working the moment Wi-Fi starts. Unaffected as a digital pin.
  • GPIO14ADC2, so analogRead stops working the moment Wi-Fi starts. Unaffected as a digital pin.
  • GPIO12Strapping pin. Sets the flash voltage. Boot fails if it is pulled high.
  • GPIO13ADC2, so analogRead stops working the moment Wi-Fi starts. Unaffected as a digital pin.
  • 9L16. Where a devkit would put the flash bus SHD / SD2. This board routes it nowhere — the net list has no net for this pad.
  • 10L17. Where a devkit would put the flash bus SWP / SD3. This board routes it nowhere — the net list has no net for this pad.
  • 11L18. Where a devkit would put the flash bus CSC / CMD. This board routes it nowhere — the net list has no net for this pad.
  • GPIO1UART0 TX, wired to the USB-UART bridge behind the USB-C port. The chip also prints its boot log here.
  • GPIO3UART0 RX, wired to the USB-UART bridge behind the USB-C port.
  • GPIO5Strapping pin. Sets the SDIO timing. Outputs a PWM signal at boot.
  • GPIO4ADC2, so analogRead stops working the moment Wi-Fi starts. Unaffected as a digital pin.
  • GPIO0BOOT button, with a 10 kΩ pull-up. Held low at reset it drops the chip into the ROM bootloader.
  • GPIO2WS2812B RGB LED, single-wire at 800 kHz. The silkscreen says RGB IO2. Note that GPIO2 is also a strapping pin, so whatever you drive on it must be low or floating while the chip comes out of reset — a WS2812 data line idles low, which is why it works here.
  • GPIO15Strapping pin. Silences the boot log when pulled low. Outputs a PWM signal at boot.
  • 8R17. Where a devkit would put the flash bus SDI / SD1. This board routes it nowhere — the net list has no net for this pad.
  • 7R18. Where a devkit would put the flash bus SDO / SD0. This board routes it nowhere — the net list has no net for this pad.
  • 6R19. Where a devkit would put the flash bus SCK / CLK. This board routes it nowhere — the net list has no net for this pad.

Every pin

PinNameFunctionsNotes
3V3.3 V railpowerL1. Output of the on-board regulator, not an input. Everything on the board runs from it. Budget what the regulator can spare, not what USB can deliver.
ENEN / resetpowerL2. The regulator enable line, pulled up. Tie it to ground through a button and you have a reset button.
GPIO36GPIO36gpio, adc1, input-onlyInput only. No output driver, no PWM and no internal pull-up or pull-down, so a button on this pin needs a resistor of its own.
GPIO39GPIO39gpio, adc1, input-onlyInput only. No output driver, no PWM and no internal pull-up or pull-down, so a button on this pin needs a resistor of its own.
GPIO34GPIO34gpio, adc1, input-onlyInput only. No output driver, no PWM and no internal pull-up or pull-down, so a button on this pin needs a resistor of its own.
GPIO35GPIO35gpio, adc1, input-onlyInput only. No output driver, no PWM and no internal pull-up or pull-down, so a button on this pin needs a resistor of its own.
GPIO32GPIO32gpio, adc1, touchL7
GPIO33GPIO33gpio, adc1, touchL8
GPIO25GPIO25gpio, adc2, dacADC2, so analogRead stops working the moment Wi-Fi starts. Unaffected as a digital pin.
GPIO26GPIO26gpio, adc2, dacADC2, so analogRead stops working the moment Wi-Fi starts. Unaffected as a digital pin.
GPIO27GPIO27gpio, adc2, touchADC2, so analogRead stops working the moment Wi-Fi starts. Unaffected as a digital pin.
GPIO14GPIO14gpio, adc2, touchADC2, so analogRead stops working the moment Wi-Fi starts. Unaffected as a digital pin.
GPIO12GPIO12gpio, adc2, touchStrapping pin. Sets the flash voltage. Boot fails if it is pulled high.
GNDGroundpowerL14. Ground. Several holes so a breadboard build has one nearby wherever it needs it.
GPIO13GPIO13gpio, adc2, touchADC2, so analogRead stops working the moment Wi-Fi starts. Unaffected as a digital pin.
9Not connectedL16. Where a devkit would put the flash bus SHD / SD2. This board routes it nowhere — the net list has no net for this pad.
10Not connectedL17. Where a devkit would put the flash bus SWP / SD3. This board routes it nowhere — the net list has no net for this pad.
11Not connectedL18. Where a devkit would put the flash bus CSC / CMD. This board routes it nowhere — the net list has no net for this pad.
5V5 V railpowerL19. The USB rail, upstream of the regulator. Feed the board here if you are not using USB, or take 5 V out if you are.
GNDGroundpowerR1. Ground. Several holes so a breadboard build has one nearby wherever it needs it.
GPIO23GPIO23gpio, spiR2. Arduino default: SPI (VSPI) MOSI.
GPIO22GPIO22gpio, i2cR3. Arduino default: Wire (I²C) SCL.
GPIO1TXgpio, uartUART0 TX, wired to the USB-UART bridge behind the USB-C port. The chip also prints its boot log here.
GPIO3RXgpio, uartUART0 RX, wired to the USB-UART bridge behind the USB-C port.
GPIO21GPIO21gpio, i2cR6. Arduino default: Wire (I²C) SDA.
GNDGroundpowerR7. Ground. Several holes so a breadboard build has one nearby wherever it needs it.
GPIO19GPIO19gpio, spiR8. Arduino default: SPI (VSPI) MISO.
GPIO18GPIO18gpio, spiR9. Arduino default: SPI (VSPI) SCK.
GPIO5GPIO5gpio, spiStrapping pin. Sets the SDIO timing. Outputs a PWM signal at boot.
GPIO17GPIO17gpio, uartR11. Arduino default: Serial2 TX.
GPIO16GPIO16gpio, uartR12. Arduino default: Serial2 RX.
GPIO4GPIO4gpio, adc2, touchADC2, so analogRead stops working the moment Wi-Fi starts. Unaffected as a digital pin.
GPIO0GPIO0gpio, adc2, touchBOOT button, with a 10 kΩ pull-up. Held low at reset it drops the chip into the ROM bootloader.
GPIO2GPIO2gpio, adc2, touchWS2812B RGB LED, single-wire at 800 kHz. The silkscreen says RGB IO2. Note that GPIO2 is also a strapping pin, so whatever you drive on it must be low or floating while the chip comes out of reset — a WS2812 data line idles low, which is why it works here.
GPIO15GPIO15gpio, adc2, touchStrapping pin. Silences the boot log when pulled low. Outputs a PWM signal at boot.
8Not connectedR17. Where a devkit would put the flash bus SDI / SD1. This board routes it nowhere — the net list has no net for this pad.
7Not connectedR18. Where a devkit would put the flash bus SDO / SD0. This board routes it nowhere — the net list has no net for this pad.
6Not connectedR19. Where a devkit would put the flash bus SCK / CLK. This board routes it nowhere — the net list has no net for this pad.

For this board

  • Slim JoystickA thumb stick and six buttons on one long TinkerBlock board, on six pins. X and Y are two potentiometers, read on analog pins; KEY is the click under the stick, LOW at rest and HIGH when pushed; and all six buttons share BTNS, one analog pin, through a ladder of 10 kΩ resistors that gives each its own voltage. One button reads at a time.
  • Dual Axis JoystickA thumbstick on a square TinkerBlock board, on six pins: GND, VCC, NC, X, Y and SW. X and Y are two potentiometers from VCC to GND, read on analog pins; SW is the click under the stick, LOW at rest and HIGH when pressed, with its own pull-down. Every line reaches VCC, so VCC is your board's logic voltage. A PWR light and an SW light show power and each click.
  • INA219 and INA3221 Current Monitors: shunt, range and wiringTwo I²C current and voltage monitors: the TK119 with one INA219 on a 100 mΩ shunt, and the INA3221 with three channels on 50 mΩ. What the chip measures and what it works out, why the two resistors differ, the range and step each one gives, and the wiring for both.
  • INA219 Current MonitorA 100 milliohm resistor in the positive wire and a chip that reads the millivolts across it. Current, voltage and power over I²C, up to 3.2 A on a rail of up to 26 V.
  • SD and microSD Card Readers for ESP32: SPI, 1-bit and 4-bitTwo 3.3 V card reader boards with the SD bus brought out in full. What the two NC pins really are, which of SPI, 1-bit and 4-bit to use, what each measured, and the wiring for all three.
  • SHT31 Temperature and Humidity SensorA Sensirion SHT31 on a TinkerBlock carrier: two numbers over two shared wires, calibrated at the factory, with the pull-ups already fitted and two jumpers on the back that set the address and take them away again.
  • ESP32 Expansion Bases: 2.54 mm, PinPulse, Pluggable Terminal and Screw TerminalFour bases for the 38-pin Lonely Binary ESP32. Which pins each one brings out, which way round the board goes, the fifteen-way display port they all share, and the twenty-four LEDs on the PinPulse.
  • 58mm Thermal Printers: the receipt kit, the label kit and the USB-C base boardTwo thermal printer kits that share one Type-C TTL base board. The 9 V a USB port will not give you, which header your microcontroller belongs on, the baud rate printed on each unit, and the commands that put text, barcodes and labels on paper.

Edit this page — content/pinouts/esp32.mdx