Arduino with MAX485 module

Hello everyone,

I am building a submarine drone controlled with Arduino through a 40m long USB cable. To be able to send data using a USB cable longer than 10m the signal needs to be converted using a MAX485 module and the reconverted back to normal USB to be fed into the Arduino inside the drone.

The problem I am facing is that after this double conversion the Arduino software does not detect the board.

How can I solve this? Any help will be greately appreciated.

I am using the following components:
Arduino Uno board
2x MAX485 Module RS-485 TTL per RS485 MAX485CSA Converter

Here are the connections:




You're putting D+ and D- on TX and RX on the 'TTL' side - or what ?

The MAX485 takes data via RO/DI to the Arduino and sends it out the the A/B to the other MAX485.

Your A/B end looks like your Vcc/GND wires are not attached (or attached to the A/B terminals) and you have not soldered the header pins.

The IDE does not have a means to work with RS485. If you need normal functionality I would suggest to use RS422.

You need to have a USB to UART converter at the land end.
Connect its TX and RX pins to the appropriate pins on the RS485 TTL converter.

You then send TX and RX via RS485 to the submarine, using the 'A' and 'B' signals.

At the submarine end the RS485 'A' and 'B' signals get converted to TX and RX again.
You then connect the TX and RX to the Uno on pins D0 and D1.

You do not use USB at the Uno end.

I would use USB to RS485 converter on computer side and use RS485-TTL converter only on Arduino side.

Allright thank you for your response.

I bought this USB to UART converter:

Is It good?
How should I connect the 3 available pins (5V, 3V3, GND) of this converter to the RS485 input (It has 2 pins so im guessing its the 5V and GND)?

Why are the RX and TX pins in the USB to UART converted short circuited? Should I leave them like that?

Thank you for your help <3

I would imagine that it is fitted for testing the module, using a so called 'loopback test'.

No, you will have to remove the link so that you can connect TX and RX to the RS485 - TTL converter.
You will also need to connect 5V and GND.

And how you take care of the direction control DE/RE? With RTS?

The thing is.. I have 2 inputs in the rs485 converter. Then its 4 outputs are connected to the 4 inputs (reversed as the module) of the second rs485, thus having 2 outputs to go to D0 and D1 pins of the Arduino.

Consequently, I still have not quite understood how should I connect the USB to UART converter.
You said I have to First remove the short circuited and connect RX and TX to the rs485.
Then connect also the 5V and GND but I only have 2 inputs available in the rs485.
Maybe I should inverse the two rs485 modules? I dont think so tho..

Thank you

Maybe I read your post wrong, but the first MAX485 "A/B" should be connected to the second MAX485 "A/B"... and "DI/DE/RE/RO" of each MAX485 is connected to each Arduino.

That counts two arduinos. I read between lines that the target is to connect submarine arduino to computer. Am I wrong?

I see. But still, A/B talks to A/B... and DI/DE/RE/RO talk to the controller/computer. I read the OP configuration as A/B connected to the controller/computer and DI/DE/RE/RO connected to each other... and that would explain why the pictures have so many flying wires...

1 Like

My guesswork would be that computer connects to wiring with Usb-Rs485 converter, Submarine connects with Rs485-ttl converter (what op has already) to Arduino.
But I might be completely wrong with my guess....

I am wondering whether it would be better to have two separate RS485 connections, (using a total of four MAX485 modules), one to transmit from the land to the submarine, and one to transmit from the submarine back to the land.

I must admit that when I made the suggestion of getting a USB to UART converter in post #5 that I hadn't considered how to control the duplex facility of the RS485 link.

That's why I suggested RS422 in post #4 :wink:

I knew there were similarities and differences between RS485 and RS422, but I wasn't sure exactly what they were. I think I have wrongly being calling both RS485.

Hello everyone,
Thank you all for the discussion

I have followed what John Lincoln said and now Arduino IDE recognizes the board and displays It as connected. The problem still remains tho since when I try to upload a sketch via this connection this error occurs:

avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

I then uploaded the sketch via normal USB and it did It successfully.

The Arduino however doesnt seem to comunicate properly when I reconnect It via rs485 and all the conversions: It does not respond to any input and does not print anything in the Serial Monitor.

Its not a sketch problem cause it worked properly via USB.

Should I try with RS422?

Is USB the only way you can communicate with the Arduino in the drone?
Do you have access to the RX/TX pins or any other pins?

There are three signals plus GND that you need for upload

  • Tx
  • Rx
  • DTR

You can use 3 MAX485 chips (one for each line) or 1.5 MAX422 chips.

It is a sketch problem. RS485 is half-duplex and you need to adjust your sketch [edit]unless you're going to use the above suggestion[/edit]