To physically connect a Raspberry Pi to WiFi using an external hardware bridge—bypassing the onboard radio for long-range IoT, Faraday cage environments, or industrial isolation—you wire an ESP32-S3 module to the Pi's SPI0 bus. The direct answer: MOSI goes to GPIO 10 (Pin 19), MISO to GPIO 9 (Pin 21), SCLK to GPIO 11 (Pin 23), and CS to GPIO 8 (Pin 24), with a shared ground and 3.3V logic level. This guide traces the exact node-by-node hardware path, decodes the schematic symbols, and provides multimeter verification steps to ensure your SPI WiFi bridge is wired correctly before applying power.

Hardware Path Trace: Raspberry Pi 5 to ESP32-S3 WiFi Bridge

When reading a wiring diagram for an SPI-based WiFi co-processor, you must trace three distinct paths: power delivery, data signaling, and the ground return. Here is the textual node-by-node trace from source to load.

1. Power Delivery Path (Source to Load)

The path begins at the Raspberry Pi 5's PMIC (Power Management IC), which steps down the 5V USB-C input to a regulated 3.3V rail. This 3.3V rail feeds the GPIO header at Physical Pin 1. The current flows through a 22 AWG silicone jumper wire into the ESP32-S3 DevKitC's 3V3 pin, passing through the module's onboard AMS1117-3.3 LDO regulator (if feeding via the 5V/VIN pin) or directly to the ESP32-S3 silicon if feeding the 3V3 pin directly. For this bridge, we feed the 3V3 pin directly to minimize thermal dropout.

2. Data Signaling Path (SPI0 Bus)

Data originates at the Pi's BCM2712 SoC SPI0 controller. The trace exits the SoC and routes to the 40-pin header:

  • MOSI (Master Out Slave In): Leaves Pi Pin 19 (GPIO 10) and terminates at ESP32-S3 GPIO 11.
  • MISO (Master In Slave Out): Leaves ESP32-S3 GPIO 13 and terminates at Pi Pin 21 (GPIO 9).
  • SCLK (Serial Clock): Leaves Pi Pin 23 (GPIO 11) and terminates at ESP32-S3 GPIO 12.
  • CS (Chip Select): Leaves Pi Pin 24 (GPIO 8) and terminates at ESP32-S3 GPIO 10.

3. Decoding Diagram Symbols

