ESP32 NodeMCU 30-Pin Pinout + Safe GPIOs

The common ESP32 NodeMCU / DevKit V1 30-pin board uses the classic ESP32-WROOM-32 family and exposes most of the GPIOs needed for sensors, relays, displays and Home Assistant projects. The easiest general-purpose pins are GPIO13, 14, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32 and 33. GPIO0, 2, 5, 12 and 15 are boot/strapping pins and should be used carefully. GPIO34, 35, 36 and 39 are input-only, while GPIO6–11 belong to the SPI flash and should never be used. For Wi-Fi projects, use ADC1 pins GPIO32–39 for analog measurements because ADC2 conflicts with Wi-Fi.

1. What is the ESP32 NodeMCU 30-pin board?

The name “ESP32 NodeMCU 30-pin” is used rather loosely by online sellers.

Boards with this layout may be advertised as:

  • ESP32 NodeMCU
  • ESP32 DevKit V1
  • DOIT ESP32 DevKit V1
  • ESP32-WROOM-32 Dev Board
  • NodeMCU ESP32
  • ESP32 30-Pin Development Board

They are generally based on a classic ESP32-WROOM-32-family module, with:

  • Wi-Fi
  • Bluetooth
  • dual-core ESP32 processor
  • USB-to-UART programming
  • 3.3 V regulator
  • EN/reset button
  • BOOT button on many versions
  • 15 header pins on each side

The exact USB-to-serial chip, regulator and board markings vary between clones, so the silkscreen printed on the actual board should always be checked before connecting power.

The GPIO capabilities themselves come from the classic ESP32, so the same boot pins, ADC limitations, touch inputs and peripheral mappings apply.

2. Common 30-pin ESP32 NodeMCU layout

A very common 30-pin layout is:

Left header

Pin labelESP32 function
ENChip enable / reset
VPGPIO36 / ADC1
VNGPIO39 / ADC1
GPIO34ADC1 / input only
GPIO35ADC1 / input only
GPIO32GPIO / ADC1 / touch
GPIO33GPIO / ADC1 / touch
GPIO25GPIO / ADC2 / DAC
GPIO26GPIO / ADC2 / DAC
GPIO27GPIO / ADC2 / touch
GPIO14GPIO / ADC2 / touch
GPIO12GPIO / ADC2 / boot strap
GPIO13GPIO / ADC2 / touch
GNDGround
VIN / 5V5 V rail

Right header

Pin labelESP32 function
GPIO23GPIO / SPI MOSI
GPIO22GPIO / I²C SCL
TX0 / GPIO1UART0 TX
RX0 / GPIO3UART0 RX
GPIO21GPIO / I²C SDA
GPIO19GPIO / SPI MISO
GPIO18GPIO / SPI SCK
GPIO5GPIO / SPI CS / boot strap
GPIO17GPIO / commonly UART2 TX
GPIO16GPIO / commonly UART2 RX
GPIO4GPIO / ADC2 / touch
GPIO2GPIO / ADC2 / boot strap
GPIO15GPIO / ADC2 / boot strap
GNDGround
3V33.3 V

Because this is a widely cloned board rather than one single tightly controlled hardware revision, verify the printed pin labels on the board before wiring it.

3. Safe GPIO cheat sheet

For most digital projects, start with:

GPIO13, 14, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32 and 33

These can normally be used for:

  • LEDs
  • relay drivers
  • buttons
  • PIR sensors
  • PWM outputs
  • digital sensors
  • interrupts
  • UART
  • I²C
  • SPI

The official Arduino ESP32 test configuration treats GPIO16 and GPIO17 as particularly clean general-purpose pins, while other common pins remain safe unless their default peripheral is being used.

A practical beginner grouping is:

GPIORecommendation
GPIO16, 17✅ Excellent
GPIO13, 14✅ Very good
GPIO18, 19, 23✅ Good / default SPI
GPIO21, 22✅ Good / default I²C
GPIO25, 26✅ Good / DAC capable
GPIO27✅ Good
GPIO32, 33✅ Excellent, ADC1 + touch
GPIO4✅ Generally usable
GPIO0, 2, 5, 12, 15⚠️ Boot pins
GPIO1, 3⚠️ Programming / Serial
GPIO34, 35, 36, 39⚠️ Input only
GPIO6–11❌ Flash — never use

