You can consider adding RS232 optoisolator
General RS232 transmission of about 20 meters
Extension, depending on what measures to take
Please see the Wuhan Hongwei Optoelectronics
E232Y RS-232 passive isolation of the remote transceiver
Features
As much as 95% of the serial port stealing power technology. No external power supply Current loop transmission, support TX, RX, GND three-wire serial port Signal isolation, transparent transmission, baud rate adaptive, no need to change the user agreement Built-in 600W/ms anti-lightning protection and 15KV electrostatic protection Avoid loop voltage, surge, induced lightning, static electricity, hot plugging damage to the device Communication distance Up to 3kmSuitable for computers with standard DB9 serial port
F201 RS-232/RS-485/422 Fiber Optic Converter
Features
RS-232/RS-485/422 converter, full-duplex, half-duplex communication With integrated industrial terminals Unique serial port protection circuitry, can be powered hot-swap Built-in intelligent module, automatic identification of the circuit voltage. p> Built-in intelligent module, automatic identification of RS-485 signal flow, no need for CTS flow control Built-in 600W/ms anti-lightning protection and 15KV anti-static protection Transparent transmission, baud rate adaptive, no need to change the user agreement Communication Distance Multi-mode (-P): 5km Single-mode (-S): 20kmSuitable for standard rs232 level Tx Rx Gnd 3-wire serial communication