I'm implementing a device that will travel into a hole in the ground that is typically tens of metres deep, up to 100m (~330'). I'll need a serial interface between a laptop and the microcontroller to send commands to the microcontroller and to retrieve sensor data from an IMU. I understand that in order to achieve this range, I'll need to use a protocol like RS485 or RS422.
Would either of these protocols suit my needs and is there a benefit of using one over the other? My understanding is that I'll need a separate circuit (like this) to convert the arduino's UART signal to RS485/RS422. Also, I'll need another circuit (like this) at the computer to translate whatever I'm sending over USB to RS485. Is my understanding correct?
Any implementation tips or alternative protocol/hardware suggestions welcome.
RS485/RS422 are not 'protocols' in the strictest sense, they are just electrical level converters.
Do you need simplex or duplex communication?
If simplex (one way at a time one, 3 wires) then the RS485 chip is fine. Need one at each end.
RE: simplex vs. duplex, I intend to implement commands to tell the arduino to start and stop outputting a stream of sensor data. If I were to use RS485, would I be able to 'interrupt' the arduino while it's pushing data to the laptop to tell it to stop outputting?
RE: simplex vs. duplex, I intend to implement commands to tell the arduino to start and stop outputting a stream of sensor data. If I were to use RS485, would I be able to 'interrupt' the arduino while it's pushing data to the laptop to tell it to stop outputting?
If so, how could this be implemented?
Your simplest design would be to use RS422 with two channels. A driver connected to Arduino TX, a Receiver connected to Arduino RX. You would need a minimum of 5 conductors GND, Channel1(A - A,B - B) Channel2 (A - A, B - B). Assign Channel1 as the TX from the PC to the Arduino and Channel2 and the TX from the Arduino to the PC. Put your Terminators on each of the Channels near the Receivers, and treat it like RS232 Duplex. That way you do not have to switch the single channel from RX to TX during each transaction.
With good cable and shielding, 19200 should be able to reach 4000 ft without a problem.
Chuck.
Check out my Kickstarter Project Memory Panes an expansion RAM Shield for Mega2560's. It adds 1MB of RAM for those projects where 8KB is not enough.
chucktodd:
Your simplest design would be to use RS422 with two channels. A driver connected to Arduino TX, a Receiver connected to Arduino RX. You would need a minimum of 5 conductors GND, Channel1(A - A,B - B) Channel2 (A - A, B - B). Assign Channel1 as the TX from the PC to the Arduino and Channel2 and the TX from the Arduino to the PC. Put your Terminators on each of the Channels near the Receivers, and treat it like RS232 Duplex. That way you do not have to switch the single channel from RX to TX during each transaction.
With good cable and shielding, 19200 should be able to reach 4000 ft without a problem.
Chuck.
Check out my Kickstarter Project Memory Panes an expansion RAM Shield for Mega2560's. It adds 1MB of RAM for those projects where 8KB is not enough.
Todd, that was very informative thank you.
re: implementation, I have seen UART-RS422 breakouts that are unfortunately too large for my project. I'm thinking of using two separate half-duplex UART-RS485 circuits attached to the arduino, one for each channel. I'll then connect these via Cat5 cable to a two-channel RS422-USB circuit at my laptop. Would this configuration work in principle?
lilith:
Todd, that was very informative thank you.
re: implementation, I have seen UART-RS422 breakouts that are unfortunately too large for my project. I'm thinking of using two separate half-duplex UART-RS485 circuits attached to the arduino, one for each channel. I'll then connect these via Cat5 cable to a two-channel RS422-USB circuit at my laptop. Would this configuration work in principle?
Yes,
That is what I would recommend. Just hard wire the _T/R for Transmit on one and Receive for the other.
Chuck.
Check out my Kickstarter Project Memory Panes an expansion RAM Shield for Mega2560's. It adds 1MB of RAM for those projects where 8KB is not enough.