# Advise/Guidance for Remote 8ch I/O via UART

**URL:** <https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598>\
**Category:** General Guidance\
**Created:** [June 25, 2023, 7:54pm UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598 "2023-06-25T19:54:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ct2jut](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ct2jut/32/972416_2.png) [@ct2jut](https://forum.arduino.cc/u/ct2jut)\
**Post date:** [June 25, 2023, 7:54pm UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/1 "2023-06-25T19:54:10Z")

</div>

Hi!

I´m a new Arduino user and I like to learn.  
I got an Uno Rev.3 which I have already made some small sketchs.  
Now I need to run a remote (about 50 feet away) wired I/O unit with at least 8DI and 8DO.  
I´d like to stay with something simple.  
Is RS232 enough, do I have to go for RS485?  
Which friendly (programable for newbie) boards out there?

This is my first post, thanks in advance for helping!

Miguel

---

<div class="post-metadata">

**Author:** ![anon56112670](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@anon56112670](https://forum.arduino.cc/u/anon56112670)\
**Post date:** [June 25, 2023, 7:54pm UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/2 "2023-06-25T19:54:57Z")

</div>

It really depends on the environment

---

<div class="post-metadata">

**Author:** ![ct2jut](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ct2jut/32/972416_2.png) [@ct2jut](https://forum.arduino.cc/u/ct2jut)\
**Post date:** [June 25, 2023, 7:57pm UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/3 "2023-06-25T19:57:47Z")

</div>

The purpose is to read inputs from inductive sensors and drive signals to the Uno from the building´s roof on an antenna switch and rotator.

Thanks for the reply!

---

<div class="post-metadata">

**Author:** ![kolaha](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kolaha/32/966427_2.png) [@kolaha](https://forum.arduino.cc/u/kolaha)\
**Post date:** [June 25, 2023, 8:00pm UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/4 "2023-06-25T20:00:30Z")

</div>

you need additional MCU which will observe remote IOs and convert data to serial stream.  
and output the data received from main MCU.

---

<div class="post-metadata">

**Author:** ![ct2jut](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ct2jut/32/972416_2.png) [@ct2jut](https://forum.arduino.cc/u/ct2jut)\
**Post date:** [June 25, 2023, 8:09pm UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/5 "2023-06-25T20:09:24Z")

</div>

I was thinking about the CDP6402 IC - CMOS Universal Asynchronous  
Receiver/Transmitter (UART)

> **[30774.pdf](https://www.farnell.com/datasheets/30774.pdf)**
>
> 68.64 KB

Does it suit and is simple to program?

---

<div class="post-metadata">

**Author:** ![Railroader](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/railroader/32/274550_2.png) [@Railroader](https://forum.arduino.cc/u/Railroader)\
**Post date:** [June 25, 2023, 8:09pm UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/6 "2023-06-25T20:09:40Z")

</div>

> [@ct2jut](#):
>
> Is RS232 enough

If I remember... RS232 is specified for 10 meters, 30 feet but works for significantly larger distances when using a moderate baud rate and well selected cables. Of corse stay away from sparking welders, high power radio transmitters and similar stuff.

---

<div class="post-metadata">

**Author:** ![westfw](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/westfw/32/213443_2.png) [@westfw](https://forum.arduino.cc/u/westfw)\
**Post date:** [June 26, 2023, 6:04am UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/7 "2023-06-26T06:04:16Z")

</div>

> [@Railroader](#):
>
> RS232 is specified for 10 meters

Um. 15m. (50ft!) (Actually, the spec if for maximum cable capacitance.) [RS-232 - Wikipedia](https://en.wikipedia.org/wiki/RS-232)  
Much longer distances usually work fine in practice.  
The next higher speed choice is probably rs422, which is more-or-less backward compatible.

Protocol-wise, you could do a lot worse than to duplicate i2c port expanders.

---

<div class="post-metadata">

**Author:** ![paulpaulson](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulpaulson/32/363643_2.png) [@paulpaulson](https://forum.arduino.cc/u/paulpaulson)\
**Post date:** [June 26, 2023, 6:15am UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/8 "2023-06-26T06:15:22Z")

</div>

Or a BT connection if there is a line of sight.

---

<div class="post-metadata">

**Author:** ![Grumpy\_Mike](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/grumpy_mike/32/213521_2.png) [@Grumpy\_Mike](https://forum.arduino.cc/u/Grumpy_Mike)\
**Post date:** [June 26, 2023, 6:16am UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/9 "2023-06-26T06:16:34Z")

</div>

> [@ct2jut](#):
>
> I´d like to stay with something simple.

What you want to do is not simple,.

Once you put something at the end of a serial port you need a processor at the other end.

RS232 will not cut it, you need a differential signal like those you get with RS485.

Alternatively you could use differential buffers to send and receive individual signals but that takes up two wires per signal.

You will not find anything ready made, unless perhaps you try using radio to make the connection instead of wires.

---

<div class="post-metadata">

**Author:** ![ct2jut](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ct2jut/32/972416_2.png) [@ct2jut](https://forum.arduino.cc/u/ct2jut)\
**Post date:** [June 26, 2023, 8:13am UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/10 "2023-06-26T08:13:42Z")

</div>

Thanks for the input Mike!

What would you do if you were me (still with poor programming skills)?

It has to be a wired line. I had a lot a faith on the CDP6402 IC...

So this leaves me with a RS485 protocol, which I understand it's pretty good for my needs although I never worked with it. I've been reading about the RS485 and Modbus RTU on Arduino, but I'm a bit in the dark...

Any help or thoughts are much appreciated.

---

<div class="post-metadata">

**Author:** ![westfw](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/westfw/32/213443_2.png) [@westfw](https://forum.arduino.cc/u/westfw)\
**Post date:** [June 26, 2023, 8:32am UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/11 "2023-06-26T08:32:48Z")

</div>

> [@Grumpy\_Mike](#):
>
> RS232 will not cut it

I disagree. Depending on speed, I guess. It used to be common to run rs232 at 9600bps all over office buildings through standard telco wiring, far further than 50 feet.

> Once you put something at the end of a serial port you need a processor at the other end.

> I had a lot a faith on the CDP6402 IC

The 6402 is ancient. (I used two in my first work project after college, converting a 6bit 75bps newswire feed to 8bit rs232. That was 1981.) it needs a separate clock generator. It might work simply enough for outputs, but you'd need some way to trigger it to transmit the value of your inputs, which rapidly escalates into "more complicated and more expensive than another AVR."

---

<div class="post-metadata">

**Author:** ![Grumpy\_Mike](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/grumpy_mike/32/213521_2.png) [@Grumpy\_Mike](https://forum.arduino.cc/u/Grumpy_Mike)\
**Post date:** [June 26, 2023, 9:02am UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/12 "2023-06-26T09:02:27Z")

</div>

> [@ct2jut](#):
>
> So this leaves me with a RS485 protocol, which I understand it's pretty good for my needs although I never worked with it.

This is normally implemented over a twisted wire pair as a half duplex system. That means it can only work in one direction at any one time. This means you need some sort of protocol to stop both ends trying to transmit at the same time.

This normally involves a master / slave protocol where the master end sends a fixed number of bytes and the slave end returns a fixed number of bytes in reply. You are free to make up this protocol as you see fit. But maybe it is too much software for you?

---

<div class="post-metadata">

**Author:** ![kolaha](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kolaha/32/966427_2.png) [@kolaha](https://forum.arduino.cc/u/kolaha)\
**Post date:** [June 26, 2023, 9:28am UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/13 "2023-06-26T09:28:49Z")

</div>

> [@Grumpy\_Mike](#):
>
> master / slave protocol where the master end sends a fixed number of bytes and the slave end returns a fixed number of bytes in reply

Modbus

---

<div class="post-metadata">

**Author:** ![Railroader](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/railroader/32/274550_2.png) [@Railroader](https://forum.arduino.cc/u/Railroader)\
**Post date:** [June 26, 2023, 9:52am UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/14 "2023-06-26T09:52:39Z")

</div>

40 years ago 15 therminals were connected to the Nova computer via RS232. The distances were way greater then the spec. We used 9600 baud. The cables were selected, likely shielded. What did they cost? I've no idea.  
Maybe RS485 is preferable now days.

---

<div class="post-metadata">

**Author:** ![herbschwarz](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/herbschwarz/32/239314_2.png) [@herbschwarz](https://forum.arduino.cc/u/herbschwarz)\
**Post date:** [June 26, 2023, 11:14am UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/15 "2023-06-26T11:14:24Z")

</div>

But, those computers & terminals used true RS232 protocol and +/- 12 volts not the 0 to 5 volts of the Arduino.

---

<div class="post-metadata">

**Author:** ![Railroader](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/railroader/32/274550_2.png) [@Railroader](https://forum.arduino.cc/u/Railroader)\
**Post date:** [June 26, 2023, 12:15pm UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/16 "2023-06-26T12:15:18Z")

</div>

There is no "RS232 protocol". It's an electric level specification. I don't remember if they even used the parity bit.  
That's correct, +- 12 volt. 0 and 5 volt level has been named "TTL".  
There are circuits shifting between RS232 and TTL.  
The OP talked about RS232 and that is relevant. Running TTL levels for such distances is hopeless.

---

<div class="post-metadata">

**Author:** ![westfw](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/westfw/32/213443_2.png) [@westfw](https://forum.arduino.cc/u/westfw)\
**Post date:** [June 26, 2023, 1:37pm UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/17 "2023-06-26T13:37:40Z")

</div>

Probably you want rs423.

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/7/d/1/7d1f2ecc864226e5bbb548e56abf03247e685c76.png)

---

<div class="post-metadata">

**Author:** ![Paul\_KD7HB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paul_kd7hb/32/1127958_2.png) [@Paul\_KD7HB](https://forum.arduino.cc/u/Paul_KD7HB)\
**Post date:** [June 26, 2023, 8:41pm UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/18 "2023-06-26T20:41:15Z")

</div>

> [@Railroader](#):
>
> 40 years ago 15 therminals were connected to the Nova computer via RS232.

40 years ago we were using 20ma current loop with DG Nova, etc. 9600 Baud.

---

<div class="post-metadata">

**Author:** ![Railroader](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/railroader/32/274550_2.png) [@Railroader](https://forum.arduino.cc/u/Railroader)\
**Post date:** [June 26, 2023, 8:53pm UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/19 "2023-06-26T20:53:58Z")

</div>

Current loop is a well known standard but with therminals, I haven't met it.

---

<div class="post-metadata">

**Author:** ![Railroader](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/railroader/32/274550_2.png) [@Railroader](https://forum.arduino.cc/u/Railroader)\
**Post date:** [June 26, 2023, 8:56pm UTC](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598/20 "2023-06-26T20:56:54Z")

</div>

Interesting and clarifying picture.

[Next page](https://forum.arduino.cc/t/advise-guidance-for-remote-8ch-i-o-via-uart/1141598.md?page=2)