4. Boot and strapping pins

The classic ESP32 has five important strapping pins:

  • GPIO0
  • GPIO2
  • GPIO5
  • GPIO12
  • GPIO15

The ESP32 samples their voltage during reset to configure boot and other low-level settings.

Once the ESP32 has booted, they can usually operate as normal GPIOs.

The problem appears when external hardware forces one of these pins to the wrong level while the ESP32 is resetting.

5. GPIO0: BOOT / programming mode

GPIO0 is the most familiar boot pin.

Its state during reset determines whether the ESP32 starts normally or enters the serial bootloader.

GPIO0 HIGH
→ Normal SPI flash boot

GPIO0 LOW
→ Download / programming mode

The BOOT button on many ESP32 development boards simply pulls GPIO0 LOW.

This is why GPIO0 is not a great beginner choice for:

  • relays
  • switches with strong pull-down resistors
  • sensors that hold the line LOW

If GPIO0 is accidentally LOW during reset, the ESP32 may appear to stop running the sketch because it is waiting for firmware to be uploaded.

6. GPIO2: boot pin and often built-in LED

GPIO2 is another boot-strapping pin.

The Arduino ESP32 configuration for NodeMCU-32S defines:

LED_BUILTIN = 2;

so many NodeMCU-style ESP32 boards also use GPIO2 for the onboard LED.

However, clone boards vary.

GPIO2 can be used after startup, but external circuitry connected to it can interfere with bootloader operation.

For a general external LED or relay, GPIO13, 25, 26 or 27 is normally a simpler choice.

7. GPIO5: SPI CS and strapping pin

GPIO5 is commonly used as the default Arduino SPI chip-select pin:

SS / CS → GPIO5

The Arduino ESP32 core defines the normal classic ESP32 SPI pins as:

SCK  → GPIO18
MISO → GPIO19
MOSI → GPIO23
SS   → GPIO5

GPIO5 is also a strapping pin.

It usually works perfectly as SPI CS because the connected peripheral normally leaves it in an acceptable state during reset.

If a device connected to GPIO5 strongly drives the line during startup, however, another CS GPIO such as GPIO25, GPIO26 or GPIO27 can be easier.

8. GPIO12: the boot pin to be most careful with

GPIO12 is the pin beginners should be especially careful with.

It controls the ESP32’s VDD_SDIO / flash-voltage configuration during reset.

The normal default is LOW, which selects the expected 3.3 V configuration.

Pulling GPIO12 HIGH at reset can select a different voltage and may prevent a board using 3.3 V flash from booting correctly.

Symptoms can include:

  • ESP32 repeatedly resetting
  • boot errors
  • flash errors
  • board appearing dead
  • board only booting after a peripheral is disconnected

For beginner projects:

Avoid GPIO12 unless there is a good reason to use it.

There are plenty of easier pins on a 30-pin ESP32.

9. GPIO15

GPIO15 is another strapping pin.

Its reset state influences boot logging and SDIO configuration. Espressif documents it as MTDO and a strapping GPIO.

GPIO15 works normally after startup, but avoid attaching circuits that strongly pull it to an unexpected state during reset.

Again, it should not be the first GPIO chosen for a relay or sensor when GPIO13, 14, 25, 26 or 27 are available.

10. GPIO34, 35, 36 and 39 are input-only

These pins are unusual:

  • GPIO34
  • GPIO35
  • GPIO36 / VP
  • GPIO39 / VN

They are input-only.

They cannot drive:

  • LEDs
  • relays
  • buzzers
  • PWM
  • digital outputs

Espressif also states that these pins do not have software-controlled internal pull-up or pull-down resistors.

That means a button connected to GPIO34 cannot simply use:

pinMode(34, INPUT_PULLUP);

Instead, an external pull-up resistor is required.

These pins are excellent for:

  • analog sensors
  • voltage measurements
  • digital inputs
  • external interrupts

because they are part of ADC1 and remain available while Wi-Fi is running.

11. GPIO6 to GPIO11: never use them

