กลับไปหน้ารวมไฟล์
rfid-activated-led-9bddfe-en.md

I made this because I wanted to try an RFID tag and thought this might be a simple project to start with.

First of all, connect the RFID module using the picture below.

Then, the LED should go to digital pin 6 and GND. This will be activated when the RFID tag is over the module.

Proximity-Based Authentication

This project demonstrates the fundamentals of contactless data exchange using Radio Frequency Identification (RFID) technology.

  • MFRC522 Protocol: The system uses an RC522 RFID reader. The Arduino communicates with it via the SPI protocol, constantly polling for a unique UID (Unique Identifier) from an approaching tag or card.
  • Access Control Logic: The firmware compares the scanned UID against a "Whitelist" stored in the code. If a match is found, the Arduino pulls a digital pin HIGH to illuminate the green LED, as shown in the connection diagram above.

Practical Scaling

  • EEPROM Storage: For more advanced versions of this project, new tags can be "learned" and saved to the Arduino's EEPROM. This allows the system to remember multiple authorized users even after a power cycle, moving beyond a simple hardcoded whitelist.

Time to code! Download GETUID.ino. This will get the UID or the tag. The only thing I changed in this code was move the printHex function to before setup() and loop(). Upload this code and in the Serial Monitor, the UID should be displayed.

Next, download RFIDLED.ino. I added the led part in this code. Upload this and hover the RFID tag close to the module. The green LED should come on!

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x Arduino IDE"
author: "BigTogepi"
category: ""
components:
  - "1x 5 mm LED: Green"
  - "1x RFID Module (Generic)"
  - "1x Arduino UNO"
  - "1x Male/Female Jumper Wires"
  - "1x 9V battery (generic)"
  - "1x 9V Battery Clip"
description: "RFID tag turns on LED."
difficulty: "Intermediate"
documentationLinks: []
downloadableFiles: []
encryptedPayload: "U2FsdGVkX19+00lkbO7I6vWM8oUQlNiI/mHU42U78+5sHGMHUXdrb+DBbJiucLLeKqxyJTEe7/jvoAuFYXN3a+s4F33Pp8yFAAnCto4IY0Y="
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/rfid-activated-led-9bddfe_cover.jpg"
lang: "en"
likes: 1
passwordHash: "2724445043f95459ff2c449e7b9eda41b751441b408119d2178ca7495f1b01c9"
price: 299
seoDescription: "Simple Arduino project: Use an RFID tag to activate an LED. Easy guide for RFID Module and Sensor integration."
tags:
  - "remote control"
title: "RFID Activated LED"
tools: []
videoLinks: []
views: 8810