The ESP-01 (and its updated sibling, the ESP-01S) is an ESP8266EX-based Wi-Fi module with a notoriously tricky 2x4 pin header. Here is the exact pinout, boot state requirements, and logic-level mapping you need to wire it without frying the silicon.

The Complete ESP-01 Pinout Reference Table

The table below maps the physical 2x4 header to the internal ESP8266EX GPIO numbers. Note that the original ESP-01 and the newer ESP-01S (which includes 1MB of flash and onboard pull-up resistors) share this exact physical layout, but their internal pull-up configurations differ slightly, which we will cover in the next section.

Pin Name (Silkscreen) GPIO Number Default Boot State Function & Practical Notes
GND N/A N/A System Ground (0V). Must share a common ground with your USB-TTL adapter and any external sensors.
GPIO1 / TX GPIO1 Output (HIGH) UART0 Transmit (U0TXD). Outputs boot log garbage at 74880 baud on startup. Do not connect to sensitive inputs without a buffer.
GPIO2 GPIO2 Input (Must be HIGH) Must be HIGH or floating at boot. Also acts as UART1 TX (U1TXD). Controls boot mode; if pulled LOW, the chip enters SDIO boot mode and halts.
GPIO0 GPIO0 Input (Must be HIGH) Boot mode selector. HIGH = Normal execution from flash. LOW = UART download (flash) mode. Floating = unpredictable boot failures.
RST N/A Active LOW Reset pin. Internally pulled up. Pull to GND to reset the module. Never leave floating in high-EMI environments.
VCC N/A N/A 3.3V Power Input. Strictly 3.0V to 3.6V. Requires up to 350mA peak current during Wi-Fi transmission bursts.
CH_PD / EN N/A Active HIGH Chip Enable (labeled CH_PD on old ESP-01, EN on ESP-01S). Must be pulled HIGH (3.3V) for the chip to run. LOW puts it in deep shutdown.
GPIO3 / RX GPIO3 Input UART0 Receive (U0RXD). 3.3V logic level. Used for flashing firmware and standard serial communication.

Rows People Get Wrong (and How to Avoid Bricking Your Module)

When working at the bench, I see the same three mistakes repeatedly with the ESP-01. Understanding the hardware design guidelines from Espressif's official documentation will save you from burning out modules.

CRITICAL WARNING: The 5V Tolerance Myth
The ESP8266EX silicon is strictly 3.3V. The RX (GPIO3) and GPIO0/GPIO2 pins are not 5V tolerant. If you connect a 5V Arduino Uno's TX pin directly to the ESP-01's RX pin, you will forward-bias the internal ESD protection diodes. This will either instantly kill the pin or cause the module to overheat and brownout. Always use a logic level shifter or a simple resistor voltage divider (e.g., 1kΩ series, 2kΩ to GND) when interfacing with 5V logic.

1. The Floating GPIO0 and GPIO2 Trap

On power-up, the ESP8266 samples GPIO0, GPIO2, and GPIO15 to determine its boot mode. If GPIO0 or GPIO2 are left floating (unconnected), ambient EMI can pull them LOW during the critical millisecond of boot, causing the chip to enter SDIO mode or UART flash mode instead of running your code.

The Fix: The newer ESP-01S has internal 10kΩ pull-up resistors on GPIO0 and GPIO2, making it more forgiving. However, the original ESP-01 does not. If you are using an original ESP-01, you must solder external 10kΩ pull-up resistors from GPIO0 and GPIO2 to VCC.

2. Confusing TX and RX Directions

Serial communication requires crossing the lines. The TX pin on your USB-to-TTL adapter (like an FTDI FT232RL or CP2102) must connect to the RX pin on the ESP-01. Conversely, the adapter's RX connects to the ESP-01's TX. If you wire TX-to-TX, you will see absolutely no serial output and flashing will fail with a "Timed out waiting for packet header" error in the Arduino IDE or esptool.

3. Underestimating the VCC Current Spikes

The ESP-01 draws roughly 70mA on average, but when the Wi-Fi radio transmits, it spikes to 300mA–350mA for microseconds. If your 3.3V voltage regulator cannot supply this peak current, or if your breadboard power rails have high impedance, the voltage will droop below 2.8V. This triggers the internal brownout detector, causing the ESP8266 to instantly reboot.

The Fix: Place a 10µF tantalum capacitor and a 100nF ceramic capacitor as close to the VCC and GND pins of the ESP-01 header as physically possible. This local energy reservoir handles the RF transmission spikes.

