To connect a Raspberry Pi to a WiFi terminal module like the ESP-01S via UART, you must wire the Pi's 5V power (Pin 2) into a dedicated 3.3V LDO regulator, then route that regulated 3.3V to the ESP VCC and CH_PD pins. Ground (Pin 6) is shared across the Pi, LDO, and ESP. Data flows from the Pi's TXD (Pin 8 / GPIO 14) to the ESP's RXD, and from the ESP's TXD to the Pi's RXD (Pin 10 / GPIO 15). Never power the ESP-01S directly from the Pi's 3.3V Pin 1; the module's 300mA RF transmission spikes will brownout the Pi's SoC.

Tracing the Path: Power, Ground, and UART Data Flow

When reading this wiring diagram, we trace the circuit from the source (Raspberry Pi power and data pins) through the conditioning components, and finally to the load (the ESP-01S WiFi terminal). Understanding this node-by-node path prevents the most common failure mode: frying the module or crashing the host.

1. The Power Path (Source to Load)

  • Node A (Source): 5V DC originates at Raspberry Pi Pin 2 (5V Power).
  • Node B (Conditioning): The 5V feeds the input (Vin) of an AMS1117-3.3 linear voltage regulator. A 10µF ceramic capacitor sits across the input and ground to filter high-frequency noise.
  • Node C (Regulated Rail): The AMS1117 outputs a stable 3.3V. A 100µF tantalum capacitor is placed across this output and ground to supply the instant current demand when the ESP-01S activates its RF amplifier.
  • Node D (Load Power): The regulated 3.3V splits to the ESP-01S VCC pin and the CH_PD (Chip Enable) pin. Both must see 3.3V for the module to boot.

2. The Ground Path (Polarity and Common Reference)

Ground is not just a safety path; it is the 0V reference for all UART logic signals. The path begins at Raspberry Pi Pin 6 (GND), connects to the AMS1117 GND pin, and terminates at the ESP-01S GND pin. If this common ground is broken or has high resistance, the Pi's 3.3V TX signal will not be recognized by the ESP, resulting in garbage data on the serial monitor.

3. The UART Data Path (Cross-Wired Logic)

  • Transmit to Receive: Pi Pin 8 (TXD / GPIO 14) wires directly to ESP-01S RXD.
  • Receive to Transmit: Pi Pin 10 (RXD / GPIO 15) wires directly to ESP-01S TXD.
Callout Tip: Logic Level Polarity
The ESP-01S operates strictly at 3.3V logic. While the Raspberry Pi GPIO pins also output 3.3V, never connect a 5V microcontroller (like an Arduino Uno) directly to the ESP-01S RXD/TXD pins without a logic level shifter. Overvoltage on the ESP RXD pin will permanently destroy the silicon.

4. Control Pin Terminations (RST and GPIO0)

The diagram shows the RST (Reset) pin pulled HIGH to 3.3V via a 10kΩ resistor. If left floating, electrostatic discharge will randomly reset the WiFi terminal. The GPIO0 pin is also pulled HIGH via a 10kΩ resistor for normal execution mode (pulled LOW only during firmware flashing).

Terminal and Pin Mapping Specification

The physical ESP-01S module features a 2x4 male header. When holding the board with the PCB antenna pointing UP and the black ESP chip facing you, the left column is Pins 1-4 (top to bottom) and the right column is Pins 5-8 (top to bottom). Pin 1 (GND) is top-left in this specific orientation, though silkscreen layouts vary by manufacturer. Always verify against the silkscreen on your specific board.

Table 1: Raspberry Pi to ESP-01S WiFi Terminal Pin Mapping
Raspberry Pi Physical Pin Pi BCM GPIO ESP-01S Physical Pin ESP-01S Function Recommended Wire Color
Pin 2 5V Power N/A (To AMS1117 Vin) Source Power Red
Pin 6 GND Pin 1 (Top-Left) Ground Reference Black
N/A (AMS1117 Vout) 3.3V Regulated Pin 8 (Bottom-Right) VCC (Main Power) Orange
N/A (AMS1117 Vout) 3.3V Regulated Pin 5 (Top-Right) CH_PD (Chip Enable) Yellow
Pin 8 GPIO 14 (TXD) Pin 7 (Bottom-Right)* RXD (Receive Data) Green
Pin 10 GPIO 15 (RXD) Pin 2 (Top-Left)* TXD (Transmit Data) Blue
N/A (3.3V via 10kΩ) Pull-Up Pin 3 (Middle-Left) RST (Reset) White
N/A (3.3V via 10kΩ) Pull-Up Pin 6 (Middle-Right) GPIO0 (Boot Mode) Purple

