sheen.bot Logo

2.6 RFID Reader

The RFID reader scans cards or tags and retrieves their UID (unique identifier). This is useful for object or person identification.

Example Applications:

  • Attendance systems
  • Electronic door locks
  • Inventory and asset tracking

2.6.1 Example Code for the RFID Reader

The example code for the RFID reader checks if a new card is present and then verifies whether the detected card matches a specific UID. If the UID matches, it triggers a set of actions, such as displaying a message or activating a device. The RFID reader used here is embedded directly into the sheenbot PCB, and users can tap their RFID card on the spot highlighted in the image below for the system to detect and respond accordingly.

  • Inside the forever loop, drag a block to turn on the red LED to show that the door is locked.
  • Display the message "Door Locked" on the OLED screen.
  • Insert an if block, then drag the Look for new card block into its condition slot.
  • Drag another if block inside, and place the Card UID is block into its condition slot. Enter your card’s UID (e.g., 2a7fe2d6).
  • Inside this second if block:
    • Turn on the green LED to indicate door unlocked.
    • Display "Door Unlocked" on the OLED.
    • Use the TTS Module to speak "Door Unlocked".
    • Wait for 4 seconds.
    • Turn the red LED back on to lock the door.
    • Update OLED to display "Door Locked".
    • Use TTS Module again to speak "Door Locked".
Figure 2.6.1a: RFID door lock logic in Mind+

Figure 2.6.1b: Location of RFID reader on sheenbot PCB (Tap your card here)