I need to send some data from Arduino mega to a Raspberry Pi.
The easiest way would be to use a USB cable and cut off one USB Connector and connecting the wires
to arduino mega rx1 and tx1 and the other USB Connector to the Raspberry Pi USB.
I think this should work... but I'm a little bit unsure because when searching the internet I only found
connections between Arduino rx and tx with Raspberry Pi GPIO Serial, using a level shifter.
Arduino rx, tx are 5V and the USB spec. is also 5V so there should be no problem?!?
I have had a Mega2560 attached to my Raspberry Pi USB as a virtual com port for years using a standard USB cable. Not sure why you think you need to cut cables apart... USB is a standard... RS232 is a standard... but they are truly not related or compatible. I suppose if you want to agree that both send data serially, ok. That's where the comparison stops.
What you want to do... maybe... is use one of the OTHER mega serial port pins and use a 5V/3.3V level shifter to connect that to the raspberry pi's compatible TX and RX pins on the 40 pin connector maybe.
The TTL-232R cables are a family of USB to TTL serial UART converter cables incorporating FTDI‟s
FT232RQ USB to Serial UART interface IC device which handles all the USB signalling and protocols. The
cables provide a fast, simple way to connect devices with a TTL level serial interface to USB.
Or use an FTDI Basic (or equivalent clone) on a Mega port (Serial1, Serial2, or Serial3) and use that to have a USB interface to the RPi if that's what you really want.
$6.90 from here www.tinyosshop.com available with mini-B and micro-B connectors. One of them even ships with USB-A to USB-B cable.
You can see one in this picture, with its jumper for 3.3V or 5V IO
it's nice that we have now different solutions for this problem. I hope this will useful for other people with a
similar problem.
I searched hours on the internet for an affordable solution. The cable costs CHF 39.- including shipment and delivery time is one day. When I order something in US then it costs more or less $70 for shipment and delivery time is more than a week. My deadline is saturday 11.19.16!
The Raspberry Pi is NOT my Project, I must only feed the RPi with the data the arduino collects. I have no clue about programming the RPi.
I think you would be much better off connecting the serial lines from the mega to the Pi with the two serial pins on the GPIO header. All you need is a potential divider of 1K and 510R on the Arduino's TX pin and don't forget to connect up the ground connections.