Remote logic states via RS232

Hello everyone.
I need to remotely transmit the logic states (0-5 V.dc) of a device from a remote site to the local site and vice versa in real time via RS232. There are at least 128 lines in one direction and 128 in the other, so they will definitely need to be multiplexed, but I hope to be able to take advantage of the high-speed RS232 standard (at least 115,200 baud) to ensure instantaneous changes in each logic state between the two sites.
What should I do?

How remote?

Lines of text or wires? Why can't it all flow on one TX/RX pair (assuming SW flow control).

Baud does not change electrical properties in wire. You will need "ACK"nowledge code on the receive side before the sending side sends another "thing" (which you should define).

Read: RS-232 - Wikipedia

  • How far ?

  • Transmit/receive what ?

And... what time scale are you referring to when you say “real-time” or “instantaneous” changes?

It is UART logic of MCU whose Bd are configurable. RS232 refers to electrical signal levels (HIGH: -3 to -12V, LOW: +3 to +12V) which can travel up to 100 feet at Bd = 9600 without a repeater.

Since the logic state can only be on or off, a single bit can easily do that. Since each byte has eight bits, you can send the status of 8 devices in one byte. You can compute the number of bytes needed for 128 devices. High speed RS-232 is limited to about 50 ft, so you may need to to look at some other standard, perhaps RS-485.

Yes, sorry. Maybe I wasn't precise enough:

How remote?

Remote in the sense that one of the units is local, i.e., on a desk. The other is remote in the sense that it's on the other side of the wall, i.e., in another room, and the wire connecting them obviously doesn't exceed the standard 15 meters in length.

Lines of text or wires?


There are 128 wires, i.e., various circuit points on different boards with rapidly changing elementary logic states (CMOS or TTL) 0 V - 5 V.

  • How far ?

  • No more than 15 meters of cable

  • Transmit/receive what ?

  • Elementary DC logic states that change quickly (some lines are BCD coded) and I need to report (duplicate ... LOL) in the other unit the logic state corresponding to that line and vice versa (so full duplex)

  • Have you considered ESP32 WIFI ?

Does one line show a BCD digit serially, one bit at a time, or are there 4 lines for a BCD digit?

The logic state read on each line should be verified (scanned at least every 2 ms) and reported to the other side as quickly as possible. In short, the faster it is, the better I feel...

No, they are 4 separate lines

No, unfortunately, for reliability and security reasons, everything must be wired. Also, I don't think the card you suggested has 128 I/Os...

Are all 128 lines coming from one device? Are they actually physical wires? Are they GPIO or equivalent? How did you envision scanning them?

  • No, you would need to add IO extender chips.
    RS-485 would be a great way for duplex serial communications, 1200 meters.

Given that throughput requirement (16 bytes every 2 ms), 115200 bps is sufficient. I think COBS would be a good fit for framing here, since it provides deterministic packet boundaries with very low overhead (always exactly two bytes) and avoids delimiter ambiguity. Compared to delimiter-based framing, COBS guarantees unambiguous packet separation without needing escape sequences throughout the payload.

Are all 128 lines coming from a single device?

Yes, they all belong to the same chassis.

Are these actually physical cables?

Yes, they are CMOS and/or TTL logic lines. Nothing virtual.

Are they GPIO pins or equivalent?

They are CMOS and/or TTL logic lines that range from 0 to 5 V DC.

How did you plan to scan them?

By connecting them to ICs that read the logic state every 2 mS and multiplex it to the Arduino (e.g., a cascaded 40105 CMOS or 74HC165).

Do all 128 lines change state synchronously? You could use clocked latched buffers and do it all in parallel. Cable size would be large but not huge.

The RS485 is interesting. For now, the 15 meters of the RS-232 are enough for me, but if they later move the remote unit to a more distant room, we'll see. They could also make two versions of the device, one in RS232 and the other in RS485, but for now I need the RS232 for various reasons I won't go into here...

The 128 lines change state completely randomly