Choosing the communication between Arduino and PC

Hello!
I'm new in Arduino and I'm a little lost. Please help me! :slight_smile:

I have to design the communications of a robot that a group of students in my university are doing. So, I'm looking about the best way to communicate Arduino with the PC.

The big idea is to communicate using the protocol ROS, using the best technology in therms of

  • Speed
  • Simultaneously send and receive information
  • If it can be, the most economic

I have been looking for solutions with:

  • Serial UART provided with the basic Arduino UNO
  • I2C
  • SPI

but I'm looking also about using

  • Ethernet
  • Ethercat
  • Pararell port
  • USB

but I don't get too much information, and the most important, I don't find which is the best solution to focus in.
Please, tell me if you have some experience in this technologies or others that I don't know.

Thank you

Note: I can't use any RF communication as Bluetooth or Wi-fi as the robot has to be independent of them.

Note: I can't use any RF communication as Bluetooth or Wi-fi as the robot has to be independent of them.

ok, you can try a VERY long USB cable.

Are you able to use IR? That can wirelessly control the robot, but you will need an IR transmitter too from the PC.

The big idea is to communicate using the protocol ROS, using the best technology in therms of

Speed

The volume of data to be sent is usually a factor in determining if speed is an issue. If you are sending one byte per week, does it really matter if it takes 35 uS to get there, versus 40?

Simultaneously send and receive information

This will affect a lot of your choices. While the hardware may support bi-directional communication, the software can't take advantage of it. For instance, serial data can only flow one way at a time. But, data transmission is interrupt driven, so while you are buffering data to send (in software), the hardware can be receiving data. The software can't make use of that, though. In can either be sending OR receiving, but not doing both at the same time.

And, why is that criteria important? Communication happens when one side talks and the other listens. It does not happen when both sides are talking at the same time.

If it can be, the most economic

Volume of data, distances, and many other undisclosed factors determine whether additional hardware is required. If none is, no method costs more than another.

I have been looking for solutions with:

Those are your only choices. Others that you mention are built on top of one of those three.

Thank you for your answers! (it was very fast! :slight_smile: )

ok, you can try a VERY long USB cable.

Are you able to use IR? That can wirelessly control the robot, but you will need an IR transmitter too from the PC.

I forgot to tell that the Robot has attached the computer in his basis, so it's always near it. Distance is not a problem.
I cannot use any wireless connection. We want to present the robot for Robocup (our first time) and rules tell that the robot has to be independent. Only a wi-fi connection can be attached to it, but it has to work also without it.

And, why is that criteria important? Communication happens when one side talks and the other listens. It does not happen when both sides are talking at the same time.

You've got a point in that. I only thought about giving the best communication to the guys who are going to do the programming job, but I think you are right.

I have been looking for solutions with:

Those are your only choices. Others that you mention are built on top of one of those three.

You mean that if I want to install an ethernet module? (for example) it will be attached to I2C or SPI?
In that case, what will be better? To link directly pc to I2C and SPI or use also the new module?
I have read that SPI is fastest than I2C but only for small distances, I don't know if it's refered to very small distances (cm) or normal distances like 1 m (maximun distance between the Arduino and PC)

You mean that if I want to install an ethernet module? (for example) it will be attached to I2C or SPI?
In that case, what will be better?

The one that the module actually uses. Typically, that's SPI.

I have read that SPI is fastest than I2C but only for small distances, I don't know if it's refered to very small distances (cm) or normal distances like 1 m (maximun distance between the Arduino and PC)

I2C was designed for chip-to-chip communication ON THE SAME BOARD. The practical limits to the size of the board determine how far I2C will work at its best.

Obviously the short distances allow for very fast communication. Faster than any process that needs to support longer distances.

mardolin:
Note: I can't use any RF communication as Bluetooth or Wi-fi as the robot has to be independent of them.

You haven't explicitly said whether this is required to be a wireless solution. Do you have detailed requirements (range, speed, reliability, wired/wireless etc)? What does it need to achieve, and what is allowed and disallowed?