Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Bluetooth - RFID Notify

Technology badge License badge SDK badge Required board Required board Build badge Flash badge RAM badge

Type badge

Overview

This example is intended to demonstrate the capability to scan an RFID card and send a notification to a client device using the BLE stack on Silicon Labs development kits. A peer device can connect and receive notifications when a 125 kHz card is scanned.

This example is also the foundation for developing automatic door lock systems, automatic car parks, and so on. The system will use BLE for wireless communication between the Silicon Labs board and the Simplicity connect mobile application.


Table Of Contents


SDK version


Software Required


Hardware Required


Connections Required

The following picture shows the system view of how it works.

hardware_connection

The I2C connection is made from the Silicon Labs's Kit to the SparkFun RFID Reader board by using the qwiic cable.


Setup

To test this application, you can either create a project based on an example project or start with a "Bluetooth - SoC Empty" project based on your hardware.

Note

Create a project based on an example project

  1. From the Launcher Home, add your hardware to My Products, click on it, and click on the EXAMPLE PROJECTS & DEMOS tab. Find the example project filtering by "rfid notify".

  2. Click Create button on the Bluetooth - RFID Notify example. Example project creation dialog pops up -> click Create and Finish and Project should be generated.

    create_project

  3. Build and flash this example to the board.

Start with a "Bluetooth - SoC Empty" project

  1. Create a Bluetooth - SoC Empty project for your hardware using Simplicity Studio 5.

  2. Copy all attached files in inc and src folders into the project root folder (overwriting existing).

  3. Import the GATT configuration:

    • Open the .slcp file in the project.

    • Select the CONFIGURATION TOOLS tab and open the Bluetooth GATT Configurator.

    • Find the Import button and import the configuration bluetooth_rfid_notify/config/btconfig/gatt_configuration.btconf file.

    • Save the GATT configuration (ctrl-s).

  4. Open the .slcp file. Select the SOFTWARE COMPONENTS tab and install the software components:

    • [Services] → [IO Stream] → [IO Stream: USART] → default instance name: vcom
    • [Application] → [Utility] → [Log]
    • [Platform] → [Driver] → [I2C] → [I2CSPM] → default instance name: qwiic
    • [Third Party Hardware Drivers] → [Wireless Connectivity] → [ID-12LA - RFID Reader (Sparkfun) - I2C]
  5. Build and flash the project to your device.

Note

A bootloader needs to be flashed to your board if the project starts from the "Bluetooth - SoC Empty" project, see Bootloader for more information.


How It Works

GATT Database

The application is based on the Bluetooth - SoC Empty example. Since the example already has the Bluetooth GATT server, advertising, and connection mechanisms, only minor changes are required.

Advertisement Packet Device name: RFID Notify

GATT Database

  • Device name: RFID Notify
  • [Service] RFID Notify
    • [Char] RFID Card
      • [N] Notify card's UID.

Testing

Since the Bluetooth SIG has not defined a Service or Characteristic for RFID cards we will be creating a new custom service with UUID 97088d85-3d52-46c0-af4d-8afe385b0f00 and a custom characteristic with UUID 5d6e3d9f-aac5-48cb-ae46-c99aaa2a5911. The custom characteristic has read and indicate properties and we assign an id of card_uid so that we can reference it in our application. The card_uid characteristic is 6 bytes which will contain the UID of the last card scanned.

When a card is scanned, the application will notify all connected devices, with the notification enabled, of the updated card_uid value.

Follow the below steps to test the example with the Simplicity Connect application:

  1. Open the Simplicity Connect app on your smartphone and allow the permission requested the first time it is opened.

  2. Find your device in the Bluetooth Browser, advertising as RFID Notify, and tap Connect.

    browse_device

  3. When the device is connected, you have to find the RFID Notify service, then RFID Card and enable "Notify" for this characteristic as in the following picture:

    enable_notify

  4. After finishing all the steps above, you can tap an RFID card on the reader module and observe the value change. The Hex value represents the card's UID.

    rfid_char

  5. You can launch Console that's integrated into Simplicity Studio or use a third-party terminal tool like Tera Term to receive the data from the USB. A screenshot of the console output is shown in the figure below.

    console_log


Report Bugs & Get Support

To report bugs in the Application Examples projects, please create a new "Issue" in the "Issues" section of bluetooth_applications repo. Please reference the board, project, and source files associated with the bug, and reference line numbers. If you are proposing a fix, also include information on the proposed fix. Since these examples are provided as-is, there is no guarantee that these examples will be updated to fix these issues.

Questions and comments related to these examples should be made by creating a new "Issue" in the "Issues" section of bluetooth_applications repo.