BLE Shield Project: RFID Tag Reader

After creating the BLE Shield for Arduino it is time to create some projects with it to show you what can be done using the shield. Maybe you remember that I created an RFID Tag Reader for the iPhone acting as Bluetooth keyboard in order to send the UID of an RFID Tag to the iPhone:

Now it is time to create a simple RFID Tag Reader using the BLE Shield. In order to stack such a device together, I grabbed the following out of my “Arduino Box”:

  • 1 x Arduino Pro Mini 3.3V
  • 1 x Adafruit PN532 NFC/RFID Controller Shield for Arduino
  • 1 x Seeddstudio Solar Charger Shield v0.9b
  • 1 x BLE Shield 0.9.2
and stacked together this fancy device:

In this setup I ‘m using hardware serial to send data to the BLE Shield, so the switch needs to be set to the Tx0/Rx1 position. I programmed the Arduino Pro mini with the following sketch, where the 16 byte buffer is filled with padding zeros and then with the UID of the tag.


#define IRQ   (2)
#define RESET (3)  // Not connected by default on the NFC Shield

Adafruit_NFCShield_I2C nfc(IRQ, RESET);

void setup(void) {


  uint32_t versiondata = nfc.getFirmwareVersion();
  if (!versiondata) {
    while (1); // halt

  // configure board to read RFID tags

void loop(void) {
  boolean success;
  // Buffer to store the returned UID
  uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 };
  // Buffer for writing the padding
  uint8_t pad[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
  // Length of the UID (4 or 7 bytes depending on ISO14443A card type)
  uint8_t uidLength;
  uint8_t bleBufferLength = 16;
  uint8_t paddingSize = 0;

  // Wait for an ISO14443A type cards (Mifare, etc.).  When one is found
  // 'uid' will be populated with the UID, and uidLength will indicate
  // if the uid is 4 bytes (Mifare Classic) or 7 bytes (Mifare Ultralight)
  success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &uid[0], &uidLength);

  if (success) {
    paddingSize = bleBufferLength - uidLength * 2;
    // add padding depending of the size of the TAG UID
    for (uint8_t i=0; i < paddingSize; i++)  {
      Serial.print(pad[i], HEX);

    // write the UID of the tag.
    for (uint8_t i=0; i < uidLength; i++)  {
      Serial.print(uid[i], HEX);

    // Wait 1 second before continuing

You can use BLExplr to test the reader. Just connect to the BLE Shield, enable notify on the RX characteristic and place an RFID Tagreader near the antenna.


The following video shows this connection and tagging procedure:

BLE Shield RFID Tag Reader from Michael Kroll on Vimeo.

13 Responses to BLE Shield Project: RFID Tag Reader

  1. Bart McIntyre July 11, 2012 at 04:54 #

    Beautiful! I love your work. I will be one of the first to purchase your BLE Shield when it is available. I am currently testing various devices and I am in need of a BT4.0 solution for the iPhone 4S and the new iPad. This will make my task a bit more enjoyable. Please let me know if I may purchase one sooner. I will gladly make a donation via PayPal, and I will purchase your BLExplr app.

  2. KITTA Yoshimune July 12, 2012 at 18:29 #

    Nice work!
    I want use BT4.0 on Arduino.
    It’s great solution!

  3. jacob July 16, 2012 at 20:57 #

    can i order/buy the BLE shield for shipment to Belgium?

    • Michael Kroll July 17, 2012 at 16:00 #

      Hi Jakob,
      not yet. The beta is processing. After a few weeks and hopefully only positive feedback I’ll start a first v1.0 production run.


  4. wintifrosch July 23, 2012 at 15:51 #

    Great. Any ambitions to RaspberryPi? We’d like to sponser a port to RasPi.

    • Michael Kroll July 24, 2012 at 09:44 #

      I don’t have time to port it to Raspberry PI, but if there is a 3.3V TTL level Serial Port it can be durectly attached. I don’t have a Raspberry for testing. There could be another Board Design for the Raspberry.


  5. Michele September 30, 2012 at 12:45 #

    Hi Michael,

    I would like to order…

    Thank you!

  6. dominik October 6, 2012 at 07:05 #

    Hey michael,
    i would like to purchase 3 of the modules. Is that possible? i would need them from the 22.10.2012 on for a beta test of an exhibition.


    • Michael Kroll October 6, 2012 at 09:23 #

      Hi Dominik,
      sorry but the RFID Reader is currently not for sale. I’ll work on a BLE version sometime, but I don’t have a roadmap for that yet.


  7. Tony Wang November 1, 2012 at 04:10 #

    Hi Michael,

    This is a really nice project. BTW, are you going to share the BLE shield PCB design files?


  8. Gerald Prado July 8, 2015 at 19:37 #

    If anyone is looking for a device that is ready to go, and can read multiple types of tags you should check out the idChamp RS3 HSE, it can connect in BLE, HID, & SPP bluetooth profiles. Can also connect to BLE & HID or SPP simultaneously and send data to both hosts.

    Well worth checking out.

    • Michael Kroll July 8, 2015 at 19:44 #

      Of course it if worth checking it. Take a look at the link.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Powered by WordPress. Designed by WooThemes