In an era where smart homes are becoming increasingly popular, controlling home appliances with minimal effort has become a priority for many. One of the most innovative methods to achieve this is by using RFID (Radio Frequency Identification) technology. RFID technology allows you to control home appliances like light bulbs and A.C sockets with a simple scan of an RFID card. In this post, we will guide you through a project that uses an Arduino Uno, an MFRC522 RFID reader, and a 4-channel relay module to control two light bulbs and two A.C sockets. This solution offers convenience, security, and a touch of modern technology in the area of RFID Access Control to your home.
What is RFID Technology?

RFID stands for Radio Frequency Identification, a wireless communication method that uses electromagnetic fields to automatically identify and track tags attached to objects. RFID technology is widely used in various applications, from inventory management to access control systems. In this project, we leverage RFID technology to create a simple and effective way to control home appliances.
Components Required for the Project

To build this RFID-based home automation system, you will need the following components in the table below.
ITEM DESCRIPTION | QUANTITY | UNIT COST | TOTAL UNIT |
VOLTAGE REGULATOR | 2 | 150 | 300 |
RFID MODULE | 2 | 3000 | 6000 |
TRANSFORMER | 1 | 1000 | 1000 |
LEDs | 70 | 20 | 1,400 |
RESISTORS | 6 | 10 | 60 |
ATMEGA | 1 | 4000 | 4000 |
CONNECTING WIRES | 3YARD | 100 | 300 |
CASING | 1 | 2000 | 2000 |
VERO BOARD | 2 | 600 | 1200 |
TRANSISTORS | 4 | 50 | 200 |
MODEL | 1 | 6000 | 3000 |
SOLDERING LEAD | 1 | 1500 | 1500 |
SOLDERING IRON | 1 | 2000 | 2000 |
BREAD BOARD | 3 | 1000 | 1000 |
CAPACITOR | 4 | 50 | 200 |
1A FUSE | 1 | 150 | 150 |
LAMPHOLDER | 1 | 150 | 150 |
RELAY MODULE | 1 | 4500 | 4500 |
FEMALE HEADERPIN | 2 | 200 | 400 |
PUSH BUTTON | 1 | 150 | 150 |
16MHz CRYSTAL | 1 | 150 | 150 |
MISCELLANEOUS | 5 | 500 | 2500 |
- Arduino Uno Standalone: The brain of the project, responsible for processing RFID data and controlling the relays.
- MFRC522 RFID Reader: Used to read the RFID cards.
- RFID Cards: These will be used to control the states of the home appliances.
- 4-Channel Relay Module: Allows control of up to four different appliances (two light bulbs and two A.C sockets in this case).
- Jumper Wires: For connecting the components.
Remote Health Monitoring System with ESP32, LoRa, & ThingSpeak
How Does RFID Access Control Work?
The core idea behind this project is to use RFID cards to control the on/off states of home appliances. Each RFID card is pre-programmed with a unique ID. When you scan an RFID card with the MFRC522 reader, the Arduino reads the card’s ID and matches it with predefined conditions. Depending on the card scanned, the Arduino will toggle the state of the connected appliances by controlling the relays.
The Circuit Diagram for The Design

Step-by-Step Guide to Building the RFID Access Control System
Step 2: Build the Microcontroller MCU Standalone Board

The microcontroller unit which is the control part of the design was built off the Atmega328p-pu programmable integrated circuit. It is made up of the Atmega chip, crystal oscillator and filter capacitors. The liquid crystal display is a display module programmable, economical and can display special characters. A 16×2 LCD means it can display 16 characters per line and there are two of such lines. Each character is displayed in 5×7 pixel matrix. The LCD has two registers namely; Command and Data. The pins and their functions are explained as:

- Register Select (RS): this pin selects Command register when low and Data register when high.
- Read/Write (R/W): this pin writes to the register when low and reads from the register when high.
- Enable (E): this pin sends data to the Data pins when a high to low pulse is given to it.
- Pin 7 to 14 (D4 to D): these are 8-bit pins that are used to send and receive data to/from the LCD.
- Pin 15 ( ): this is the positive (+Vcc) backlight of the LED (LED+) of the LCD. This pin is usually connected with a pull-up resistor ( ≤ 1kΩ). this is important to limit current flowing in the LEDs of the LCD.
- Pin 16 (D16): this is the negative (ground ) −Vcc pin. It is connected to the ground of the DC power supply.
Step 2: Setting Up the Arduino and RFID Reader Begin by setting up your Arduino Uno and connecting the MFRC522 RFID reader. The RFID reader will communicate with the Arduino via SPI (Serial Peripheral Interface). Ensure the connections are correct as per the pin configuration:

