When WiFi drops, SSH locks you out, or a headless boot fails, connecting a Raspberry Pi with PuTTY via the hardware serial UART console is your ultimate fallback. The direct answer: to establish a hardwired serial console, connect a 3.3V USB-to-TTL adapter to GPIO 8 (TX) and GPIO 10 (RX), configure PuTTY for Serial mode at 115200 baud, and ensure enable_uart=1 is set in your Pi's config.txt.
While network SSH is convenient, serial debugging bypasses the network stack entirely. This guide targets the Raspberry Pi 4 Model B (4GB/8GB) running Raspberry Pi OS Bookworm, utilizing the standard 40-pin header. (Note: If you are using a Raspberry Pi 5, the primary debug UART has moved to a dedicated 3-pin JST connector near the USB-C power input, though the standard GPIO UART remains available for secondary peripherals).
Hardware Spec Sheet and Parts List
Using the wrong serial adapter is the most common way beginners fry their Pi's GPIO bank. The Raspberry Pi GPIO operates strictly at 3.3V logic levels. Feeding 5V from a standard Arduino-style FT232RL module into the Pi's RX pin will permanently damage the BCM2711 SoC. Always verify your module's logic level before wiring.
| Component | Exact Variant / Specification | Approx. Cost (2026) |
|---|---|---|
| Single Board Computer | Raspberry Pi 4 Model B (4GB or 8GB RAM) | $55.00 - $75.00 |
| USB-to-TTL Adapter | CP2102 module with 3.3V logic output (verify jumper/solder pad) | $6.50 |
| Jumper Wires | Female-to-Female (F-F) Dupont, 20cm, 24 AWG | $4.00 / pack |
| MicroSD Card | 32GB SanDisk Extreme (A2 rated for OS boot) | $12.00 |
| Host PC Software | PuTTY (v0.80 or later) + Device Manager | Free |
Serial Pin Mapping and Wiring
UART (Universal Asynchronous Receiver-Transmitter) requires a crossover connection. The transmitter (TX) of one device must connect to the receiver (RX) of the other. Do not connect TX to TX, or you will see nothing but a dead terminal.
| Raspberry Pi 4 GPIO (Physical Pin) | BCM GPIO Number | Function | CP2102 Adapter Pin |
|---|---|---|---|
| Pin 6 | N/A | Ground (GND) | GND |
| Pin 8 | GPIO 14 | TXD (Transmit) | RXD (Receive) |
| Pin 10 | GPIO 15 | RXD (Receive) | TXD (Transmit) |
Step-by-Step PuTTY Configuration
Before launching PuTTY, you must enable the serial console on the Pi. If you have physical access to the Pi's SD card, mount it on your PC and edit the config.txt file in the boot partition. Add the following line at the very bottom:
enable_uart=1
This disables the Bluetooth module on the Pi 4 (which shares the PL011 UART clock) and routes the primary console to the GPIO header. For deeper technical details on UART routing, refer to the official Raspberry Pi configuration documentation.
Once the Pi is wired and powered on via its USB-C port, follow these steps on your Windows host:
- Identify the COM Port: Open Windows Device Manager, expand 'Ports (COM & LPT)', and note the COM number assigned to the 'Silicon Labs CP210x USB to UART Bridge' (e.g., COM3).
- Launch PuTTY: Open PuTTY. Under 'Connection type', select the Serial radio button.
- Set Serial Line: Type your COM port (e.g.,
COM3) into the 'Serial line' text box. - Set Speed (Baud Rate): Enter
115200in the 'Speed' box. This is the hardcoded default for the Raspberry Pi bootloader and kernel console. - Configure Serial Parameters: Navigate to Connection -> Serial in the left-hand tree. Ensure Data bits = 8, Stop bits = 1, Parity = None, and Flow control = None.
- Open Session: Click 'Open'. A black terminal window will appear. Press
Entertwice. You should see theraspberrypi login:prompt.
Target Code: UART Heartbeat and Error Handling
Once logged in via PuTTY, you may want to verify the serial port programmatically or build a secondary serial telemetry script. The following Python script targets the Raspberry Pi 4 Model B and uses the pyserial library to open /dev/serial0, send a heartbeat, and catch hardware disconnects.
Install the dependency first: sudo apt install python3-serial
import serial
import time
import sys
# Target: Raspberry Pi 4 Model B
# Port: /dev/serial0 (maps to GPIO 14/15 when enable_uart=1)
SERIAL_PORT = '/dev/serial0'
BAUD_RATE = 115200
TIMEOUT = 2
def init_serial_connection():
try:
# Open the serial port with hardware flow control disabled
ser = serial.Serial(
port=SERIAL_PORT,
baudrate=BAUD_RATE,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=TIMEOUT
)
print(f'Successfully opened {ser.name} at {ser.baudrate} baud.')
return ser
except serial.SerialException as e:
print(f'FATAL: Could not open serial port. Is it locked by another process?')
print(f'Exception details: {e}')
sys.exit(1)
def main():
ser = init_serial_connection()
heartbeat_count = 0
try:
while True:
heartbeat_count += 1
payload = f'[Pi4 UART Heartbeat] Count: {heartbeat_count}\n'
# Write to TX pin (Physical Pin 8)
ser.write(payload.encode('utf-8'))
# Read from RX pin (Physical Pin 10) if data is waiting
if ser.in_waiting > 0:
incoming = ser.read(ser.in_waiting).decode('utf-8').strip()
print(f'Received from external device: {incoming}')
time.sleep(5)
except serial.SerialException as e:
print(f'ERROR: Serial connection dropped during operation. {e}')
except KeyboardInterrupt:
print('\nINFO: Script terminated by user via Ctrl+C.')
finally:
if 'ser' in locals() and ser.is_open:
ser.close()
print('Serial port closed cleanly.')
if __name__ == '__main__':
main()
For comprehensive API details on handling serial buffers and timeouts, consult the PySerial official documentation.
Troubleshooting: Exact Error Strings and Ranked Causes
Serial debugging is unforgiving. If your connection fails, PuTTY will throw specific errors. Do not guess; match your error string to the ranked causes below.
Error 1: 'Unable to open connection to COM3. System error: Access is denied.'
This is the most common Windows-side error when using a Raspberry Pi with PuTTY over serial.
- Cause A (Most Likely): Another application has locked the COM port. Check if Cura (3D printing slicer), Arduino IDE, or a secondary terminal like Tera Term is running in the background and holding the serial port open.
- Cause B: You selected the wrong COM port in PuTTY. Unplug the USB adapter, check Device Manager to see which COM port disappears, and plug it back in to confirm the exact number.
- Cause C: You are using a 'charge-only' USB cable that lacks the internal D+/D- data lines, preventing the CP2102 chip from enumerating correctly in Windows.
Error 2: 'PuTTY fatal error: Disconnected: No supported authentication methods available'
This happens if you accidentally selected 'SSH' instead of 'Serial' in PuTTY, or if you are trying to use SSH over a serial bridge.
- Cause A: Connection type mismatch. Ensure the 'Serial' radio button is selected on the main PuTTY session screen.
- Cause B: If attempting network SSH, the Pi's SSH daemon is disabled by default on fresh Raspberry Pi OS images. Create an empty file named
ssh(no extension) in the boot partition of the SD card to enable it on boot.
If you get a black screen with no login prompt, do these three things in order:
1. Swap TX and RX: 90% of black-screen serial issues are caused by connecting TX-to-TX. Cross the wires (Pi TX to Adapter RX).
2. Verify config.txt: Mount the SD card on your PC and confirm
enable_uart=1 is present and not commented out with a #.3. Check Baud Rate: Ensure PuTTY is set exactly to
115200. If you see garbled wingdings (e.g., ÿÿÿ), your baud rate is mismatched or the Pi is outputting bootloader logs at 460800 before dropping to 115200.
Extending and Simplifying the Build
How to Simplify: If you only need occasional headless access and your network is stable, ditch the serial adapter entirely. Connect the Pi to your router via an Ethernet cable, find its IP via your router's DHCP table, and use PuTTY in SSH mode (Port 22). This eliminates the need for GPIO wiring and config.txt modifications entirely.
How to Extend: For industrial or remote deployments where the Pi is sealed in an enclosure, extend this serial build by adding an RS-485 transceiver module (like the MAX485) to the UART pins. This converts the 3.3V TTL signal into a differential pair capable of traveling hundreds of meters over standard CAT5 cable, allowing you to connect the Raspberry Pi with PuTTY from a control room far away from the physical hardware.
Frequently Asked Questions
How do I find the correct COM port for my Raspberry Pi with PuTTY?
Windows does not label COM ports by device name in PuTTY's dropdown. You must open the Windows Device Manager, expand the Ports (COM & LPT) section, and look for 'Silicon Labs CP210x' or 'FTDI FT232R'. The number in parentheses (e.g., COM4) is what you type into PuTTY's 'Serial line' box. If it doesn't appear, your USB cable is likely charge-only, or you need to install the CP210x VCP drivers from Silicon Labs.
Why is my Raspberry Pi with PuTTY showing a black screen and no login prompt?
A completely black screen with a blinking cursor (or no cursor) means PuTTY has opened the port, but the Pi is not sending data. This is almost always caused by missing the enable_uart=1 directive in config.txt. Without it, the Pi routes the console to the HDMI display or the Bluetooth module instead of the GPIO header. Edit the file on your host PC, safely eject the SD card, and reboot the Pi.
Can I use a Raspberry Pi with PuTTY over WiFi instead of a serial cable?
Yes, but this uses SSH, not the Serial UART protocol. To do this, configure your WiFi credentials in wpa_supplicant.conf (or via the Raspberry Pi Imager's advanced settings), ensure an empty ssh file is in the boot directory, and use PuTTY's 'SSH' connection type on port 22 with the Pi's IP address. Serial UART is strictly for when the network stack is broken, the Pi is booting into a kernel panic, or you need to view early-boot bootloader logs that occur before WiFi initializes.






