How to use USB RFID readers on an Arduino Uno



1. Plug the RFID reader into a Windows PC. Does it work without installing drivers? Open any editor such as NotePad. Read a card or key fob by passing the card or key fob on or near the reader. Do the characters appear on the screen as if typed at a keyboard? Look in Device Manager. The reader should be listed as a USB keyboard. If all the above are true, it should work with a USB host shield and Uno running the USB HID keyboard sketch.

The same procedure applies to bar code readers.

Do not expect all USB RFID and bar code readers to work like USB keyboards. Some devices such as RFID reader/writers require special USB drivers so are not usable with the USB host shield.

The simple RFID readers shown above, read the RFID unique serial number. No other fields are returned. The readers cannot write to the RFID card.

In the photo, starting at the top, are a 125KHz RFID reader, a 13.56 MHz RFID reader, Arduino Uno, and Circuits@Home USB host shield. Both readers work with the USB host shield.

2. If the USB host shield is based on the MAX3421E chip, install the following driver using the IDE library manager.

USB Host Shield Library 2.0 by Oleg Mazurov (Circuits@Home) et al.

3. Unplug everything from the Uno except the USB host shield. Plug in the RFID reader.

Run the following example sketch using the IDE.

File | Examples | USB Host Shield Library 2.0 | HID | USBHIDKbdBoot

4. Tap a compatible RFID card or key fob on the reader. The RFID data should appear in the IDE serial console window.

Comments

  1. how to get output like 0000123456?

    ReplyDelete
  2. Can 2 or more readers be used with this sketch, on different pins for each reader?

    ReplyDelete

Post a Comment

Popular posts from this blog

Defective Arduino USB Host Shield Boards

WeMos D1 R2 ESP8266 with USB Host Shield