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