← all lessons
ESP32 Deep Dive · #14 of 48

ESP32 Pins: Strapping Pins, Input-Only, Boot Traps

Pin Configuration Gotchas

Why it matters

ESP32 pins have special functions. Using the wrong pin can prevent booting, cause unreliable behavior, or damage the chip.

The idea

Strapping Pins

Some pins are sampled at boot to configure the ESP32:

Don’t use these for buttons or outputs unless you understand the implications!

Input-Only Pins

GPIO34–39 are input-only:

Safe GPIO Pins

These pins are generally safe for general-purpose use:

Boot Traps

Common mistakes:

Demo

Pin configuration is critical but not visual. Review this before designing your circuit.

Key takeaways

Going deeper

ESP32 pin functions are documented in the datasheet. For production designs, create a pin assignment table that documents each pin’s function and any constraints. Use GPIO0 for boot mode selection only if you need to enter download mode frequently. For most projects, avoid strapping pins entirely.

Math details

Pin current limits:
  GPIO source: ~40mA max
  GPIO sink: ~28mA max
  Total chip current: ~600mA (check datasheet for your variant)

Pin voltage levels:
  Input HIGH: > 2.4V (0.7 × VDD)
  Input LOW: < 0.8V (0.3 × VDD)
  Output HIGH: ~3.0V (VDD - 0.3V)
  Output LOW: < 0.1V

Implementation

LLM Prompt: Pin Configuration Validator

Write Rust code to validate ESP32 pin configuration.
Check: pin is not strapping pin, pin is not input-only if used as output,
pin is not reserved for special function. Return Result with error messages.
Include helper function to get pin capabilities (input, output, ADC, etc.).

Lab Exercise

  1. Create pin assignment table for your project
  2. Verify no strapping pins used for I/O
  3. Verify input-only pins have external pull-ups
  4. Test boot with all pins connected — verify no boot issues
  5. Document pin functions in code comments

full glossary →