In standard SPI wiring schematics, you will encounter specific symbols. VCC or 3V3 denotes the positive logic-level power rail (never connect 5V here, or you will fry the ESP32's silicon). GND represents the 0V reference plane. MOSI/MISO indicate data direction relative to the Master (the Pi). CS (sometimes labeled SS for Slave Select) is an active-low signal; a line over the symbol (e.g., CS) means the device is selected when the voltage drops to 0V. IRQ/HANDSHAKE is an out-of-band GPIO used by the ESP32 to interrupt the Pi when a WiFi packet arrives, preventing the Pi from polling the SPI bus blindly.

Terminal Pinout and Wiring Mapping Table

Before cutting wires to length, map your physical connections using the table below. This data-dense mapping ensures you align the Broadcom (BCM) pin numbers used in Linux with the physical header pins on the board.

Pi 5 Physical Pin Pi BCM GPIO Signal Function ESP32-S3 Physical Pin ESP32 GPIO Wire Color (Std)
1 N/A (Power) 3.3V VCC 3V3 (Top Left) N/A (Power) Red
6 N/A (Ground) System GND GND (Top Right) N/A (Ground) Black
19 GPIO 10 SPI0 MOSI D11 (Left side) GPIO 11 Green
21 GPIO 9 SPI0 MISO D13 (Left side) GPIO 13 Yellow
23 GPIO 11 SPI0 SCLK D12 (Left side) GPIO 12 Blue
24 GPIO 8 SPI0 CS0 D10 (Left side) GPIO 10 Orange
18 GPIO 24 IRQ / Handshake D4 (Right side) GPIO 4 Purple
Logic Level Compatibility: Both the Raspberry Pi 5 (BCM2712) and the ESP32-S3 operate at 3.3V logic. You do not need a bidirectional logic level shifter (like the BSS138 MOSFET circuit used for 5V Arduinos). Wiring them directly is safe and preserves signal integrity at high SPI clock speeds (up to 20MHz).

Verifying the Connections with a Multimeter

Never apply power to a newly wired SPI bus without verifying the physical layer. A single misaligned pin (e.g., shifting by one row and feeding 5V into a GPIO) will instantly destroy the ESP32-S3's RF frontend. Use a digital multimeter (DMM) to perform these three verification steps.

Step 1: Dead-Short and Continuity Check (Power OFF)

With both boards completely unpowered, set your DMM to continuity mode (the diode/beep symbol).

  • Ground Path: Place the red probe on Pi Physical Pin 6 and the black probe on the ESP32 GND pin. You should read < 0.5 ohms and hear a continuous beep. This confirms a solid equipotential ground bond.
  • VCC Short Check: Place probes across Pi Pin 1 (3.3V) and Pin 6 (GND). You should read an open circuit (OL) or a high resistance (typically 10kΩ to 50kΩ due to onboard decoupling capacitors and pull-ups). If it reads < 5 ohms, you have a solder bridge or a miswired pin. Do not apply power.

Step 2: Idle Voltage Verification (Power ON, No Code Running)

Boot the Raspberry Pi but do not load the SPI kernel overlay yet. Set your DMM to DC Voltage.

  • Rail Voltage: Probe Pi Pin 1 (Red) to Pin 6 (Black). Expect 3.28V to 3.32V. If it reads below 3.1V, the Pi's PMIC is overloaded or the USB-C supply is sagging.
  • Chip Select (CS) Idle State: Probe Pi Pin 24 (CS) to GND. Because CS is active-low and no SPI transaction is occurring, the BCM2712 holds this line high. You should read ~3.3V.

Step 3: Active Signal Verification (Under Load)

A standard DMM cannot accurately read 20MHz SPI clock pulses, but you can verify the IRQ line. Once your Linux SPI driver and the ESP32 firmware are running, probe the IRQ wire (Pi Pin 18). When the ESP32 receives a WiFi packet, it pulls this line low. You should see the DMM voltage briefly dip from 3.3V toward 0V, confirming the hardware handshake is functioning.

Power Delivery and Grounding Best Practices

The most common point of failure when users connect a Raspberry Pi to WiFi via an external module is not the data wiring—it is the power delivery during RF transmission.

Handling the TX Current Spike

When the ESP32-S3 transmits a WiFi packet at +20 dBm, the internal PA (Power Amplifier) draws an instantaneous current spike of up to 350mA. While the Raspberry Pi 5's 3.3V rail can theoretically supply 1.2A, the long trace inductance of jumper wires will cause a voltage brownout at the ESP32's VCC pin during this microsecond spike, leading to a watchdog reset or a corrupted SPI frame.

The Fix: You must add local decoupling at the ESP32's power entry point. Solder a 100µF tantalum capacitor (for low-frequency bulk storage) in parallel with a 0.1µF ceramic capacitor (for high-frequency transient response) directly across the ESP32's 3V3 and GND pins. Keep the ceramic capacitor's leads as short as physically possible to minimize parasitic inductance.

Ground Return Path and Signal Integrity

SPI is a single-ended signaling standard, meaning all data voltages are referenced to the ground path. If the ground wire between the Pi and the ESP32 is too long or thin, the 350mA TX spikes will create a ground bounce (a temporary voltage differential between the Pi's GND and the ESP32's GND). This ground bounce shifts the logic threshold, causing the Pi to misread MISO data.

  • Wire Gauge: Use a minimum of 22 AWG stranded silicone wire for both VCC and GND.
  • Parallel Grounding: For high-reliability industrial setups, run two ground wires from the Pi header (e.g., Pin 6 and Pin 9) to two separate GND pins on the ESP32 DevKit. This halves the ground impedance.
  • Trace Length: Keep all SPI data wires under 10 cm (4 inches). If you need to mount the ESP32 further away to position its antenna outside an enclosure, do not extend the SPI bus. Instead, use a USB-to-UART bridge or run the SPI signals through a differential RS-422 line driver.

By treating the WiFi bridge as a high-speed digital circuit rather than a simple serial peripheral, you eliminate the intermittent disconnects and kernel panics that plague poorly wired IoT prototypes. For deeper configuration of the Linux SPI subsystem, refer to the Linux Kernel SPI documentation, and for the ESP32-S3 RF power characteristics, consult the official Espressif ESP32-S3 datasheet. Additional GPIO mapping details can be verified via the Raspberry Pi hardware documentation.