0

I am working on a project to collect data from a barcode scanner using an Arduino, which in turn is connected to a POS/laptop. So far I am able to collect the data from the barcode scanner by using the Arduino as a host, and in order to send the scanner data from the Arduino to the laptop, I am using a basic FTDI board that converts serial data from the arduino to USB.

However, it shows up as a COM port in my computer and I need an additional serial monitor to see the data transferred from the Arduino.

Is there a device that converts serial data from the arduino to "HID keyboard Device" similar to the FTDI board?

Please let me know if I have not made myself clear or if you need more information.

Edit: I forgot to add that I am using an Arduino MKR NB 1500. I am using the board's native USB port to connect to the barcode scanner. The USBHost library gives the board the ability to act as a USB host and connect to the barcode scanner and get the scanned data from the barcode scanner.

I am using the FTDI board (serial to USB converter) and arduino's serial1 to send the scanned data to my laptop.

We are trying to build a portable device that connects to the barcode scanner and the POS. We are using the Arduino to update our database (I can use the MKR board to send a POST request with the barcode data to update our database) and in addition to this the Arduino should be able to send the scanned data to POS. As of now I am connecting the Arduino's RX and TX pins to the FTDI board, which converts UART to USB. I would like to replace this FTDI board with an interface that converts UART to "USB HID keyboard". Please let me know if more information is needed.

1
  • 1
    you could use a scanner which has SPI or Serial interface and let the USB free for keypad emulation
    – Juraj
    Aug 11, 2021 at 11:56

2 Answers 2

1

I would like to replace this FTDI board with an interface that converts UART to "USB HID keyboard".

FTDI Friend and ATmega32u4 board

On the left is an "FTDI Friend" that converts serial to USB. It is similar to the Sparkfun product you are using.

On the right is a similar sized, similar priced, board that can read serial and can act as a USB keyboard (Implementing the appropriate HID). It's a Pololu A*Star micro but it's just one example of many similar devices. I used this one to implement a physical keyboard using mechanical switches but the input could have as easily come from it's serial interface.

Any ATmega32u4 or SAMD based board can act as a USB HID keyboard using the standard Arduino keyboard library

Admittedly you'll have to write and upload a sketch but that ought to be relatively straightforward.

There are also smaller, potentially cheaper, boards such as the Digispark and clones that have a separate software library to implement USB HID Keyboard functionality on a very simple microcontroller like the ATtiny85.


We are trying to build a portable device that connects to the barcode scanner and the POS.

As Juraj's comment suggests, many barcode readers started out as serial devices and only later had USB-serial capability added. If you use a Barcode scanner with serial output, you probably don't need any extra hardware and can use the MKR NB 1500's USB interface to act as a keyboard device instead of as a host for the scanner.

1
  • Thank you so much for your response. I will try with Attiny85 and 32U4 Micro boards and see how it goes. Unfortunately, i have to work with USB barcode scanners and I am using the arduino board's native USB to get the data from the barcode scanner.
    – sud.ng7
    Aug 18, 2021 at 10:17
0

use CH9329 chip it's cheap and could act as Keyboard and mouse at the same time. interface is a little bit hard as it's Chinese but it's cost 1 USD only.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.