Barcode Scanner

hello guys,

I'm new here. This is also my first foray into the world of electronics. I'm working on a project, where I'm trying to replace the barcode scanner.

Ideally, when you plugin a usb barcode scanner, it spits out the UPC code, because it's acting a HID (Human Interface Device)

Well, I already have the list of UPC codes, and I just need to output it from the arduino to my PC, via USB.

How do I make it work ?

Do I have to use a MAX3323 chip, to output the data as RS232 and then use a RS232 to USB cable to connect to my PC ?

Any help is appreciated. Please!

Use an Arduino that can act as a HID.

Arduino Leonardo or Micro
Sparkfun pro micro
Teensy

I think that the Arduino Zero and Due also can act as a HID.

Note:
no idea what UPC codes are.

Thanks for the prompt reply.

UPC code is the number that is written under the barcode of a product. It is used to lookup a product, do inventory etc. It's unique.

So I could use one of the leonardo/micro, and use the keyboard library to output the numbers ?

Yes

My memory is not certain, but, aren't there several different types of bar codes? Have you researched this?

Paul

@Paul_KD7HB, are you referring to code-39 and the likes?

If so, I don't think that that is relevant; it's the way the lines on the barcode are coded to represent an identifier. To my knowledge, barcode readers just spit out text.

You're right. I'm not reading the barcode, but rather getting the information from an rfid reader. The rfid reader gives an EPC, and it has various varieties. The one I'm interested in is SGTIN-96.

Here's a link that explains the concept. SGTIN INFO - EPC-RFIDEPC-RFID

I have already parsed the EPC and gotten the UPC for the product. I just need the arduino to spit out the parsed text, like any barcode scanner would.

Thank you for all the replies, guys!

I just need the arduino to spit out the parsed text, like any barcode scanner would.

Use Serial.print().

You have to have a program running on the PC to monitor the input, regardless of whether that input comes from a barcode scanner or the Arduino. If the bar code scanner pretends to be a serial input device, you are almost done. Just send the same characters that the scanner does.

Cool. Thank you so much.

jremington:
Use Serial.print().

I doubt that that works if OP wants HID functionality :wink:

I doubt that that works

Reread the OP. We know nothing about the bar code scanner, except that it "spits out" data via a USB connection.

So does an Arduino.

OP clearly mentions HID. An I missing something?

An I missing something?

Yes, the fact that the OP probably doesn't know exactly how the mysterious bar code scanner works, and we certainly don't.

So why "doubt it will work"? Are you just trying to discourage the OP?

Usually (or in the past) the cheap USB barcode scanner look like a keyboard to the PC they are connected. Scanning a barcode just sends the number as keyboard key presses.

Yes, and the Arduino can mimic a PC keyboard, either the old PS/2 style, or the newer USB style.

Hey guys,

Here's some more clarification on the project.

You see, I have tested the following barcode scanner : Symbol barcode scanner ls2208

When I connect it to my PC, scan something, it just spits out the digits.

I have also hooked it up to a Square's Register, that does inventory/checkout, and the register automatically accepts the output from the scanner, and looks up the item.

As I've already mentioned, that I'm just trying to mimic that functionality. As previously mentioned, I read the EPC from a RFID reader, and parse the UPC out of it.

Funnily enough, when I connect an USB keyboard to the Square's Checkout Register, it doesn't accept any character input. This leads me to think, Square only looks for Product_ID and Vendor_ID and if it's that of a barcode manufacturer, it does something meaningful with the input.

So, I want to know, is there a way, where I can program the EEPROM so I can change the Vendor_ID and Product_ID of the Arduino.

So, when I attach it to the Square's Register, it still thinks that the input is coming from a Symbol's Barcode Scanner ?

Specs here LS2208 Handheld Scanner Specification Sheet | Zebra

The scanner is claimed to interface to a variety of host ports, including RS232, so there will be no major diificulty to emulate it with an Arduino, using RS232 for example.

You will need to determine the exact protocol. "Spits out characters" is not helpful.

What software inputs those characters, and what does that software do with them?

As I mentioned, I intend to connect the arduino to a Square Register, so as you scan an item, it parses out the UPC, and the internal software of Square accepts the output from the Arduino, and pulls up that product/item. That's it.

I'm sure as far as emulating an arduino to behave a barcode scanner goes, it is not a big deal, because my preliminary research reveals that some people have even tried that.

This page, Human Interface Devices (HID) Specifications and Tools | USB-IF mentions of a Table of values that devices have so software applications can easily understand what type of device it is.

My thinking is, Square probably does the same too. Hence I was asking if it's possible to change the Vendor_ID and Product_ID by programming the EEPROM.

I hope it clears up some of the confusion.

Hence I was asking if it's possible to change the Vendor_ID and Product_ID by programming the EEPROM.

That would depend entirely on how you decide to have the Arduino mimic the device, but the IDs (if they need to be changed) would be in the Arduino code, not the EEPROM.

sterretje:
OP clearly mentions HID. An I missing something?

Just my 2¢ in response to the above...

The old style bar code scanners were interfaced to a computer via what is called a "keyboard wedge"; and were originally implemented on the old XT/AT keyboard interface (5-pin DIN) connector, and later via the PS/2 keyboard (6-pin mini-DIN) connector.

Simplistically speaking, the "keyboard wedge" implements a logical "OR-ing" of the keyboard and barcode scanner outputs, utilized as an input to the host computer. This was the basic scheme used to get the scanner output--in the form of keyboard scan codes--into the host computer, without disturbing the ability to use the keyboard as a primary input device.

Their communications conformed to the XT/AT keyboard scan code protocol protocols at the time; and later versions of barcode scanners conform to the USB-HID (Human Interface Device) specification.

In either interface instance, the barcode scanner output appears to the computer as native alpha-numeric key presses.

It's a damned inefficient system, but one that grew out of necessity because of the port limitations of the computers we had, back in the 1980's. It seems that the barcode scanning industry, much like the US auto industry, is resistant to change.

As sterretje says, "[Use an] Arduino Leonardo or Micro, Sparkfun pro micro, [or a] Teensy".

Info on 'UPC' barcodes: EAN/UPC barcodes | GS1