Connect spliced USB cable directly to Arduino

Is it possible to splice a USB cable to isolate the 4 wires (5V, GND, D+, D-) and connect those directly into the 5V, GND, RX, and TX of an Arduino board to send and receive serial data from another device?

I want to have the Arduino's primary USB-B connected to my computer to print serial messages, and another device to connect to the Arduino as well so it can receive messages from that other device. The other device has a micro-USB port on it, can I connect a male-usb cable to that port and splice the other end to directly connect into the Arduino? If this is not possible could someone explain why, and what is the proper way to transmit serial from another device's micro-usb port?

I am using an Arduino Mega 2560 with 4 sets of RX/TX pins. The other device is an FPGA that I want to receive serial data from.

So receive it. Leave USB out of the picture. A simple answer to your question is impossible. That is to say it wouldn't be. Simple.

D+ and D- are nothing at all like TX and RX.

USB is meant to jack into a USB port, like on you desktop machine, where whatever is being sent or receiving is handled at a low level by driver code. So it look like regular serial in the higher level code.

Despite the fact that this is routinely used to accomplish serial communication, connecting two Arduino boards would usually be done just with serial protocol, specifically TTL serial where all you gotta do (assuming the Vcc is the same on both) is connect TX on one to RX and the other and so forth.

The MEGA has, as you point out, real hardware serial ports aching to be used.

Wire them up, then the fun begins.

Just in case you'd get anything from it, see

HTH

a7

1 Like

The FPGA is already set up to output data through the USB when it starts up, I want to be able to capture that data on the Arduino's serial port which is why I need to connect to the device's USB. I understand now that the D+/D- differential wires do not work with Rx/Tx (I'm a software guy, not hardware so please forgive my ignorance there). If I still want to be able to read in the USB data, can I wire a USB breakout like this one to the Arduino and then use a microUSB->microUSB between the devices and still read the data in through Serial.read()?

I'm assuming the hookup for the BOB to Arduino would be like this, please correct me if I'm wrong:
(BOB) VCC --> (Ard) 5v
(BOB) GND --> (Ard) GND
(BOB) Rx --> (Ard) Tx1
(BOB) Tx --> (Ard) Rx1

Yes, that should work fine. I use these

which I believe is 100 percent the same thing.

If you happen to have a spare Arduino board of the right kind, you can hijack the USB <-> TTL serial part of it, see

You can play with test any of these devices just using your desktop machine and a terminal emulator like PuTTY or CoolTerm - just jump Tx to RX and see your data go out and right back.

a7

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.