# Adafruit RS232 Pal

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/131/122/medium800/adafruit_products_5987-03.jpg?1720621409)

If you're looking to interface with telco, retro or industrial equipment you'll probably run into RS-232 interfaces. **The Adafruit RS232 Pal - Two Channel UART to RS-232 Level Shifters** is your friend in such cases, giving you two duplex channels of level shifting and taking care of the high/negative voltage generation all in a low cost breakout board. We use the trusty [MAX3232E](https://www.ti.com/product/MAX3232E), a classic chip that is part of the MAX232 lineage so you know it will work great for all your RS-232 needs, up to 250Kbps.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/123/medium800/adafruit_products_5987-02.jpg?1720621458)

RS-232 is what we had before USB: a 9 or 25 pin D-Sub connector that would allow data plus flow control lines. Many folks may remember these interfaces were used for mice, modems, barcode scanners, tele-types and more. We still find devices sold that have RS-232 ports, although [many folks use a USB to RS-232 adapter](https://www.adafruit.com/search?q=usb+to+rs-232) these days.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/124/medium800/adafruit_products_5987-01.jpg?1720621506)

If you want to use a microcontroller or microcomputer to chat with a RS-232 then thankfully all you need is a serial port / UART (something just about any microcontroller has) and a level shifter. The level shifter is required because while most UARTs are 0-3.3V or 0-5V logic level, RS-232 requires +-6 to +-10V, yep the signal voltage goes negative! That means a specialized shifter is required, one that can generate the extra high and low voltages and also safely convert the logic levels.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/125/medium800/adafruit_products_5987-00.jpg?1720621541)

Sure you could buy a raw [MAX232 chip](https://www.digikey.com/en/products/detail/texas-instruments/MAX232N/277048) and wire up the necessary capacitors, but this board does it all for you plus it can run on 3.3V power and logic, which many older chips can't do. It also can do 2 duplex channels, so you can have both RX and TX plus two flow control pins like RTS and CTS.

This breakout comes fully assembled with a UART side for low voltage power/logic level and an RS-232 side for high voltage signals plus the doubled and negative voltage rails in case you need to reference them. We also include a bit of header so you can solder it to a breadboard in a few minutes.

# Adafruit RS232 Pal

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/131/126/medium800/adafruit_products_double.jpg?1720622096)

## Power Pins

- **VIN** - this is the power pin. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V microcontroller like Arduino, use 5V. The MAX3232E can generate the extra high and low voltages and also safely convert the logic levels needed for RS-232.
- **GND** - common ground for power and logic.
- **V+** - positive voltage rail output from the RS-232 connection. This pin can be used as a reference voltage.
- **V-** - negative voltage rail output from the RS-232 connection. This pin can be used as a reference voltage.

## Low Voltage Side Pins

The low voltage side of the board, labeled **LV Side** on the board silk, are located on the left side of the board. These pins can interface with your microcontroller UART pins with 3.3V or 5V logic. There are two duplex channels, so you can have both RX and TX plus two flow control pins like RTS and CTS.

- **T1** - Logic data input (from UART)
- **R1** - Logic data output (to UART)
- **T2** - Logic data input (from UART)
- **R2** - Logic data output (to UART)

## High Voltage Side Pins

The high voltage side of the board, labeled **HV Side** on the board silk, are located on the right side of the board. These pins can interface with a RS-232 connection, which can require +-6 to +-10V. There are two duplex channels, so you can have both RX and TX plus two flow control pins like RTS and CTS.

- **T1** - RS-232 line data output (to remote RS-232 system)
- **R1** - RS-232 line data input (from remote RS-232 system)
- **T2** - RS-232 line data output (to remote RS-232 system)
- **R2** - RS-232 line data input (from remote RS-232 system)

# Adafruit RS232 Pal

## CircuitPython and Python

It's easy to use the **RS232 Pal** with Python or CircuitPython, and the built-in UART module. This module allows you to easily write Python code to send and receive UART messages.

You can use this driver with any CircuitPython microcontroller board or with a computer that has GPIO, UART and Python [thanks to Adafruit\_Blinka, our CircuitPython-for-Python compatibility library](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux). For Blinka, this example was tested with a Raspberry Pi. To use the example as-is with built-in UART, you'll need to follow [these configuration steps](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/uart-serial#the-hard-way-using-built-in-uart-2998808) outlined in the Blinka Learn Guide.

### CircuitPython Libraries on Linux and Raspberry Pi - UART / Serial

[CircuitPython Libraries on Linux and Raspberry Pi](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)
[UART / Serial](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/uart-serial)
You'll need an external RS-232 device to use this example with the breakout:

### DE-9 (DB-9) Female Socket to Terminal Spring Block Adapter

[DE-9 (DB-9) Female Socket to Terminal Spring Block Adapter](https://www.adafruit.com/product/4510)
Make your own custom DE-9 cable or DE-9 interface with ease, using this&nbsp; **DE-9 Socket to Terminal Spring Block Adapter**. You get a nice solid PCB with a DE-9 socket and one line of push-terminal blocks. Just flick up the little levers and slide in your stranded or solid core...

In Stock
[Buy Now](https://www.adafruit.com/product/4510)
[Related Guides to the Product](https://learn.adafruit.com/products/4510/guides)
![Angled shot of DE-9 (DB-9) Female Socket to Terminal Spring Block Adapter.](https://cdn-shop.adafruit.com/640x480/4510-03.jpg)

### USB/Serial Converter

[USB/Serial Converter](https://www.adafruit.com/product/18)
This USB cable adds a DB9 serial port to your computer or laptop. Works with MacOS X, Linux and Windows. Note that this provides (approximately) +-6V serial (RS232) not 5V serial (TTL), good for old devices like GPS, handhelds, programmers, etc with chunky DB9's on the side. Some cheaper...

In Stock
[Buy Now](https://www.adafruit.com/product/18)
[Related Guides to the Product](https://learn.adafruit.com/products/18/guides)
![USB to RS-232 DB-9 Serial Converter Cable](https://cdn-shop.adafruit.com/640x480/18-06.jpg)

## CircuitPython Microcontroller Wiring

First, wire up the RS-232 connection to the RS232 Pal exactly as follows. Then, wire up the RS232 Pal to your board. The following is the breakout wired to a Feather RP2040 and RS-232 connection:

- **Feather 3.3V** to **breakout Vin (red wire)**
- **Feather GND** to **breakout GND (black wire)**
- **Feather RX** to **breakout low voltage R1 (green wire)**
- **Feather TX** to **breakout low voltage T1 (blue wire)**
- **Breakout high voltage R1** to **RS-232 RXD [pin 2 on DE-9] (white wire)**
- **Breakout high voltage T1** to **RS-232 TXD [pin 3 on DE-9] (yellow wire)**
- **Breakout GND** to **RS-232 GND [pin 5 on DE-9] (black wire)**

![adafruit_products_featherWire_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/176/medium640/adafruit_products_featherWire_bb.jpg?1720712460)

The following is the breakout wired to a Feather RP2040 and RS-232 connection using a solderless breadboard:

- **Feather 3.3V** to **breakout Vin (red wire)**
- **Feather GND** to **breakout GND (black wire)**
- **Feather RX** to **breakout low voltage R1 (green wire)**
- **Feather TX** to **breakout low voltage T1 (blue wire)**
- **Breakout high voltage R1** to **RS-232 RXD [pin 2 on DE-9] (white wire)**
- **Breakout high voltage T1** to **RS-232 TXD [pin 3 on DE-9] (yellow wire)**
- **Breakout GND** to **RS-232 GND [pin 5 on DE-9] (black wire)**

![adafruit_products_featherBB_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/177/medium640/adafruit_products_featherBB_bb.jpg?1720712757)

## Python Computer Wiring

Since there are _dozens_ of Linux computers/boards you can use, we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).

Here's the Raspberry Pi wired to the RS232 Pal and RS-232 connection:

- **Pi 3.3V** to **breakout Vin (red wire)**
- **Pi GND** to **breakout GND (black wire)**
- **Pi RX** to **breakout low voltage R1 (green wire)**
- **Pi TX** to **breakout low voltage T1 (blue wire)**
- **Breakout high voltage R1** to **RS-232 RXD [pin 2 on DE-9] (white wire)**
- **Breakout high voltage T1** to **RS-232 TXD [pin 3 on DE-9] (yellow wire)**
- **Breakout GND** to **RS-232 GND [pin 5 on DE-9] (black wire)**

![adafruit_products_piWire_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/178/medium640/adafruit_products_piWire_bb.jpg?1720712776)

Here's the Raspberry Pi wired up using a solderless breadboard:

- **Pi 3.3V** to **breakout Vin (red wire)**
- **Pi GND** to **breakout GND (black wire)**
- **Pi RX** to **breakout low voltage R1 (green wire)**
- **Pi TX** to **breakout low voltage T1 (blue wire)**
- **Breakout high voltage R1** to **RS-232 RXD [pin 2 on DE-9] (white wire)**
- **Breakout high voltage T1** to **RS-232 TXD [pin 3 on DE-9] (yellow wire)**
- **Breakout GND** to **RS-232 GND [pin 5 on DE-9] (black wire)**

![adafruit_products_piBB_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/179/medium640/adafruit_products_piBB_bb.jpg?1720712814)

## CircuitPython Usage

To use with CircuitPython,&nbsp;you'll need to update **code.py** with the example script.

Thankfully, we can do this in one go. In the example below, click the **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file, and copy&nbsp;the **code.py** file to your **CIRCUITPY** drive.

There are no additional libraries needed for this example. All of the modules used are built-in.

Info: No additional libraries need to be added to the <b>/lib</b> folder on your <b>CIRCUITPY</b> drive.

## Python Usage

Once you have the library `pip3` installed on your computer, copy or download the following example to your computer, and run the following, replacing **code.py** with whatever you named the file:

`python3 code.py`

Warning: Make sure to follow the [built-in UART setup steps](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/uart-serial#the-hard-way-using-built-in-uart-2998808) if you are using the UART on the Raspberry Pi.

## Example Code

**If running CircuitPython:** Once everything is saved to the **CIRCUITPY** drive, [connect to the serial console](https://learn.adafruit.com/welcome-to-circuitpython/kattni-connecting-to-the-serial-console) to see the data printed out!

**If running Python:** The console output will appear wherever you are running Python.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/RS-232_Pal_Demos/CircuitPython/code.py

The code begins by initializing the UART port. There is a check for a Raspberry Pi single board computer. If a Raspberry Pi is detected, then `serial` is used instead of `busio` for UART over GPIO. The baud rate for your RS-232 device is defined with&nbsp;`baud`. Edit this value to match your RS-232 device.

```python
# baud rate for your device
baud = 38400
```

In the loop, the code waits for user input in the serial console. If any incoming data is received from the RS-232 device, it is printed to the serial console.

The commands that you send will vary by the RS-232 device that you connect to the RS232 Pal. The output below was sent to a [StarTech HDMI switcher](https://cdn-learn.adafruit.com/assets/assets/000/131/190/original/vs421hd4ka.pdf?1720715335). The `AVI=n` commands switch the selected HDMI port and the `VS` command gives a current status of the device.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/174/medium800/adafruit_products_cp_serial.png?1720711420)

# Adafruit RS232 Pal

## Python Docs

# Adafruit RS232 Pal

## Arduino

Using the RS232 PAL with Arduino involves wiring up the breakout to your Arduino-compatible microcontroller with an external RS-232 device and running the provided example code.

### DE-9 (DB-9) Female Socket to Terminal Spring Block Adapter

[DE-9 (DB-9) Female Socket to Terminal Spring Block Adapter](https://www.adafruit.com/product/4510)
Make your own custom DE-9 cable or DE-9 interface with ease, using this&nbsp; **DE-9 Socket to Terminal Spring Block Adapter**. You get a nice solid PCB with a DE-9 socket and one line of push-terminal blocks. Just flick up the little levers and slide in your stranded or solid core...

In Stock
[Buy Now](https://www.adafruit.com/product/4510)
[Related Guides to the Product](https://learn.adafruit.com/products/4510/guides)
![Angled shot of DE-9 (DB-9) Female Socket to Terminal Spring Block Adapter.](https://cdn-shop.adafruit.com/640x480/4510-03.jpg)

### USB/Serial Converter

[USB/Serial Converter](https://www.adafruit.com/product/18)
This USB cable adds a DB9 serial port to your computer or laptop. Works with MacOS X, Linux and Windows. Note that this provides (approximately) +-6V serial (RS232) not 5V serial (TTL), good for old devices like GPS, handhelds, programmers, etc with chunky DB9's on the side. Some cheaper...

In Stock
[Buy Now](https://www.adafruit.com/product/18)
[Related Guides to the Product](https://learn.adafruit.com/products/18/guides)
![USB to RS-232 DB-9 Serial Converter Cable](https://cdn-shop.adafruit.com/640x480/18-06.jpg)

## Wiring

Wire as shown for a **5V** board like an Uno. If you are using a **3V** board, like an Adafruit Feather, wire the board's 3V pin to the breakout VIN.

Here is an Adafruit Metro wired up to the breakout with an external RS-232 connection:

- **Metro 5V** to **breakout Vin (red wire)**
- **Metro GND** to **breakout GND (black wire)**
- **Metro pin 2** &nbsp;to **breakout low voltage R1 (green wire)**
- **Metro pin 3** &nbsp;to **breakout low voltage T1 (blue wire)**
- **Breakout high voltage R1** to **RS-232 RXD [pin 2 on DE-9] (white wire)**
- **Breakout high voltage T1** to **RS-232 TXD [pin 3 on DE-9] (yellow wire)**
- **Breakout GND** to **RS-232 GND [pin 5 on DE-9] (black wire)**

![adafruit_products_metroWire_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/184/medium640/adafruit_products_metroWire_bb.jpg?1720714722)

Here is an Adafruit Metro wired up using a solderless breadboard:

- **Metro 5V** to **breakout Vin (red wire)**
- **Metro GND** to **breakout GND (black wire)**
- **Metro pin 2** to **breakout low voltage R1 (green wire)**
- **Metro pin 3** to **breakout low voltage T1 (blue wire)**
- **Breakout high voltage R1** to **RS-232 RXD [pin 2 on DE-9] (white wire)**
- **Breakout high voltage T1** to **RS-232 TXD [pin 3 on DE-9] (yellow wire)**
- **Breakout GND** to **RS-232 GND [pin 5 on DE-9] (black wire)**

![adafruit_products_metroBB_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/186/medium640/adafruit_products_metroBB_bb.jpg?1720714769)

Info: There are no additional libraries needed for this example.

## Example Code

You can change the baud rate for your RS-232 device at the top of the code by editing the `baud` define:

`#define baud 38400`

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/RS-232_Pal_Demos/Arduino_RS-232_Pal/Arduino_RS-232_Pal.ino

Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 115200 baud. You can send commands to your RS-232 device via the Serial Monitor. If any messages are received from the RS-232 device, they will print to the Serial Monitor.

![](https://cdn-learn.adafruit.com/assets/assets/000/131/187/medium800/adafruit_products_arduino_serial.png?1720714940)

The commands that you send will vary by the RS-232 device that you connect to the RS232 Pal. The output above was sent to a [StarTech HDMI switcher](https://cdn-learn.adafruit.com/assets/assets/000/131/190/original/vs421hd4ka.pdf?1720715335). The `AVI=n` commands switch the selected HDMI port and the `VS` command gives a current status of the device.

# Adafruit RS232 Pal

## Arduino Docs

# Adafruit RS232 Pal

## Downloads

## Files

- [MAX3232E Datasheet](https://cdn-learn.adafruit.com/assets/assets/000/131/091/original/max3232e.pdf?1720443453)
- [EagleCAD PCB Files on GitHub](https://github.com/adafruit/Adafruit-RS232-Pal-PCB)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20RS232%20Pal.fzpz)

## Schematic and Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/131/093/medium800/adafruit_products_schem.png?1720443540)

![](https://cdn-learn.adafruit.com/assets/assets/000/131/094/medium800/adafruit_products_fab.png?1720443546 dimensions are in inches)


## Primary Products

### Adafruit RS232 Pal - Two Channel UART to RS-232 Level Shifters

[Adafruit RS232 Pal - Two Channel UART to RS-232 Level Shifters](https://www.adafruit.com/product/5987)
If you're looking to interface with telco, retro or industrial equipment you'll probably run into RS-232 interfaces. **The Adafruit RS232 Pal - Two Channel UART to RS-232 Level Shifters** is your friend in such cases, giving you two duplex channels of level shifting and...

In Stock
[Buy Now](https://www.adafruit.com/product/5987)
[Related Guides to the Product](https://learn.adafruit.com/products/5987/guides)

## Featured Products

### DE-9 (DB-9) Female Socket to Terminal Spring Block Adapter

[DE-9 (DB-9) Female Socket to Terminal Spring Block Adapter](https://www.adafruit.com/product/4510)
Make your own custom DE-9 cable or DE-9 interface with ease, using this&nbsp; **DE-9 Socket to Terminal Spring Block Adapter**. You get a nice solid PCB with a DE-9 socket and one line of push-terminal blocks. Just flick up the little levers and slide in your stranded or solid core...

In Stock
[Buy Now](https://www.adafruit.com/product/4510)
[Related Guides to the Product](https://learn.adafruit.com/products/4510/guides)
### USB/Serial Converter

[USB/Serial Converter](https://www.adafruit.com/product/18)
This USB cable adds a DB9 serial port to your computer or laptop. Works with MacOS X, Linux and Windows. Note that this provides (approximately) +-6V serial (RS232) not 5V serial (TTL), good for old devices like GPS, handhelds, programmers, etc with chunky DB9's on the side. Some cheaper...

In Stock
[Buy Now](https://www.adafruit.com/product/18)
[Related Guides to the Product](https://learn.adafruit.com/products/18/guides)

## Related Guides

- [Talking HAL 9000 with RP2040 Prop Maker Feather](https://learn.adafruit.com/hal-9000-rp2040-prop-maker.md)
- [Adafruit HDC1008 Temperature and Humidity Sensor Breakout](https://learn.adafruit.com/adafruit-hdc1008-temperature-and-humidity-sensor-breakout.md)
- [Adafruit CAN Bus BFF](https://learn.adafruit.com/adafruit-can-bus-bff.md)
- [Adafruit PCA9548 8-Channel STEMMA QT / Qwiic I2C Multiplexer](https://learn.adafruit.com/adafruit-pca9548-8-channel-stemma-qt-qwiic-i2c-multiplexer.md)
- [Adafruit Pixel Shifter](https://learn.adafruit.com/adafruit-pixel-shifter.md)
- [Pi Hole Ad Detection Display with PiTFT](https://learn.adafruit.com/pi-hole-ad-pitft-tft-detection-display.md)
- [Adafruit Fruit Jam](https://learn.adafruit.com/adafruit-fruit-jam.md)
- [Adafruit Microphone Amplifier Breakout](https://learn.adafruit.com/adafruit-microphone-amplifier-breakout.md)
- [QT Py Heart Shaped NeoPixel PCB](https://learn.adafruit.com/qtpy-heart-pcb.md)
- [Adafruit bq25185 USB / DC / Solar Lithium Ion/Polymer Charger](https://learn.adafruit.com/adafruit-bq25185-usb-dc-solar-lithium-ion-polymer-charger.md)
- [Adafruit Metro Mini](https://learn.adafruit.com/adafruit-metro-mini.md)
- [FunHouse Parking Assistant](https://learn.adafruit.com/funhouse-parking-assistant.md)
- [Adafruit ItsyBitsy ESP32](https://learn.adafruit.com/adafruit-itsybitsy-esp32.md)
- [Adafruit PCF8523 Real Time Clock](https://learn.adafruit.com/adafruit-pcf8523-real-time-clock.md)
- [CircuitPython Hardware: PCA9685 PWM & Servo Driver](https://learn.adafruit.com/micropython-hardware-pca9685-pwm-and-servo-driver.md)