- VCC: 3.3V (from Arduino)
- GND: GND (common ground with Arduino)
- SDA: Digital Pin 10
- SCK: Digital Pin 13
- MOSI: Digital Pin 11
- MISO: Digital Pin 12
- RST: Digital Pin 9
Step 3: Connecting the Relay Module Next, connect the 4-channel relay module to the Arduino. The relay module will be used to control the power supply to the appliances:
- IN1 to IN4: Connect to any four digital pins on the Arduino (e.g., 2, 3, 4, 5)
- VCC: 5V (from Arduino)
- GND: Common ground with Arduino
Programming the Arduino Uno Standalone board
/* Program to use RFID CARDS TO CONTROL
* TWO HOME APPLIANCES
*/
//include the LCD lib
#include <LiquidCrystal.h>
//include the RFID libs
#include <SPI.h>
#include <MFRC522.h>
//declear the reset and SDA pins of RFID
#define SS_PIN 10
#define RST_PIN 9
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
//state the output pins for appliaces
#define LED1 A1
#define LED2 A2
int ledState1 = 0;
int ledState2 = 0;
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
void setup()
{
// Initiate a serial communication
Serial.begin(9600);
// Initiate SPI bus
SPI.begin();
// Initiate MFRC522
mfrc522.PCD_Init();
//begin the LCD
lcd.begin(16, 2);
Serial.println("Approximate your card to the reader...");
Serial.println();
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
//display a welcome note
lcd.setCursor(0, 0);
lcd.print("WELCOME DAVID");
delay(2000);
lcd.setCursor(0, 0);
lcd.print("RFID CONTROLLED ");
lcd.setCursor(0, 1);
lcd.print("HOME APPLIANCES");
delay(3500);
lcd.clear();
}
void ledOne()
{
// Look for new cards
if ( ! mfrc522.PICC_IsNewCardPresent())
{
return;
}
// Select one of the cards
if ( ! mfrc522.PICC_ReadCardSerial())
{
return;
}
//Show UID on serial monitor
Serial.print("UID tag :");
String content= "";
byte letter;
for (byte i = 0; i < mfrc522.uid.size; i++)
{
Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(mfrc522.uid.uidByte[i], HEX);
content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
content.concat(String(mfrc522.uid.uidByte[i], HEX));
}
Serial.println();
Serial.print("Message : ");
content.toUpperCase();
if (content.substring(1) == "0A DB D9 06") //change here the UID of the card/cards that you want to give access
{
// if the LED is off turn it on and vice-versa:
if (ledState1 == 0) {
ledState1 = 255;
lcd.setCursor(2, 1);
lcd.print("ON ");
} else {
ledState1 = 0;
lcd.setCursor(2, 1);
lcd.print("OFF ");
}
// set the LED with the ledState of the variable:
analogWrite(LED1, ledState1);
}
delay(500);
}
void ledTwo() {
// Look for new cards
if ( ! mfrc522.PICC_IsNewCardPresent())
{
return;
}
// Select one of the cards
if ( ! mfrc522.PICC_ReadCardSerial())
{
return;
}
//Show UID on serial monitor
Serial.print("UID tag :");
String content= "";
byte letter;
for (byte i = 0; i < mfrc522.uid.size; i++)
{
Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(mfrc522.uid.uidByte[i], HEX);
content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
content.concat(String(mfrc522.uid.uidByte[i], HEX));
}
Serial.println();
Serial.print("Message : ");
content.toUpperCase();
if (content.substring(1) == "35 F7 F0 D1") //change here the UID of the card/cards that you want to give access
{
// if the LED is off turn it on and vice-versa:
if (ledState2 == 0) {
ledState2 = 255;
lcd.setCursor(12, 1);
lcd.print("ON ");
} else {
ledState2 = 0;
lcd.setCursor(12, 1);
lcd.print("OFF ");
}
// set the LED with the ledState of the variable:
analogWrite(LED2, ledState2);
}
delay(500);
}
void loop()
{
lcd.setCursor(0, 0);
lcd.print("Light: Socket:");
ledOne();
ledTwo();
}
Now, it’s time to write the Arduino code. The code should be programmed to read the RFID card’s ID and control the relays accordingly. For each RFID card, you will define a specific action such as turning a light bulb on or off, or controlling the A.C socket. Below is a simple example of how the code logic might look
Explanation of the Arduino Source Code
This source code is for a project that controls two home appliances (likely represented by two LEDs) using RFID technology with an Arduino. The program begins by including necessary libraries for handling the LCD display and RFID reader, specifically the LiquidCrystal library for the LCD and the SPI and MFRC522 libraries for RFID functions. The RFID reader is connected to the Arduino via specific pins (SDA and RST), and two LEDs (or appliances) are connected to the analog pins A1 and A2. The setup function initializes the serial communication, RFID reader, and LCD, then displays a welcome message on the LCD.
The code contains two primary functions, ledOne()
and ledTwo()
, each responsible for controlling one of the two appliances. These functions continuously check for new RFID cards using the mfrc522.PICC_IsNewCardPresent()
method. When a card is detected and its UID (unique identifier) is read, the UID is compared against predefined values in the code. If a match is found, the corresponding appliance’s state (on or off) is toggled, and the new state is displayed on the LCD. The loop function orchestrates the overall process by repeatedly calling the ledOne()
and ledTwo()
functions and updating the LCD to show the status of the appliances. The entire process allows users to control the state of two home appliances by scanning specific RFID cards.
Testing the System

