ESP32 S3 UNO RS422
This ESP32 S3 Uno RS422 tutorial shows you how to send and receive serial data over long cables with a TTL to RS422 module. The ESP32 S3 Uno form board talks to the module with plain UART, and the module turns it into a strong differential RS-422 signal. At the end, you will type text on your PC and see it come back through the RS422 line.
In this tutorial, you will:
- Wire a TTL to RS422 module to the ESP32 S3 Uno.
- Receive data from an RS422 device with Arduino code.
- Send data to an RS422 device through the module.
- Use a second hardware UART (Serial2) on any pins instead of SoftwareSerial.
- Test RS-422 communication with your PC in both directions.

Hardware Preparation
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of TTL to RS422 Module
The board's own TX and RX pins are fine for short wires on your desk. For long cables or noisy places, you need a stronger signal, and that is the job of this module.
When you call Serial.print(), Serial.read() or Serial.write(), the ESP32 S3 Uno sends bits out of a TX pin and reads bits on an RX pin. These pins use TTL logic levels (0V and 3.3V on this board). A TTL signal gets weak and picks up noise after a few meters, so it is not good for long distances. Standards like RS232, RS422 and RS485 solve this problem.
The TTL to RS422 module converts the board's TTL signal into an RS422 signal, and back again. RS422 sends each signal on a pair of wires (a differential pair), so it can travel far and ignore most electrical noise.
Pinout
The module has two sides. One side talks to the ESP32 S3 Uno, and the other side talks to the RS422 device.
TTL Side (to the ESP32 S3 Uno)
| Pin | What it does |
|---|---|
| VCC | Power input. Connect to 5V or 3.3V |
| GND | Ground. Connect to GND (0V) |
| RXD | Data input of the module. Connect to the TX pin of the ESP32 S3 Uno |
| TXD | Data output of the module. Connect to the RX pin of the ESP32 S3 Uno |
RS422 Side (to the other device)
| Pin | What it does |
|---|---|
| A (R+) | RX+ of the module. Connect to TX+ (T+ or Y) of the other RS422 device |
| B (R-) | RX- of the module. Connect to TX- (T- or Z) of the other RS422 device |
| Y (T+) | TX+ of the module. Connect to RX+ (R+ or A) of the other RS422 device |
| Z (T-) | TX- of the module. Connect to RX- (R- or B) of the other RS422 device |
Remember the simple rule: the transmit pair of one device always goes to the receive pair of the other.

ESP32 S3 Uno Pinout
The image below shows the pinout of the ESP32 S3 Uno form board. Use it to find the Uno header pins (D0, D1, D6, D7…) and their GPIO numbers while you wire the module.

Wiring Diagram
This tutorial has two wiring options. Pick the one that matches the code you plan to upload.
Option 1 - Serial1 on D0 and D1

This image is created using Fritzing. Click to enlarge image
| RS422 Module Pin | ESP32 S3 Uno Pin |
|---|---|
| VCC | 5V |
| GND | GND |
| RXD | D1 (GPIO43) |
| TXD | D0 (GPIO44) |
WARNING
D0 (GPIO44) and D1 (GPIO43) are the UART0 pins of the ESP32 S3 Uno. They are also used for USB serial, code upload and boot messages. While the module is connected here, uploading can fail and the RS422 device can get boot messages at power-up. Unplug the TXD and RXD wires while you upload code. If you also need the Serial Monitor, use Option 2 instead.
Option 2 - Serial2 on D6 and D7

This image is created using Fritzing. Click to enlarge image
| RS422 Module Pin | ESP32 S3 Uno Pin |
|---|---|
| VCC | 5V |
| GND | GND |
| RXD | D7 (GPIO14) |
| TXD | D6 (GPIO3) |
WARNING
D6 is GPIO3, a boot strapping pin on the ESP32 S3 Uno. The chip reads it at startup. If the module pulls this pin to a strange level during power-up, the board may not boot or upload correctly. If that happens, unplug the TXD wire from D6, upload or reset, then plug it back in.
WARNING
ESP32 S3 Uno pins are NOT 5V tolerant. When the module is powered from 5V, its TXD pin sends 5V signals into the board's RX pin (D0 or D6). To protect the board, either power the module from the 3.3V pin instead of 5V (the module works at 3.3V), or put a 5V to 3.3V level converter on the TXD line. The RXD line (board to module) is safe, because the board only sends 3.3V.
How To Program ESP32 S3 Uno to use the RS422 module
The module does all the RS422 conversion for you. On the code side, it looks like a normal serial port, so you only need the standard Serial functions.
Start a Hardware Serial Port
The ESP32 S3 Uno lets you place a hardware UART on almost any pins. You tell begin() the baud rate, the data format, the RX pin and the TX pin:
No SoftwareSerial? Use Serial2
The SoftwareSerial library does not exist for the ESP32 S3 Uno. You do not need it, because the board has a spare hardware UART. Put Serial2 on D6 and D7 like this:
Read Data from RS422
Use any of these functions to read what the RS422 device sends:
Send Data to RS422
Use any of these functions to send data out to the RS422 device:
Just replace Serial with Serial1 or Serial2. You can find more functions in the Serial reference.
ESP32 S3 Uno Code for Hardware Serial
This sketch starts Serial1 on D0 (GPIO44) and D1 (GPIO43) at 9600 baud. Every character that arrives from the RS422 line is sent straight back, so the other device sees an echo. Use it with the Option 1 wiring.
ESP32 S3 Uno Code for Serial2 (instead of Software Serial)
This version does the same echo job, but it uses Serial2 on D6 (GPIO3) and D7 (GPIO14). It replaces the SoftwareSerial sketch used on other boards, and it keeps the USB serial port free. Use it with the Option 2 wiring.
Testing
The quickest way to test is to let your PC play the role of the RS422 device. You type text on the PC, it travels through the RS422 cable, and the ESP32 S3 Uno sends it right back.
Upload the Code
- New to the ESP32 S3 Uno? Follow ESP32 S3 Uno - Getting Started first.
- Wire it up as shown in the diagram for the option you chose.
- Connect the board to your computer with a USB Type-C cable.
- Open Arduino IDE, choose the ESP32S3 Dev Module board and the correct COM port.
- Copy the code for your wiring option and paste it into the Arduino IDE.
- Upload the code by clicking the Upload button. With Option 1, unplug the module's TXD and RXD wires during upload and plug them back in after.
Talk to the Board from Your PC
- Connect the RS422 side of the module to your PC with an RS422 to USB cable, as shown below.

