Controlling a robot through a USB cable

Is it possible to build a battery powered robot that can be controlled through a USB cable tethered to a PC computer using a custom program? The controls are forward, right, left, reverse plus maybe small camera movements.

The project is actually an underwater robot and I would like to control it through my laptop with a tethered USB cable. I would also need advice on the computer program.

Len Whistler

Thanks for the reply. What other options besides the USB cable are there? Can regular speaker wire be used or a telephone extension wire. I would like a few hundred feet between the robot and computer.

Can this be done?

]computer’s USB port./:m]
]USB to speaker wire (300 feet?)./:m]
]speaker wire to robot’s USB port./:m]

Len

Thanks for all the feedback, I will be checking back to re-read all the info you guys provided. During some Google searching I found this site: homebuiltrovs.com

Len

I would instead leave all the power source and general control system in the sub, and simply use a wire bundle to power low voltage relays in the sub. Using cascading relays with some kind of resistor would give you 2 or 3 power level. Using 2 rotary switches with 4 positions uses 8 wires (live + 3 power levels each). Add an other 8 wires to activate “features” (lights, gripper, buoy release, ect). Regular RS232 wire can be bought cheap and in good lenghts. You might want to check a fan switch from a scrapped car heating controls for power level controler.

Put the relay panel into a sealed box, same thing with the battery. Water will get into your sub the first 5 or 6 trials for sure. Water pressure builds with deepness, trials in a pool wont prove that your machine will be sealed for 10 or 20 meters deep. Getting everything sealed tight will be your biggest challenge.

Using highly absorbent baby diapers might help keep the flow under control :slight_smile:

Silicon sealant will become your friend! Use liberally!

Subs are relatively slow to react, so you dont need very precise speed control. Look at the old sub movies: they got 1/4, 1/2, 3/4 and full power on the BIG things. Your small machine wont need more.

Using a wire bundle will give you more distance to control your machine, and only a small control panel to handle the sub (put it into those aluminum case, looks super professional!). For the camera, using a regular CCTV camera and some TV speaker wire (gotta check the lenght first) should give you visual. It displays on a regular TV, no need for a PC uplink unless you want recorded telemetry, saves money and time. The video signal also records on a regular VCR, and other cheap way to go.

If you dont have a real diver with you, and even if you do, use a real metallic wire to tie your ship to the surface, dont rely on the electric connection for that. cloths line is cheap and resistant enough for that. Use plastic ties to join the safety line and the electric connection bundle, and leave some slack on the electrics, so the real pull will be applyed to the safety only. Pulling on the electric can break wires inside the bundle, lot of fun to troubleshoot!

Do not forget to heat or circulate air on the clear dome tru which the camera looks, cause it will get condensation quite fast. You might also want to put a small ball compass in the camera’s field of view. If you use a sealed and separate module for the camera, try using desiccant (sp?) bags in it to absorb moisture. You can later on dry those small pouch in the oven or direct sun light and reuse them afterward. Some even turn pink when “full” of moisture.

For power source, try to avoid non sealed batteries: they might leak acid if the get upside down, that might ruin your work. Stick to sealed gel-cells. Use weight to lower the center of gravity and to make sure the sub will stay verticaly aligned.

If you really want to use a surface power source (say, very very long underwater duration), send it separately to the sub, tied to the rest of the cable bundle. That way, you dont need to care about the gauge of the wire, big for the motor, small for other functions. Always control your features via relays or such. Use fuses to avoid burning a motor while underwater.

Later, do trials with various propellers. You will be surprised of the results. You will understand why the US Navy pumped so much moneys in into R&D about those!

Better forget about using USB for anything. As a user already pointed out, 16 feets is the max official lenght. Using USB exender is a bit expansive, but if you like it, that’s a solution.

If you need computerized control and feedback, you will need to drop to RS232 or RS485. At 9600 bauds, you can have more than 2000 feets of cable! But you will need a computer down in the sub. Might be a good time to check for PICs and other cheap micro processor. Using relays will payoff at that point, cause those processor can not switch large current. You might also go the motor controller way, PICs also support those.

My final advice is : dont aim too high for start. Stick to the basics, make it work, and have fun with it. Later on, you will be able to improve, add widgets and stuff.

Hello lwhistler, welcome to the RobotShop community.

Yes, it is possible to do what you want. Of course there are many unknowns in your project so I won’t go into detail. Basically, some products, such as those from Phidgets, allow control of motors, feedback from sensors and much more via your computer’s USB port:

robotshop.ca/home/suppliers/Phidgets/index.html

The trick will be to waterproof your robot and find adequately long USB cables. There may be more common ways to approach this but it is doable.

There is more and more interest in submersible ROVs and you can find many projects similar to yours online. One that looks well implemented is the SeaHornet. Their website is very well presented and the project is documented.

If you want to get 300 feet, the use of a “CAT5 Extender” may work. They plug into the USB port and have RJ45 connectors on them. Good idea Seamus. Most devices however suggest a maximum of 150 feet. The weight and flexibility of CAT5 cable will need to be considered. You’ll probably need to add flotation devices and choose flexible cable.

There are many cable options, but choosing one meant for the environment is important if you don’t want to have to replace/repair it often. There is some CAT5 cable meant for outdoor use that is chemically resistent. Not sure how flexible it is though.

Then there is the USB fiber optic extenders. Fiber optics can reach long distances and may be worth a look.

Having recently seen a Discover Channel Daily Planet episode which included news about how fish use sound to find a mate, consider using an underwater microphone to control the robot with simple pulses.

The episode talked about how florida residents living next to the water heard recurring “heartbeat-like” noises coming from somewhere in their houses only to have researchers find the sound came from a “black drum fish” trying to mate. Having dabbled in submersible robots ourselves, remember to always have a failsafe procedure in case communication is lost and always have the robot be positively (at least minimally) buoyant. Expanding foam works well.

One thing to keep in mind is that the USB standard specifies a maximum length of 5 meters (16.4 feet). Beyond this, usability is not guaranteed, and I have experienced some signal degradation on non-repeated cables shorter than that (loss of speed, flaky connection, etc). I would guess that lengths of “a few hundred feet” wouldn’t work for the USB standard, as there are some fairly tight timing requirements during the handshake phase.

For lengths like those that you’ve mentioned, you may wish to look at a communication protocol that uses differential signalling, such as RS-422 or something similar. I know very little about these protocols, so I don’t know if that would get you to where you want to go, but it might give you a starting point.

EDIT: For distances of 300 feet, you would probably want something that uses differential signaling over twisted-pair cable, for some form of protection against interference and crosstalk. Something that can operate over CAT-5 cable might be worth examining, though again, beyond that I’m afraid I’m in the dark. Also, for resistance to moisture and/or salt (don’t know what kind of water you’re looking to drive it through), I would imagine that you’d want a cable that’s rated for outdoor and/or direct-burial type of use.

Ok thanks for all the replies. Something just popped into my head about controlling a robot over 300’ of tethered speaker wired, cheaply. I’m not an electronic technician so my explanation below doesn’t have the proper terms and it might not work anyways.

]Battery (12 volts lots of amps?)/:m]
]Current controller (dimmer switch?)/:m]
]300’ feet speaker wire/:m]
]Diode and low resistance Resistor (turn left)/:m]
]Diode and medium resistance Resistor (turn right)/:m]
]Diode and high resistance Resistor (reverse)/:m]

The battery and dimmer switch are on land and hooked up to the speaker wire, and the diodes are on the robot. The diodes are for this example and would be replaced with some sort of controlling device.

A small amount of current will turn on one diode, more current turns on the second diode and full power turns on the third diode.

Len