Arduino Nano 33 IoT - RS232
In this guide, we will learn how to use RS232 communication with the Arduino Nano 33 IoT. Specifically, we will learn:
- How to connect the Arduino Nano 33 IoT board to the TTL to RS232 device
- How to write a program for the Arduino Nano 33 IoT board to get data from the TTL to RS232 device
- How to write a program for the Arduino Nano 33 IoT board to send data to the TTL to RS232 device

Hardware Preparation
Or you can buy the following sensor kits:
1 | × | DIYables Sensor Kit (30 sensors/displays) | |
1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of TTL to RS232 Module
When you use serial communication functions like Serial.print(), Serial.read(), or Serial.write() on the Arduino Nano 33 IoT, the board sends data from the TX pin and receives data on the RX pin. The signals on these pins are at TTL level, which means they are only good for short distances. So, if you want to use serial communication over a long distance, you need to change the TTL signal into an RS232, RS485, or RS422 signal.
This module changes a TTL signal into an RS232 signal, and it can also change an RS232 signal back into a TTL signal.
Pinout
The RS232 to TTL module has two ports:
- The TTL interface (connected to the Arduino Nano 33 IoT) has 4 pins:
- VCC pin: This is the power pin. Connect it to VCC (5V/3.3V).
- GND pin: This is the ground pin. Connect it to GND (0V).
- RXD pin: This is a data pin. Connect it to the RX pin on the Arduino Nano 33 IoT.
- TXD pin: This is a data pin. Connect it to the TX pin on the Arduino Nano 33 IoT.
- The RS232 interface uses a DB9 female D-Sub connector. Connect this to your serial device.

Wiring Diagram

This image is created using Fritzing. Click to enlarge image
How To Program Arduino Nano 33 IoT to use the RS232 module
- Set up the pins for serial communication:
- Sets up the serial connection:
- To read data from RS232, you can use these functions:
- Serial.read() – Reads one byte.
- Serial.readBytes() – Reads multiple bytes.
- Serial.readBytesUntil() – Reads bytes until it finds a specific character.
- Serial.readString() – Reads text data.
- Serial.readStringUntil() – Reads text data until it finds a specific character.
- To write data to RS232, you can use these functions:
- Serial.print() – Sends data without a new line.
- Serial.println() – Sends data and then adds a new line.
- Serial.write() – Sends data in byte format.
- For more functions and details on using RS232, see the Serial reference at https://arduinogetstarted.com/reference/arduino-33-iot-serial.
Arduino Nano 33 IoT Code for RS232
Testing
You can run a simple test by sending data back and forth between your computer and the Arduino Nano 33 IoT using RS232. Follow these steps:
- Plug the Arduino Nano 33 IoT into your computer with an RS232-to-USB cable as shown in the picture below.

- Install a Serial Terminal Program like Tera Term or PuTTY. Open the program and set the serial settings (for example, COM port and speed). Type some information into the Serial Terminal to send it to the Arduino Nano 33 IoT. If everything works, you will see the same information come back on the Serial Terminal.