Once the wiring and code are in place, we uploaded the code to our Arduino standalone Uno board and test the system. Use the RFID cards to control the appliances and observe how the relays respond to different card IDs. We also ensured that each card controls the intended appliance and that the system functions as expected.
Fine-Tuning and Expansion
After the basic setup is working, you can fine-tune the system by adjusting the relay timings, adding more RFID cards, or expanding the number of appliances you can control. The beauty of using Arduino and RFID is that it allows for a lot of flexibility and customization.
- Read DIY Remote-Controlled Fan Using Arduino: A Step-by-Step Guide
- Read Smart Window Automation: Arduino-Based System for Rain, Smoke, and Gas Detection
- Read How To Design An Arduino Based Automatic Gate Controller
Advantages of RFID-Based Home Automation
- Convenience: Control your home appliances with just a scan of a card.
- Security: Only authorized RFID cards can control the appliances, adding a layer of security.
- Customization: Easily program and reprogram the system to meet your needs.
- Scalability: Expand the system to control more appliances or integrate with other smart home systems.
- Energy Efficiency: Automate the control of appliances to reduce energy consumption.
Conclusion
Controlling home appliances using RFID technology offers a seamless and modern approach to home automation. By following this guide, you can set up a simple yet effective RFID access control system for your home. Not only does this project make your life easier, but it also adds an element of security and sophistication to your home. As you continue to explore RFID technology, you’ll find even more ways to integrate it into your daily life, making your home smarter and more efficient.
Let us know if you tried this project design and if you were able to perform the work as detailed here. We await your comment below.
Frequently Asked Questions (FAQs)
1. What is RFID and how does it work in home automation? RFID, or Radio Frequency Identification, is a wireless technology that uses electromagnetic fields to identify and track tags attached to objects. In home automation, RFID can be used to control appliances by scanning RFID cards, which then trigger actions like turning on or off lights and other devices.
2. Can I control multiple appliances with RFID? Yes, you can control multiple appliances with RFID by using a relay module. Each relay in the module can be connected to a different appliance, allowing you to control them individually or collectively using different RFID cards.
3. How secure is RFID for home automation? RFID offers a decent level of security for home automation, as only authorized cards can control the appliances. However, it is advisable to use RFID systems with encryption and secure communication protocols for enhanced security.
4. Can I integrate this system with other smart home devices? Yes, the RFID-based home automation system can be integrated with other smart home devices. For instance, you can combine it with smart lighting systems, security cameras, or voice-controlled assistants like Alexa or Google Home.
5. What are the power requirements for this RFID home automation system? The power requirements for this system are relatively low. The Arduino Uno operates at 5V, and the relay module typically requires 5V as well. A standard USB power supply or a 9V battery can be used to power the entire system.