0
\$\begingroup\$

Currently I am working on a project that requires connection of the Arduino and IP Camera over single Ethernet cable to a laptop and additionally supply power to a robot.

The goal is to stream Video from camera and communicate with Arduino board.

  • 4 wires from Ethernet cable are required for the camera.
  • 2 wires are needed for power supply.
  • That leaves me with 2 spare wires for USB connection Rx/Tx but no wires left for USB ground.

My question is: Do I need to run a separate GND wire for USB connection? Or will the GND be shared over RJ45 IP camera connector? And is it safe to operate?

I am not sure how camera data transmission works, but it's logical for me to assume that camera and laptop share GND.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
0
\$\begingroup\$

You really should not be trying to use USB over non-trivial distance or with alternate wiring - but fortunately you do not need to for an Arduino project. Switch to RS232 instead - that is what the original Arduino had, today you would need an add-on level shifter - and then use a USB serial adapter (ie, with a DE9 connector) at the computer.

Ethernet does not provide a ground; but if you are supplying DC power, you would be providing a ground there. RS232 voltage levels should give you some noise margin.

For an even better solution, use RS485 differential signaling with transceivers and a software protocol which permits both to device and from device data to share the same differential pair.

Another option would be to put more of a "computer" at the robot end, which would multiplex the Arduino data over Ethernet; the downside is that many such solutions end up having delicate file system state which is hard to maintain reliably if your robot can unexpectedly lose power. Power consumption will also likely increase. But something like an MT7688 board that brings out two distinct Ethernet ports (one for the IP camera, one for backhaul) could be an option. Or a single Ethernet, and use a USB or dedicated camera on the embedded computer, rather than a complete IP camera.

\$\endgroup\$
  • \$\begingroup\$ Yeah I concur with Chris that switching to RS232 levels for your Arduino serial port would be better than USB. My experience is that 12Mbit (full-speed) will probably work, but may give you trouble, and 480Mbit (high-speed) likely will not work on wiring like this. \$\endgroup\$ – Jeff McBride Apr 24 at 17:29
0
\$\begingroup\$

A USB cable already contains a ground, so there could be a potential for a ground loop which can create noise. If that is a problem, then you may want to consider isolating the 12V.

USB should not be run over cables that do not have the proper tranmission line impedance. USB cables should have an impedance of 90Ω and twisted pair. Otherwise the error rate could go up significantly. USB should be ran in it's own shielded cable and not with other signals that could introduce crosstalk.

\$\endgroup\$
0
\$\begingroup\$

You do not need a separate ground for the arduino and the IP camera. You can share the single ground wire.

From a signal integrity standpoint, your setup may be suspect and could have USB data errors. But I suspect that if your length is not too long, and you are using 12Mbit USB (as opposed to high-speed 480Mbit), it will probably work. Be sure to use the twisted pairs in your cable appropriately: use one pair for the power/ground, and another pair for the USB Dp/Dn*.

*Just as a point of clarification, the USB lines are not transmit and receive as you describe, but are a differential pair (+/-) that is used for bi-directional communication.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.