Thursday, September 20, 2018

Long Distance Serial with RS-422

PC's used to have RS-232 ports to connect things like mice, modems, printers, etc. Then technology moved on to USB. RS-232 had a maximum distance of 50', and USB is 9' (USB 3.0) to 16' (USB 2.0). If you really need to send data a long distance, RS-422 might be the trick. It uses two pair of wires, and CAT 5 is just fine. You communicate up to 4900'. Arduino's and other microcontrollers use TTL logic (3v to 5v for a HIGH, 0v for a low), and need a converter to work with other signals. We are using a inexpensive TTL to RS-422 converter called a YL-128. This module uses a Maxim 490 chip.

By connecting a Arduino to a YL-128 on each end of the wire, you can communicate as if the two Arduino's were side by side and connected directly.

Connect one Arduino RX1 to the YL-128 RXD pin (RO), and the Arduino TX1 to the YL-128 TXD pin (DI). Connect a second Arduino and YL-128 on the other end of the cable in the same manner.

Connect the two YL-128 modules Y-A, Z-B, A-Y. and B-Z.



You can then load a serial test sketch like the one at https://www.hackster.io/harshmangukiya/serial-communication-between-two-arduino-boards-d423e9
Related Posts Plugin for WordPress, Blogger...