- Open the terminal on the COM port of the RS422 to USB cable, and set it to 9600 baud, 8 data bits, no parity, 1 stop bit.
- Type some text in the terminal window.
- Check the echo. Each character you type should appear on the screen, because the ESP32 S3 Uno sends it back over RS422.
- Tip: If you see nothing, swap the A/B and Y/Z pairs on one side first. Mixed-up pairs are the most common RS422 mistake.
Video Tutorial
Watch the video below to see this ESP32 S3 Uno project step by step.
FAQ
Can the ESP32 S3 Uno use SoftwareSerial for RS422?
No. The SoftwareSerial library is made for AVR and some other boards, not for the ESP32 S3 Uno. You do not need it, because the board has extra hardware UARTs. Use Serial2.begin(9600, SERIAL_8N1, RX, TX) and pick the RX and TX pins you want.
Is the TTL to RS422 module safe with the 3.3V ESP32 S3 Uno?
Yes, if you take care of the voltage. ESP32 S3 Uno pins are not 5V tolerant. If the module runs on 5V, its TXD output is 5V. Power the module from 3.3V, or add a 5V to 3.3V level converter on the TXD line.
Why not use D0 and D1 for RS422 on the ESP32 S3 Uno?
You can, but D0 (GPIO44) and D1 (GPIO43) are the UART0 pins that also handle USB serial, uploading and boot messages. The RS422 module can block an upload, and the RS422 device may get boot text at power-up. Serial2 on D6 and D7 avoids these problems.
How far can RS422 send data with the ESP32 S3 Uno?
RS422 can reach about 1200 meters (4000 feet) at low baud rates like 9600. Higher baud rates mean shorter distances. Use twisted-pair cable for each A/B and Y/Z pair to get the best range.
What is the difference between RS422 and RS485?
RS422 uses two separate pairs, one to send and one to receive, so data can flow both ways at the same time (full duplex). It usually links one sender to up to 10 receivers. RS485 often uses a single pair shared by many devices, so it needs direction control in code.
What if my project needs more pins than the Uno headers give?
The ESP32 S3 Uno has two extra rows of holes with more GPIOs: GPIO15 and GPIO16 (I/O, PWM, analog), GPIO45 and GPIO35 to GPIO42 (I/O, PWM), and GPIO47/GPIO48 (output only, PWM). Solder pin headers to use them, and write the GPIO number in code. For an extra UART, GPIO35 to GPIO42 or GPIO15/GPIO16 are good choices; do not use GPIO47/GPIO48 for an RX pin, because they are output only. Two warnings: (1) GPIO47/GPIO48 may run at 1.8V instead of 3.3V on some modules (especially ones with "V" in the name, like R8V or R16V), so 3.3V devices can be damaged or act strangely; (2) GPIO0, GPIO3 (D6), GPIO45 and GPIO46 (D9) are boot strapping pins, and a wrong connection can stop the board from booting or uploading code. Use the other extra pins first.
Troubleshooting
| Problem | Possible Cause | Solution |
|---|---|---|
| No COM port in Arduino IDE | USB driver missing or board not in upload mode | Install the CP210x or CH340 driver, or hold BOOT while you press RESET |
| Upload fails with the Option 1 wiring | The module is connected to D0 and D1, which are also the upload pins | Unplug the TXD and RXD wires during upload, or use the Serial2 wiring on D6 and D7 |
| Board does not boot with the Option 2 wiring | The module pulls D6 (GPIO3), a boot strapping pin, at startup | Unplug the TXD wire from D6, reset the board, then plug it back in |
| Nothing comes back in the terminal | TX and RX pairs are crossed wrong, or TXD and RXD are swapped | Connect Y/Z to the other device's A/B, and module RXD to the board TX pin |
| Strange characters in the terminal | Baud rate or data format does not match | Set the terminal to 9600 baud, 8N1, same as the code |
| Data works only on short cables | Cable is not twisted pair or the line is too long for the baud rate | Use twisted-pair cable and lower the baud rate |
| Board gets hot or resets randomly | 5V signal from the module TXD goes into a 3.3V pin | Power the module from 3.3V or add a level converter on TXD |
| Module LED is off | No power or loose GND wire | Check the VCC and GND wires and the power source |