May I connect an USB device directly to serial pins of Arduino Uno?

I need to send chars to a little device (namely a cheap OBD-II scanner). The device accepts chars from the PC via an USB cable and it works quite well using a simple char terminal program. Now I want to use Arduino to send the same commands to the device.

My idea is to connect Arduino TX and RX pins (i.e. pins 1 and 0) directly to the input USB-pins of the device (as well as +5v and Ground). I can do that without any risk of damaging something?

In this way I could save a lot of space and eliminate that dangling cables .

Ok, maybe my question is ridicoluos, but I didn't find a clear answer until today... maybe the use of a FTDI breakout is always obligatory?
:blush:

connect Arduino TX and RX pins (i.e. pins 1 and 0) directly to the input USB-pins

No way you can do this.

maybe the use of a FTDI breakout is always obligatory?

Or something similar, but I think there will be a problem because both your scanner and the Arudino are devices. You would need one of the Arduinos that can be a master (or whatever it's called in USB parlance).


Rob

Thanks Graynomad for your reply.
You're right, a FTDI breakout board is useless for me. It just configure arduino as a "slave" USB device for a PC... =(

So to make Arduino talking to another USB device I need something like the "USB Host Shield" from Sparkfun (https://www.sparkfun.com/products/9947), I'm right? Damn... it'a quite expensive board..

I'm convinced that should be a simpler solution somewhere, even if I cannot imagine what kind of solution it can be :blush:

USB has a bus, a host controller and slaves. Your laptop is a Host controller but most other things are slaves (including the arduino. It will never use the built in usb port as a controller. USB slave devices have no way of communicating with each other.

I think some of the newer Arduinos can be hosts, for example the Due maybe. Checkout the product pages on the Arduino site.


Rob

Graynomad:
I think some of the newer Arduinos can be hosts, for example the Due maybe. Checkout the product pages on the Arduino site.


Rob

It would make sense. It seems such an oversight that it wasn't there from day 1.

Graynomad:
I think some of the newer Arduinos can be hosts, for example the Due maybe. Checkout the product pages on the Arduino site

Hi,

I checked does offer USB host function. Drawbacks are:

There some "custom" libraries somewhere in internet but... they are developed for specific tasks. In other words, I would not exchange an hardware problem with a software nightmare and loose a lot of time for nothing. :~

Just for the sake of curiosity.
I've just discovered that the USB connector of my dongle is connected to some pins of a PL 2303HX chip. By googling I've discovered that the chip is largely used in a lot of USB devices. It's marked as a "USB to Serial Bridge Controller" produced by Prolific and seems an USB to Serial TTL adapter.

I've downloaded the datasheet from adafruit (here: https://www.adafruit.com/datasheets/PL2303HX.pdf ) and I was intrigued by pins 1 and 5 (TXD and RXD) at page 11.
But... but... but... the "Functional Block Diagram" at page 9 denotes that even this chip needs an USB input from an USB host... :frowning:

So it will not work if I send it Arduino TX/RX signal directly to pin RXD/TXD of the chip? Or maybe it will work?
Somebody with more technical background can confirm me this?

I'm not familiar with that chip but I'd say it's the same as the FTDI offerings, in other words it's a USB slave with a serial port, it's not a master.

Reading data sheet...

OK, note Figure 2-1 Block Diagram of PL-2303HX, the arrow at the top is labelled "USB Host". End of story I would say.


Rob

Graynomad:
I'm not familiar with that chip but I'd say it's the same as the FTDI offerings, in other words it's a USB slave with a serial port, it's not a master.
Reading data sheet...
OK, note Figure 2-1 Block Diagram of PL-2303HX, the arrow at the top is labelled "USB Host". End of story I would say.


Rob

It also makes it clear in the text. So fair enough, it wasn't an oversight. I suppose we should be grateful it even has a USB interface. Messing around with RS232 is a PIA with modern computers.

Graynomad:
OK, note Figure 2-1 Block Diagram of PL-2303HX, the arrow at the top is labelled "USB Host". End of story I would say.

I agree... amen =(

Life is strange, I have to spend a 25 dollars (for a shield) to connect a 5 dollars device... :frowning:

Life is strange, I have to spend a 25 dollars (for a shield) to connect a 5 dollars device…

Not only that. There’s more. You also get to write a device driver.

PaulS:

Life is strange, I have to spend a 25 dollars (for a shield) to connect a 5 dollars device...

Not only that. There's more. You also get to write a device driver.

Do you think that the USBhost library (under development) is completely useless in my case? :frowning:

Do you think that the USBhost library (under development) is completely useless in my case?

No. It will provide the framework for your application. But, you'll still need to understand the USB protocol, and will need to know exactly what the device expects as input and provides as output, under what circumstances, and when.

It's generally easier to get a non-USB version of the device you want to talk to.

PaulS:
It’s generally easier to get a non-USB version of the device you want to talk to.

No way, I’m dealing with an OBD-II scanner, just a chinese clone of ELM327 OBD interpreter. It is sold only with USB or Bluetooth connector, I love it 'cause it’s really small and save me a lot of space in my project.

Here a photo:

It’s really compact and it works well (when its connected to a PC via USB). On the right side you can see the usb connector unplugged and, in the upper-right corner, the USB-to-serial chip.

A friend of mine has bought a similar one, but with the bluetooth interface. It has desoldered the interface and connected it directly to arduino by soldering two special pins to Arduino TX/RX (!) and… it works! :astonished:
Unfortunately the board is similar to the one I bought but is not exactly the same and I cannot figure out what are the right TX/RX pins. For sure, there is no usb-to-serial bridge on my friend’s board.

His board will have a BT interface chip, yours presumably has one of these serial/USB bridge chips. Can't you identify it and hack away?

Are there any chips on the other side of the board?

EDIT:

, in the upper-right corner, the USB-to-serial chip.

Sorry, didn't read you post properly.

Is that the 2303HX chip? If so you know the pinout and should be able to hack into the pins required.


Rob

Graynomad:
Sorry, didn't read you post properly.

Is that the 2303HX chip? If so you know the pinout and should be able to hack into the pins required.

Hi Rob, thanks for your support and help.
The chip is the common 2303HX connected to the super-common PIC18F2480. The PIC chip receives inputs by using one of his 3 serial ports (working at max 3,3 Volts).
Yesterday was my lucky day 'cause I discovered a guy hacking the same PIC chips (mounted on a similar dongle) for the same purposes as me. Here the link: OBD-II Arduino Car Information Display | Koncha Tech.

He states that the PIC receives signal over pins 17 and 18 (don't ask me how he knows that) and found a place where he can solder two wires going to Arduino.
Now my problem: how I can pick signal from pins 17, 18 on my little board? It's quite hard to follow where that pins are going in the board... At the same time it's quite difficult to solder wires directly on the chip (it's so small!).

I have only a multimeter, somebody knows a trick to discover what contacts on the board are connected to a specific pin of a chip? I don't want to damage the chip with some extra current...

p.s: there are two contacts very similar to the ones indicated by the guy in his article. Are not visible in my photo because they are located very close to the usb connector, just in the opposite side of the one visible in the photo.

He states that the PIC receives signal over pins 17 and 18 (don't ask me how he knows that)

If he knew which chip it was that narrows it down to just a few pins, then go looking for the appropriate signals with a scope.

But if it's not the same dongle yours may use a different serial port. Without a scope it will be harder to find out which pins are in use, you might get away with using a DVM and looking for pins that go from a steady 3v3 to an unsteady 1-2v sort of thing. It sounds like you only have 6 pins to test.

I have tested for continuity many times on a loaded board without causing damage, but YMMV.


Rob

I have made a bunch of circuits using the elm327 boards,even modified them for single wire gmlan, and I've connected them to an arduino with all of them.. Don't think I've seen one of your boards though. The knockoff Bluetooth modules are so cheap I couldn't design and build a CAN interface board for the money I'm getting these for.. If you know the pinout of the USB chip, try ohming out the tx and rx to that unpopulated pin header at the top.. Should find those 2 plus a 5v supply and a ground..