Barcode Scanner w/ PS/2 to TTL For Electron

This Is my first particle project and im trying to use a barcode scanner ( with a PS/2 connection to scan codes against a database so bear with me :joy: .

I want to use a PS/2 to TTL Converter ( to connect the barcode scanner. I understand that the barcode returns data like a keyboard sequence but most examples online had used a usb connector to an arduino.

I know the general layout of the pins but I’m unsure how the electron would take data from the converter and how exactly It displays TTL.

Has anyone tried to make a similar device or has had any experience with using PS/2 To TTL converters?
As well as if there are any libraries I should look at?

Any kind of advice would be great! :grin:

You probably want to read up on the PS/2 protocol:

Each key press is sent as a single byte wrapped in a frame. So you will received 11-12 bits for each key press. I’m not sure if there’s a library to read that in on a GPIO pin. If not, then you will have to poll the GPIO like using a soft serial and figure out each keypress based on that polling.

I’m surprised that Adafruit doesn’t have a library for that.

It looks like that converter module handles the decoding in hardware. You should just get ASCII data out, no decoding necessary. Connect the TX pin on the module to the RX pin on the Photon/Electron and read the data out at 57600 baud or 115200 baud depending on how you set up the other pins.


I have long ago written a PS/2 library to support PS/2 mice to be connected to Particle devices - this should work for keyboard emulation too.

With that you wouldn’t need the extra converter.


So if i was using the PS/2 port how would i connect it? is there such a way to use the USB male connector or would i have to find a PS/2 connector to my BB