How to connect USB Series device to Arduino Shield USB Host

I have a Brecknell GP100 postage scale and I want to read the data from the scale using an Arduino UNO + Arduino USB Host Shield (MAX3421E).

If I plug the USB cable directly from the GP100 to my Windows computer, I can open Arduino IDE Tools -> Serial Monitor (set to 2400 baud, 8 bit even parity) and I can see the data coming from the scale. For example, the weight on the scale is 10.3 lbs, then I see this data:

□□□□□□□0000103□□□□□□□0000103□□□□□□□0000103□□□□□□□0000103□□□□□□□0000103....

The is very encouraging to me. It means the scale is sending valid data as ascii characters. So then I unplug the scale from my computer and plug it into the Shield USB Host, which is attached to the UNO. I installed the USB Shield 2.0 library. I ran the sample program acm_terminal after I had changed the baud rate to 2400 on line 34 and I also removed the LCD stuff and just Serial.print() the data received.

But no luck. The acm_terminal does not receive any data from the scale.

I have soldered the shield voltage jumpers (per instructions) and I plugged in a 9V battery power to the UNO. The scale seems to be connecting because it doesn't auto power-off.

I think it is a software problem. Maybe ACM is not the correct protocol? But it is the only protocol I could find in the library that allows setting the baud rate. I also tried the scale example code, but it did not work and it doesn't even have a baud rate setting.

I am running out of ideas. Any suggestions that I can try?


EDIT:

I was able to get this working! When digging into the Windows device driver, I noticed that the chip inside the scale is PL2303 and luckily there is a driver in FELIS to support that chip. With a little tweaking of the baud rate i was able to communicate with the scale.

Here is the source code

1 Like

You shouldn't use a 9v battery for this project. Get a wall charger instead.
Also, I think that code is for a SAMD Arduino, not an Uno.

1 Like

Where do you have the information from that this scale uses the ACM serial driver? What driver does it use on the Windows computer? The link for driver installation in the manual you linked to does not work (404 Page not found).
The Arduino USB Host Shield doesn't auto-select drivers you must select the correct one at compile time. So you must know what hardware is used in the USB device you want to connect and hope that the USB Host Shield library offers support for that hardware.

The device driver on the Windows computer is Arduino Uno. Let me be clear. I open the Arduino IDE. I plug in the scale to the Windows USB. I select the DEVICE on the IDE to be "Arduino UNO" on "COM3". Then I open the Serial Monitor and I see valid data streaming in at 2400 baud.

In other words, the protocol of the data COMING FROM THE SCALE is compatible with the protocol of the data that comes from the Arduino. The scale seems to be using the same type of transfer protocol that the Arduino itself uses to talk to Windows.

So... that should be a pretty big clue right? How can I program the USB shield to parse a data stream that is compatible with the data stream that the Arduino typically sends to the Windows computer over USB?

You could have choosen anything, it does not matter.

Did you install any software on the PC for the scale? If yes, that might have installed a driver for it.

Open windows device manager, right click the com port of the scale, select properties and check which driver is used. That might give those in the know (not me) a clue.

Yes, the scale uses a serial interface. That's the only compatibility it has.

No, that's no clue at all. It just means that the scale uses a UART over USB emulation which isn't a big surprise. There are at least half a dozen common chips doing that and many uncommon ones not to forget the possibility that the scale's processor is doing the USB stuff itself so that a proprietary protocol is used.

Thanks for telling me about "UART over USB". That leads to a bunch of useful information.

When I open Windows Device Manager it says...

Intel(R) USB 3.0 eXtensible Host Controller - 1.0 (Microsoft) PCI\VEN_8086&DEV_9D2F&SUBSYS_8079103C&REV_21\3&11583659&0&A0

This appears to be simply a general purpose driver for HP laptops (which is my computer).

It appears that a very common way to do "UART over USB" is with the FTDI. Probably the scale uses FTDI. So I need to connect a USB host shield to an "FTDI" device. THis link looks like just what I need. I guess i'll try that....

1 hour later.... nope that fails.

Guess i'll open up the scale, cut the wires to the load cell, and use an HX711 to read the resistance directly. And avoid all the USB crap.

Although I never dig deep into Windows device manager, I have doubts that that is your scale. Does it disappear when you disconnect the scale and check device manager again?

Wrong conclusion but you already figured that out :wink:

This code is written for Stamps . com Model 510.
And again, this code looks to be for SAMD Arduinos.

This is the host controller as the entry says. You need a slave entry.

Windows is a very common operating system. Probably your phone uses it too. Oops, just to be common doesn't mean everyone is doing the same shit.
FTDI is quite common but it's also the most expensive choice a manufacturer can select.

You might want to ask your supplier to fix the driver install link in the manual, that would help us to identify the used chip.

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