GPIO6–GPIO11 are connected to the ESP32 module’s SPI flash.

They are:

  • GPIO6
  • GPIO7
  • GPIO8
  • GPIO9
  • GPIO10
  • GPIO11

Espressif explicitly identifies these as flash-related pins and recommends that they not be used for other purposes.

On most 30-pin NodeMCU/DevKit boards they are not exposed anyway.

If they appear on another ESP32 board, that does not mean they are safe GPIOs.

12. UART0 programming pins: GPIO1 and GPIO3

The USB-to-serial converter on the board normally uses:

GPIO1 → UART0 TX
GPIO3 → UART0 RX

These are used for:

  • uploading sketches
  • Serial Monitor
  • boot messages
  • debugging

The official Arduino NodeMCU-32S variant defines exactly these default TX/RX pins.

They can technically be reused after boot, but doing so can cause:

  • garbage data during boot
  • interference with Serial Monitor
  • programming problems
  • external devices reacting to ESP32 boot messages

For beginner projects, leave GPIO1 and GPIO3 for USB Serial.

13. GPIO16 and GPIO17: excellent general pins

On the normal ESP32-WROOM 30-pin development board, GPIO16 and GPIO17 are very useful.

They are commonly used as:

GPIO16 → RX2
GPIO17 → TX2

but ESP32’s GPIO matrix means UART signals can be routed elsewhere if required.

These pins are ideal for devices such as:

  • GPS modules
  • PMS5003 particle sensors
  • RS-485 adapters
  • serial displays
  • another microcontroller

They are also excellent normal GPIOs when no second UART is needed.

Important PSRAM note

Some ESP32 modules with PSRAM reserve GPIO16/17 internally.

A normal ESP32-WROOM-32 NodeMCU 30-pin board normally does not contain PSRAM, so the pins remain available.

If the module is actually a WROVER/PSRAM version, verify before using them. Espressif notes that GPIO16/17 may be occupied on PSRAM-equipped module designs.

14. ADC pins

The classic ESP32 has two ADC units:

  • ADC1
  • ADC2

ADC1

The useful ADC1 pins exposed by the 30-pin board are:

GPIOADC channel
GPIO36ADC1_CH0
GPIO39ADC1_CH3
GPIO32ADC1_CH4
GPIO33ADC1_CH5
GPIO34ADC1_CH6
GPIO35ADC1_CH7

These are the preferred analog pins for Wi-Fi projects.

ADC2

ADC2 is available on:

  • GPIO0
  • GPIO2
  • GPIO4
  • GPIO12
  • GPIO13
  • GPIO14
  • GPIO15
  • GPIO25
  • GPIO26
  • GPIO27

The problem is Wi-Fi.

Espressif states that ADC2 is shared with the Wi-Fi subsystem, so ADC2 measurements cannot be relied upon normally while Wi-Fi is active.

For projects involving:

  • Home Assistant
  • ESPHome
  • MQTT
  • web servers
  • Wi-Fi sensors

prefer:

GPIO32, 33, 34, 35, 36 or 39

for analog inputs.

15. ADC resolution

The classic ESP32’s SAR ADC provides raw measurements with up to 12-bit resolution.

That gives:

0–4095

for a normal 12-bit reading.

The ESP32 ADC is convenient, but it is not a precision laboratory ADC.

For more accurate voltage measurements, particularly low-level signals, consider an external ADC such as:

  • ADS1115
  • ADS1015

16. Capacitive touch pins

The classic ESP32 provides ten capacitive-touch channels.

Arduino maps them as:

TouchGPIO
T0GPIO4
T1GPIO0
T2GPIO2
T3GPIO15
T4GPIO13
T5GPIO12
T6GPIO14
T7GPIO27
T8GPIO33
T9GPIO32

For a touch button, the easiest pins are usually:

GPIO27, GPIO32 or GPIO33

because they avoid most boot-pin complications.

Example:

int value = touchRead(33);

17. DAC analog output pins

The original ESP32 includes two real DAC outputs:

DAC1 → GPIO25
DAC2 → GPIO26

These are genuine analog-output peripherals rather than PWM pretending to be analog.

