Setting up Arduino Mega 2560 and Rasberry Pi

Hi guys. I am currently working on hooking up a mega to a pi so the pi can send data (I was thinking via serial connection) to the arduino. I was wondering if it would be possible just to plug in the Arduino's usb cable into the pi. I haven't seen any tutorial do this but I don't see why this wouldn't work granted that the arduino is serving as slave and the pi as master. Is it possible to do this or is there a better solution? Thanks in advance!!!

Google provides several examples: Examples

Much Faster too...

...

I have already looked up all those links. None of which used the arduino usb ab cable. My question was whether it is possible just to plug in the usb end intro the sub output of the pi. I know how to google :slight_smile:

Yes you can connect Arduino with usb cable to raspberry usb host. Just like any computer. Then you can talk to arduino via serial, just type dmesg on linux console and it should appear on dev/

You do realize that the Mega 2560 is a 5V board while the R-Pi is a 3.3V board? and not very fault tolerant at that..
Though the Mega has a wimpy (seriously Wimpy) 3.3 V regulator it;s controller is a 5v part... @ 5V Vcc.. Only
I'd suggest that you read all you can find first and then ask about that which you don't understand.

Doc

teddyf:
My question was whether it is possible just to plug in the usb end intro the sub output of the pi.

"Sub output"?

You mean the USB port on the pi?

That is precisely what it is for. The Raspberry Pi is a full Linux workstation, there is no question about it, and no confusion regarding voltages.

The software manager will load the Arduino IDE onto it so that you can compile all of your sketches on the Pi and download them to the Mega. Without changing any connections, you can then run whatever other software you need on the Pi to communicate with the Mega as a USB "tty" port such as /dev/ttyUSB0.

Doc: Yes, I know of the difference in voltages between the arduino and pi, but because I am running the mega as slave, voltage shouldn't be a problem (I have run the mega with 3.3v before and it was fine but if need be, I can always plug in the wall power supply).

Paul: Yes, I mean usb, my bad. I thought that's what the pi usb was for but I was wondering why no none ever approached connecting the pi and arduino this way (at least on the first several pages of google). If I am just trying to use serial connection I would think that connecting the two with the usb/ab cable should do the trick.

Paul and mart256: Thanks for answering my question!!!

teddyf:
I was wondering why no none ever approached connecting the pi and Arduino this way (at least on the first several pages of google).

Oh, I know why that is. :astonished: The Pi - possibly excepting the most recent model with as I understand, four times the speed, is jsut too darn slow compared to your (present) average PC or tablet.

teddyf:
If I am just trying to use serial connection I would think that connecting the two with the usb/ab cable should do the trick.

Which serial connection do you mean? For a Pi, you just plug the same USB cable to the Arduino, that you use for your PC. Absolutely no difference - except that the Pi has a limited number of USB ports and you generally need to connect a powered USB hub to it, and your other things to that hub.