Skip to Content

RS-232 with Arduino and ESP32 based PLCs

Configure RS-232 serial communication with ESP32, M-Duino, and Ardbox PLCs — switch settings, wiring, and Arduino code
June 19, 2026 by
RS-232 with Arduino and ESP32 based PLCs
Boot & Work Corp. S.L, Martí Schnabel

Introduction

RS-232 is a widely used communication protocol for serial data exchange between devices, offering simplicity and reliability in industrial applications. Industrial Shields PLC families, including the ESP32 PLC, M-Duino PLC, and Ardbox PLC, support RS-232 communication, making them versatile tools for automation projects.

This guide walks you through the hardware and software setup required to enable RS-232 communication with these PLCs. From configuring switches to establishing proper connections and writing your first lines of code, this tutorial ensures you can effectively utilize RS-232 in your projects.

Additionally, we provide examples to help you quickly start using RS-232 communication, whether you're sending, receiving, or monitoring data. For further details, explore the technical features of ESP32 PLC Family, M-Duino PLC Family and Ardbox PLC Family.

Hardware

Switch configurations

To use the RS-232 communication, configure the communications switch as follows:

  • For ESP32 PLC Family:
    • Set switch 2 of A zone to OFF
  • For M-Duino PLC Family:
    • No switch configurations needed
  • For Ardbox PLC Family:
    • Select RS on Top zone switch

Connections

The connections between devices are GND with GND, TX with RX and RX with TX.

Software

Install the industrialshields-avr board on the Arduino IDE. You can do it by following this tutorial.

Select your board and model:

  1. For M-Duino PLC Family: Tools > Board > Industrial Shields AVR Boards > M-Duino [Extension] family and Tools > Model > M-Duino [Module]
  2. For Ardbox PLC Family: Tools > Board > Industrial Shields AVR Boards > Ardbox [Extension] family and Tools > Model > Ardbox [Module] HF+ w/HW RS-485
  3. For ESP32 PLC Family: Tools > Board > Industrial Shields ESP32 Boards > ESP32 PLC Family and Tools > Model > ESP32 PLC [Module]

Include the RS232 library in your code and use RS232 to refer to the RS-232 port.

Make sure that the baudrate is the same in the all the devices.

Some basic functions

1. Begin RS232 port:

RS232.begin(BAUDRATE);

2. Send data:

RS232.write(tx);

3. Check if data is available to read and read the data

if (RS232.available()) {
byte rx = RS232.read();
}

Check out the examples on Arduino IDE at Examples > RS-232.

​Search in our Blog

RS-232 with Arduino and ESP32 based PLCs
Boot & Work Corp. S.L, Martí Schnabel June 19, 2026
Share this post
Tags

Looking for your ideal Programmable Logic Controller?

Take a look at this product comparison with other industrial controllers Arduino-based. 

We are comparing inputs, outputs, communications and other features with the ones of the relevant brands.

PLC Comparison