They can be useful for:

  • waveform generation
  • audio experiments
  • reference voltages
  • analog control signals

They are only 8-bit DACs, so they are not intended as high-quality audio converters.

18. I²C pins

ESP32 can route I²C through different GPIOs, but the standard Arduino defaults are:

GPIO21 → SDA
GPIO22 → SCL

These are excellent choices because they are not boot pins.

Typical wiring:

I²C deviceESP32
SDAGPIO21
SCLGPIO22
VCC3V3
GNDGND

This works well for:

  • BME280
  • SHT40
  • SHT45
  • ADS1115
  • INA219
  • INA226
  • OLED displays
  • RTC modules

Arduino example:

#include <Wire.h>

void setup() {
  Wire.begin(21, 22);
}

void loop() {
}

19. SPI pins

The default Arduino SPI mapping is:

GPIO18 → SCK
GPIO19 → MISO
GPIO23 → MOSI
GPIO5  → SS / CS

This is suitable for:

  • TFT displays
  • SD cards
  • Ethernet modules
  • SPI ADCs
  • radio modules

GPIO5 is a strapping pin, so a project can use another GPIO for chip select if required.

For example:

SCK  → GPIO18
MISO → GPIO19
MOSI → GPIO23
CS   → GPIO27

is an excellent alternative.

20. PWM pins

ESP32’s GPIO matrix and LEDC peripheral allow PWM output on most normal output-capable GPIOs.

Good PWM choices include:

  • GPIO13
  • GPIO14
  • GPIO16
  • GPIO17
  • GPIO18
  • GPIO19
  • GPIO21
  • GPIO22
  • GPIO23
  • GPIO25
  • GPIO26
  • GPIO27
  • GPIO32
  • GPIO33

Avoid GPIO34–39 because they cannot output at all.

PWM is useful for:

  • LED dimming
  • PC fan control
  • motor drivers
  • servo control
  • buzzers

21. Best pins for a relay

A relay module should ideally use a GPIO that will not affect boot.

Good choices include:

GPIO13
GPIO14
GPIO16
GPIO17
GPIO25
GPIO26
GPIO27
GPIO32
GPIO33

For example:

const int relayPin = 25;

void setup() {
  pinMode(relayPin, OUTPUT);
  digitalWrite(relayPin, LOW);
}

Avoid GPIO0, GPIO2, GPIO12 and GPIO15 for a first relay project because the relay module’s input circuitry may interfere with startup.

22. Best pins for buttons

Good button GPIOs include:

GPIO13
GPIO14
GPIO16
GPIO17
GPIO25
GPIO26
GPIO27
GPIO32
GPIO33

A simple button can be wired between GPIO and GND using the ESP32’s internal pull-up:

const int buttonPin = 27;

void setup() {
  pinMode(buttonPin, INPUT_PULLUP);
}

GPIO34–39 can also read buttons, but require external pull-up or pull-down resistors.

23. Recommended GPIO recipes

BME280 or SHT40

SDA → GPIO21
SCL → GPIO22

SPI TFT display

SCK  → GPIO18
MISO → GPIO19
MOSI → GPIO23
CS   → GPIO27

DS18B20

DATA → GPIO13

with the usual OneWire pull-up resistor.

Relay

Relay IN → GPIO25

PIR sensor

PIR OUT → GPIO27

Analog sensor with Wi-Fi

Analog OUT → GPIO32 or GPIO33

GPS / serial sensor

ESP32 RX → GPIO16
ESP32 TX → GPIO17

24. Full practical GPIO table

