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

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

It really depends on the environment

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!

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

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

Does it suit and is simple to program?

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.

1 Like

Um. 15m. (50ft!) (Actually, the spec if for maximum cable capacitance.) RS-232 - Wikipedia
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.

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

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.

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.

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."

1 Like

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?

Modbus

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.

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

1 Like

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.

Probably you want rs423.

1 Like

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

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

Interesting and clarifying picture.