usb barcode scanner and arduino

Dear members, please help me I got frustrated because I bought this usb barcode scanner (photo attached) and usb to ps2 cable but was unsuccessful in outputting any thing to the arduino IDE serial monitor using the ps2 keyboard example.

when I connect the scanner directly to usb on my laptop it outputs the serial number of the barcode to word document.

please help me get the project to run, when I connect the cables to my arduino the scanners runs normally but gives a long error beep after I scan a barcode.

any help or advice is appreciated

Is that the right USB-to-PS/2 adapter? It looks like it might be for connecting PS/2 peripherals to a PC that has a USB port and no PS/2 ports. You want one that allows you to connect a USB peripheral to a PC that has PS/2 ports and no USB ports.

I looked around and did not find any USB Keyboard to PS/2 Port adapters. The only ones I found were very small passive devices used for keyboards that can support either USB or PS/2 and only need the connector adapter. They will most likely not work on your device.

You might be able to get it to work with a USB Host Shield.

johnwasser:
Is that the right USB-to-PS/2 adapter? It looks like it might be for connecting PS/2 peripherals to a PC that has a USB port and no PS/2 ports. You want one that allows you to connect a USB peripheral to a PC that has PS/2 ports and no USB ports.

I looked around and did not find any USB Keyboard to PS/2 Port adapters. The only ones I found were very small passive devices used for keyboards that can support either USB or PS/2 and only need the connector adapter. They will most likely not work on your device.

You might be able to get it to work with a USB Host Shield.

thank you so muh for this helpful response, is there any specific usb sheild, I prefere usb breakout because I need to put it all inside a device of my design. with arduino.

thank you again, before I buy the usb breakout what do you think if I look in the market for ps/s scanner?

ahmedalot:
before I buy the usb breakout what do you think if I look in the market for ps/s scanner?

Adafruit has a PS/2 barcode scanner module: Barcode Reader/Scanner Module - CCD Camera - PS/2 Interface : ID 1202 : Adafruit Industries, Unique & fun DIY electronics and kits It isn't in a fancy handle and it costs $70 but it might be a good option.

Here is an example of using the USB Host Shield with a USB barcode scanner:
https://www.circuitsathome.com/mcu/connecting-barcode-scanner-arduino-usb-host-shield

Does your scanner have a removable USB cable? Perhaps it has a hidden serial mode like this model:

I have searched for any old scanner in my city with PS/2 connector, my search was unsuccessful.

I am buying this usb breakout board to use with my USB scanner: https://www.sparkfun.com/products/9716

its an FTDI Basic Breakout - 5V, will it do the job? i can remove the USB cable and hard-wire the connectors from the scanner's PCB to Arduino pins.

when I finish I will update this post for novice like me :wink:

with many thanks,

ahmedalot:
I am buying this usb breakout board to use with my USB scanner: https://www.sparkfun.com/products/9716
its an FTDI Basic Breakout - 5V, will it do the job?

No. That is a breakout for the FTDI USB-to-Serial chip, similar to the chips used in older Arduinos to connect the Arduino to a USB Host.

You need something with a MAXIM MAX3421E or equivalent:

johnwasser:

ahmedalot:
I am buying this usb breakout board to use with my USB scanner: https://www.sparkfun.com/products/9716
its an FTDI Basic Breakout - 5V, will it do the job?

No. That is a breakout for the FTDI USB-to-Serial chip, similar to the chips used in older Arduinos to connect the Arduino to a USB Host.

You need something with a MAXIM MAX3421E or equivalent:
MAX3421E Datasheet and Product Info | Analog Devices

thank you for your help, I paused the order with sparkfun. I think you refere to this shield (SparkFun USB-C Host Shield - DEV-21247 - SparkFun Electronics) but isn't there a breakout for this chip? it seems to connect to all pins and I have an LCD with touch screen and a motor and a thermal recipt printer too. what is your suggestion isn't better to order a ps2 reader or go ahead with converters?

It looks to be a Cipherlab 1070, and according to the datasheet http://www.cipherlab.com/livefiles/en/Documents/77/130430@CPL_1070_EN_Brochure_Outside_All.pdf
it supports "Keyboard wand" and USB.

I'm pretty sure that you can disconnect the cable and connect another cable that ends in a PS/2 connector.

The setup you have now, will never, ever work, as inside the cable, there are active electronics, and it's one-way only. If look at the polarity of the connectors, it's obvious that it's PS/2 IN and USB OUT.

You could try one of the passive adaptors for USB to PS/2 like this

There is nothing inside the adaptor apart from 4 wires connecting the pins.

If you are lucky, the manufacturer constructed the device to use the same pins for both USB and PS/2 communication, like some newer keyboards and mice do. If not, you need to get the correct cable.

The Barcode readers i have used, all use an RJ45-jack in the handle, and it uses different pins for PS/2, USB and RS232.

// Per.