*Note: Physical pin locations for TXD/RXD vary slightly between AI-Thinker and clone manufacturers. Always trust the silkscreen labels over physical position.

For deeper architectural context on how the Raspberry Pi routes these UART signals through the SoC, refer to the official Raspberry Pi UART configuration documentation. For the ESP8266 hardware design constraints, consult the Espressif ESP8266 Hardware Design Guidelines.

Verifying Connections with a Multimeter

Before applying power to the Raspberry Pi, you must verify the wiring. A single miswired 5V line will instantly destroy the ESP-01S. Set your multimeter to the appropriate modes and follow this verification sequence.

  1. Verify Common Ground (Continuity Mode): Set the meter to continuity (the diode/beep symbol). Place the black probe on the Raspberry Pi GND pin (Pin 6) and the red probe on the ESP-01S GND pin. The meter should read less than 1.0 Ω and emit a continuous tone. Repeat this between the AMS1117 GND tab and the Pi GND. If resistance is high, re-crimp your ground connections.
  2. Verify Power Rail Isolation (Resistance Mode): With the Pi completely unpowered, measure the resistance between the ESP-01S VCC pin and GND pin. You should see a high resistance (typically >10kΩ) or a brief low reading that climbs as the multimeter charges the 100µF capacitor. If it reads a dead short (0 Ω), check for solder bridges or a failed capacitor before applying power.
  3. Verify Regulated Voltage (DC Voltage Mode): Power on the Raspberry Pi. Set the meter to DC Volts. Place the black probe on the common ground and the red probe on the AMS1117 Vout pin. The reading must be strictly between 3.25V and 3.35V. If you read 5V, the LDO is wired backward or failed—immediately disconnect power.
  4. Verify Logic Highs on Control Pins: Keep the meter in DC Volts mode. Probe the ESP-01S CH_PD and RST pins. Both must read ≥ 3.2V relative to ground. If they read 0V or float around 1.1V, your 10kΩ pull-up resistors are missing or disconnected, and the module will not boot.

Frequently Asked Questions

How do I connect my Raspberry Pi to a WiFi network using the terminal CLI?

If your goal is software-based—connecting a Raspberry Pi with built-in WiFi to a network via the command line terminal rather than wiring an external module—you should use nmcli (NetworkManager Command Line Interface) on modern Raspberry Pi OS (Bookworm and later). Open your terminal and scan for networks using nmcli dev wifi. Then, connect by executing: sudo nmcli dev wifi connect "YourNetworkSSID" password "YourPassword". For older OS versions (Bullseye and earlier), use sudo raspi-config and navigate to System Options > Wireless LAN.

Why does my Raspberry Pi drop the WiFi terminal UART connection under load?

This is almost always a power brownout masquerading as a software crash. When the ESP-01S transmits data over WiFi, it draws current spikes up to 350mA. If you are powering the module directly from the Pi's 3.3V Pin 1, or if your AMS1117 LDO lacks the 100µF output capacitor, the voltage at the ESP VCC pin will momentarily sag below 2.8V. This triggers the ESP's internal brownout detector, causing it to reset and drop the UART connection. Always use the LDO and bulk capacitor trace outlined in the diagram above.

Can I connect a Raspberry Pi 5 to a WiFi terminal using the default UART pins?

The Raspberry Pi 5 changed the UART architecture significantly. The primary PL011 UART is no longer exposed on the standard 40-pin header by default; it is routed to the RP1 southbridge for PCIe and debug functions. To use Pins 8 and 10 for an external WiFi terminal on a Pi 5, you must enable a secondary UART overlay. Add dtoverlay=uart0 to your /boot/firmware/config.txt file and reboot. Alternatively, use a USB-to-Serial adapter (like an FTDI FT232RL) which bypasses the GPIO UART mapping complexities entirely and provides robust 5V-tolerant buffering.

What do the TXD and RXD diagram symbols mean in this drawing?

TXD stands for Transmit Data, and RXD stands for Receive Data. In UART communication, data flows in one direction per wire. The fundamental rule of UART wiring is that a transmitter must always connect to a receiver. Therefore, the TXD pin of Device A must wire to the RXD pin of Device B, and vice versa. If you wire TXD to TXD, both devices are shouting on the same line, and no data will be received. The diagram symbols represent the logical function of the pin on that specific chip, not the destination it should connect to.