GPIOMain capabilityRecommendation
GPIO0ADC2, touch, boot⚠️ Boot pin
GPIO1UART0 TX⚠️ Programming
GPIO2ADC2, touch, boot, often LED⚠️ Boot pin
GPIO3UART0 RX⚠️ Programming
GPIO4ADC2, touch✅ Good
GPIO5SPI CS, boot strap⚠️ Use carefully
GPIO6–11SPI flash❌ Never use
GPIO12ADC2, touch, boot❌ Avoid if possible
GPIO13ADC2, touch✅ Excellent
GPIO14ADC2, touch✅ Excellent
GPIO15ADC2, touch, boot⚠️ Use carefully
GPIO16Digital I/O✅ Excellent
GPIO17Digital I/O✅ Excellent
GPIO18SPI SCK✅ Excellent
GPIO19SPI MISO✅ Excellent
GPIO21I²C SDA✅ Excellent
GPIO22I²C SCL✅ Excellent
GPIO23SPI MOSI✅ Excellent
GPIO25ADC2, DAC1✅ Excellent
GPIO26ADC2, DAC2✅ Excellent
GPIO27ADC2, touch✅ Excellent
GPIO32ADC1, touch✅ Excellent
GPIO33ADC1, touch✅ Excellent
GPIO34ADC1⚠️ Input only
GPIO35ADC1⚠️ Input only
GPIO36 / VPADC1⚠️ Input only
GPIO39 / VNADC1⚠️ Input only

The ESP32’s GPIO matrix allows many peripheral signals to be moved away from these defaults if a project needs a different pin arrangement.

25. Pins to remember

If only a few rules are remembered, use these:

Best general GPIOs

13, 14, 16, 17, 18, 19,
21, 22, 23, 25, 26, 27,
32, 33

Boot pins

0, 2, 5, 12, 15

Input-only

34, 35, 36, 39

Never use

6, 7, 8, 9, 10, 11

I²C

SDA = 21
SCL = 22

SPI

SCK  = 18
MISO = 19
MOSI = 23

Serial

UART0 TX = 1
UART0 RX = 3

Wi-Fi-safe analog inputs

32, 33, 34, 35, 36, 39

26. Common problem: ESP32 suddenly won’t boot

If the board worked until a sensor, relay or display was connected, disconnect anything attached to:

GPIO0
GPIO2
GPIO5
GPIO12
GPIO15

Then reset the board.

These are the strapping pins sampled during startup.

GPIO12 is especially suspicious when a new circuit prevents the ESP32 from starting.

27. Common problem: analog input stops working after Wi-Fi starts

Check which ADC block the pin belongs to.

If it is:

GPIO0
GPIO2
GPIO4
GPIO12
GPIO13
GPIO14
GPIO15
GPIO25
GPIO26
GPIO27

it belongs to ADC2.

ADC2 shares hardware with Wi-Fi and therefore cannot be used normally while Wi-Fi is running.

Move the analog signal to:

GPIO32
GPIO33
GPIO34
GPIO35
GPIO36
GPIO39

which belong to ADC1.

28. Common problem: GPIO34 doesn’t turn an LED on

GPIO34 is input-only.

The same applies to:

GPIO35
GPIO36
GPIO39

They physically do not contain output drivers.

Use GPIO25, 26, 27, 32 or 33 instead.

29. Common problem: INPUT_PULLUP doesn’t work on GPIO34

Again, GPIO34–39 are special.

Espressif states that these input-only pins do not provide software-enabled pull-up or pull-down resistors.

Add an external resistor.

For example:

3.3 V
 │
10 kΩ
 │
 ├── GPIO34
 │
Button
 │
GND

30. 3.3 V logic only

ESP32 GPIO signals are designed for 3.3 V logic.

Do not connect a 5 V sensor output directly to an ESP32 GPIO.

If a peripheral outputs 5 V logic, use:

  • resistor divider
  • level shifter
  • transistor interface

depending on the signal.

The board’s VIN/5V pin being 5 V does not mean the GPIOs are 5 V tolerant.

31. Final recommendation

The 30-pin ESP32 NodeMCU/DevKit V1 remains one of the easiest ESP32 boards to prototype with because it exposes plenty of useful pins while keeping the classic ESP32’s Wi-Fi, Bluetooth, ADC, touch and DAC features.

For a new project, start with:

GPIO13, 14, 16, 17, 25, 26, 27, 32 and 33

for ordinary digital devices.

Use:

GPIO21/22

for I²C.

Use:

GPIO18/19/23

for SPI.

Use:

GPIO32–39

for analog measurements when Wi-Fi is enabled.

And remember the most important rule:

GPIO0, 2, 5, 12 and 15 are not bad pins — they are boot pins.

They can be used successfully, but only when the connected circuit does not interfere with their required state during reset.

Share your love