Wiring Standards: Logic Colors vs. Mains Regional Codes

Because the ESP-01 is overwhelmingly used in DIY smart home relays and Wi-Fi switches, you are often dealing with two completely different wiring standards on the same workbench: the low-voltage DC logic side, and the high-voltage AC mains side.

DC Logic Side: Standard Adapter Colors

When wiring the ESP-01 to a USB-TTL adapter or a breadboard, follow the standard FTDI/RS-232 derived color conventions to avoid catastrophic cross-wiring:

  • Black: GND (Ground)
  • Red: VCC (Strictly 3.3V, do not use the 5V red wire from a standard USB cable)
  • Orange or Yellow: TX (Adapter TX to ESP RX)
  • Green or White: RX (Adapter RX to ESP TX)

Mains Side: Regional AC Wiring Standards (NEC vs. IEC)

If your ESP-01 is driving an opto-isolated relay module to control a 120V/230V AC load, the wire colors connecting your relay to the wall mains must comply with your regional electrical code. Never use DC logic colors (like red or black) for mains wiring, as this creates a lethal hazard for anyone troubleshooting the device later.

Function NEC (US / Canada) - 120V/240V IEC 60446 (EU / UK / AU) - 230V
Line (Hot/Phase) Black (or Red for 2nd phase) Brown
Neutral White (or Grey) Blue
Earth Ground Bare Copper or Green Green with Yellow Stripe

Note: Always consult your local Authority Having Jurisdiction (AHJ). Mains wiring inside DIY smart switches often requires specific enclosure ratings and fusing that go beyond standard hobbyist practices.

Safe Interpretation When Silkscreen is Faded

Cheap clones often have silkscreen that rubs off after a few mating cycles. If your markings are gone, orient the module with the antenna pointing up and the ESP8266 chip facing you. The bottom-left pin is always GND. The bottom-right pin is always GPIO3/RX. The top-left pin is GPIO1/TX, and the top-right is VCC. Verify with a multimeter in continuity mode: the GND pin will show continuity to the metal shielding of the ESP8266EX chip.

Frequently Asked Questions About the ESP-01 Pinout

Can I use the ESP-01 RX/TX pins as standard GPIOs after boot?

Yes, but with caveats. According to the ESP8266EX Datasheet, GPIO1 (TX) and GPIO3 (RX) can be used as standard digital I/O after the boot sequence completes. However, GPIO1 will output a burst of serial garbage at 74880 baud every time the chip resets or wakes from deep sleep. If you are using GPIO1 to drive a relay or a sensitive MOSFET gate, this boot garbage might accidentally trigger your load. GPIO3 (RX) has a slight internal pull-up and is generally safer to repurpose as an input, provided you don't need the hardware UART for debugging.

What happens if I leave the RST pin floating on the ESP-01?

Leaving the RST (Reset) pin floating is a recipe for random, unexplainable reboots. The RST pin is highly sensitive to capacitive coupling and electromagnetic interference (EMI). In a noisy environment—like near a switching power supply or a relay coil—a floating RST pin will act as an antenna, pick up a voltage spike, and pull the chip into a reset state. Always tie the RST pin to VCC (3.3V) via a 10kΩ pull-up resistor if you are not actively using a physical reset button.

How do I identify the pins if the ESP-01 silkscreen is completely faded?

Use the physical PCB layout as your reference. Hold the board so the PCB antenna trace is pointing away from you (upwards), and the black ESP8266 chip is facing you. The 2x4 pin header will have GND on the bottom-left corner and VCC on the top-right corner. You can definitively confirm the GND pin by setting your multimeter to continuity mode and probing the pin against the metal RF shield on top of the ESP8266 chip; they are internally bonded.

Why does my ESP-01 draw 300mA+ and brownout my 3.3V regulator?

The ESP8266 is not a low-power microcontroller like an ATmega328P; it is a full Wi-Fi System-on-Chip. During RF transmission (when connecting to a router or sending an MQTT payload), the power amplifier draws peak currents exceeding 300mA. If you are powering the ESP-01 from the onboard 3.3V regulator of an Arduino Nano or a cheap breadboard power supply, that regulator will overheat and drop its output voltage. The ESP-01's internal brownout detector will then trigger a reboot loop. Use a dedicated AMS1117-3.3 LDO regulator rated for 800mA, paired with adequate bulk capacitance (10µF+) on the output rail.