Ive been working on an ROV for a while now and Im trying to get a tether working. I am currently using a direct bury Cat 5 cable with 4 pairs of twisted 24 AWG wires, inside the vehicle I soldered a USB - A male end (The one that connects to an Uno, I think its USB A), and the other side has a male USB connector that plugs into my computer. I want to read values from a few sensors connected to my arudino. When I plug everything in I can see the arduino is getting power, the LED turns on, however I cant connect to it.
When I plug everything in I get a pop up on my computer telling me its an unrecognized device and the Serial Port options in Arduino IDE are greyed out. On a smaller cable I can connect to the Uno, I also have a mega that I've tried with no luck. I got this method online and asked some people at work who said this should be fine, really I just want a super long data cable from the Arduino to my computer. Is there some thing about the cable or sending data that far I should know about? I checked all of my solder joints and everything looks good. I'm new to a lot of this and learning as I go. Thanks!
100 ft = 30.5 meters
I'm afraid that you asked the wrong people. It is not fine at all.
You need some kind of communication over the cable, so you need an Arduino board at both ends. If you put 12V and RS-485 in the cable, then 30 meters should be no problem. Use a DC/DC-converter to lower the 12V to 5V or 3.3V.
There are also USB-RS485 modules, so you don't need the Arduino board at the begin.
There are long USB cables. They have electronics in the connector at both ends to translate the USB signals into normal twisted pair signals (the USB is also "twisted pair", but it is limited).
There are also modules (without the cable) that translate the USB to a normal twisted pair signal.
Sometimes a long USB cable has optical fibers.
I think that a concatenation of 5 usb hubs is possible. But the 5V will drop too much, there is also 5V needed at the end and maybe in between for the hubs as well.
It is easier to just use 12V and RS-485.
So here’s my set up currently. The orange canister will be attached to the larger vehicle body once I get this figured out. The most important thing about this Cat 5 cable for me is that it’s gel filled, which means I won’t need to worry as much about compression on the cable while at depth. Thanks for any advice!
Did you wire the twisted pairs so each data wire has it's associated ground return, or did you just randomly assign data and ground? Signal ground and power ground must be kept separate for your system.
So I’ve been reading about RS485 last night and this morning and have a faint idea of what it is and how it differs from I2C, which is what my sensors use.
What I don’t have a clear answer for is how to connect my Arduino Uno to my computer. It sounds like I can use a nano to connect to my Uno via a MAX485 on either side? Could I then write a sketch that just connects the two? What sensor data from my Uno be readable the way it is from my Nano? Sorry, this is a lot of information all at one time that I’m trying to figure out. Thanks!
Your UNO is connected to your computer with the same cable you use to download programs to the UNO. The UNO has ONE serial port that is ALSO the USB connection. ONLY ONE SERIAL PORT AND IT IS IN USE. So if you insist on a UNO, you need to use some type of software serial communications which will use pins other than 0 and 1.
Then you can connect the MAX485 to the software serial pins and some other Arduino on the other end of the RS-485 connection. If a Nano, then you have the same communication problem of having to use a software serial communication connection.
Before you focus on a software serial solution, tell us a bit about how much data you expect to transmit, please. SS works (guardedly) at 9600, but if you're looking to use 115200, stop now.
Ok so I’m basically I’m at a loss here. I’m trying to use a baud rate of 115200, so I’ve stopped for now to do some more research I guess. I’ve got a sketch that runs all my sensors (DHT11, 30Bar pressure sensor, 3 DS18B20 temp, 2 MPU6050, a leak sensor, LEDs, 4 thrusters, and 4 servos, 2 camera via ESP32) on 2 Arduinos. I take all that data and send it to a sketch in Processing IDE where I have control of most sensors from my PS4 controller as well as a well built (IMO) GUI including the cameras live feed. I just need a longer cable. The ROV forums and people I work with (I’ve worked in the ROV industry for awhile, this is my first DIY attempt from scratch) don’t seem to have this issue or at least don’t talk about how they solved it. This thread has confused me more than helped because it seems more complicated than I thought to send data over long distances.
If it matters, something I’ve read alot of is sending data over long distances to the Arduino, my sensors are 6” or closer to the Arduino I’m just trying to figure out that last 100feet from the Arduino to my computer. Thanks again for your help!
USB won't do it. You can buy USB extenders, some of which might be capable of doing the distance you want - but maybe someone else can advise. I've only ever used one 15' extender, that was it, and it wasn't with an Arduino, though that shouldn't matter.
There are Ethernet options, but you'd need to add an ethernet shield to use it. No experience there.
115,200 RS485 should be a cake walk. Describe what it is you want to do in detail (x samples per second, n devices, synchronized or not, multiple RS485 nodes or one) and someone will likely have done something similar.
Sending data over long distances isn't hard, using the right media. USB, or I2C for that matter, isn't the right media.
You really should look more closely at the ROV implementations you've mentioned - they've likely crossed this bridge before, no?
Nice, thank you this was more along the lines of what I was looking for. I’ll post a more detailed description of my project when I get on my computer later. Sorry if my initial questions weren’t clear.
I have one more question that I think will answer a few of my others. Currently my Arduino and sensors communicate via the I2C protocol then the Arduino sends that data to my computer, at least this is how I understand it, if I’m wrong please correct me. So my question is, do my sensors and Arduino need to be communicating via RS485 protocol or is I2C data compiled then converted to RS485 on the Arduino before being sent to the computer? I’m thinking about rewriting my code using python so I can attempt to incorporate processing and Arduino into one code, this may be a good time to switch between using I2C and RS485 if that’s what I need to do. Thanks again for everyone’s help, sorry if I’m not making sense I’ve been doing research all day.
Collecting the data locally via I2C is fine. You just need a different form of communication between the Arduino and your PC due to the distance between them.
Conv 1 converts the TTL level serial signals to RS485 (or RS422); it goes via the long cable to Conv 2 that converts those signals to USB that goes to the PC.
RS422 would have the advantage that it's transparent; you don't need anything special code wise. It however uses a few more wires compared to RS485.
PS
6" is a long distance for I2C. I2C was designed for use for short distances. Just be aware of that if you get problems.
Here's a schematic, I still haven't had time to sit down and look at my code. I have a canister that is water tight with all of the following sensors and motors in it (refer to my schematic). Currently I have two Arduino's, an Uno and a Mega, the Uno is communicating via serial, in my Arduino sketch these values are collected and sent as a string to my processing sketch. The mega is running standard firmata, in my processing sketch I am using the game control plus library to control motors and servos with my PS4 controller, the GCP library only works with Standard Firmata firmware.
All of my servos, thrusters, and ESC's are all powered by their own 15V (voltmeter reads 14.8V) battery. The LED strips have a 12V battery and everything else is powered by the Arduino. In processing I am using the meter library to create several different meters that are updated based on the values being sent from the Uno and Mega, basically every piece of hardware has a meter or graph in processing.
In Arduino my sensors are all offset by 10ms, every 1000ms they send the data to processing followed by another 1000ms delay. My pressure sensor, led indicators, leak sensor, MPU6050, and DHT11 are all within 6" of the Arduino inside the canister. The MPU6050 and pressure sensor are sent to the Uno via a PCA9548A multiplexer and the pressure sensor has a 5V to 3.3V logic converter. The thrusters, servos, and LED strips are all outside the vehicle and connect to the Mega via bulkhead penetrators so their wires are longer, usually a meter. I was once asked why I have so many batteries and the goal is to stay underwater as long as possible, my minimum goal is 8 hours of continuous operation. My schematic also shows how I plan to address this RS485 communication issue but I'm wondering if it will work. I have both Arduinos connected to MAX485 convertor then the 100ft tether, at the end is another MAX485 connected to a Nano and then finally to my computer. the internet makes it sound like doing it this way should work with a couple extra lines of code.
Another comment asked if I purchased this or made it and I have done 100 percent of the work on this project. I've designed and built the vehicle, constructed the hardware, designed and wrote the code, I've spent a lot of time on this project. Being able to code is different than understanding theoretical concepts which I'll admit I don't have, this project was the first time I've ever done real coding or picked up an Arduino and I started in July. I have a lot more to learn.
I also have 2 ESP32 cameras that I really want to get working but that's for another day, I suspect I will run into all sorts of issues trying to send video over 100ft cable. Will this method work? Thanks again!
Just realized in my schematic the 15V is going to the thruster, it acutally connected to the ESC and the ESC sends power to both my servo and thruster, the ESC and servo are both wired to my arduino Mega, for all four sets.
You can combine Nano 1 with Nano 2 and put everything from the Uno in the Mega. Then you have two boards instead of four. I don't mind if you have a Uno for sensors and a Mega for motor things, but at least use a single RS-485 with a single Nano. Or does that conflict with firmata ?
Some have two Arduino boards because they don't know how to write code to do everything in a single Arduino board. In my opinion, that is not a good reason.
You can also combine all the power to a single 15V battery. There are converters that can step-up and step-down from/to any voltage.
What is the "Multiplexer" ? Many devices can be connected to the I2C bus, because the I2C bus uses a separate address for each device. Theoretically there are 127 different addresses, but in real life up to 10 devices is reasonable (margin ±100 ).
The DHT11 can not be on the same bus as the DS18B20.
Did you know that if you buy a MPU-6050 from AliExpress/Temu/Amazon/Ebay that it is a counterfeit ? If might stop working or a channel might become zero at the most worst possible moment.