In previous tutorials, we built Arduino door locks using RFID and IR technology. In this project, we upgrade the system by using RF 433 MHz wireless communication, allowing the door to be unlocked from a longer distance without line-of-sight.
Unlike infrared remotes, RF signals can pass through walls and obstacles, making this system far more practical for real-world home automation and smart security projects.
By the end of this tutorial, you will learn how to:
The system operates in three stages:
Therefore:
Steps:
Upload this test sketch:
Unlike infrared remotes, RF signals can pass through walls and obstacles, making this system far more practical for real-world home automation and smart security projects.
By the end of this tutorial, you will learn how to:
- Use RF transmitter and receiver modules
- Wire and control a solenoid door lock safely
- Decode RF remote signals using Arduino
- Build a wireless door unlocking system
- Understand how RF communication works in IoT projects
Watch the Project Overview
How the System Works
The system operates in three stages:
- A 433 MHz RF remote transmits a wireless signal when a button is pressed.
- The RF receiver connected to Arduino captures the signal.
- Arduino verifies the received code and activates a relay to unlock the solenoid lock.
This creates a wireless key fob door lock.
Required Components
- Arduino Uno
- Arduino Nano
- 433MHz RF transmitter module
- 433MHz RF receiver module
- 5V Relay Module
- 12V Solenoid door lock
- External 12V power supply
- Breadboard and Jumper wires
Why External Power Is Required
A solenoid lock draws much more current than an Arduino pin can provide.Therefore:
- Arduino controls the relay
- External 12 V powers the lock safely
Wiring
RF 433 MHz transmitter module → Arduino Nano
- GND - Ground
- VCC - 5V
- DATA - D10
RF 433 MHz receiver module → Arduino Uno
- GND - Ground
- VCC - 5V
- DATA (any one of the two pins can be used)- D2
Relay Module → Arduino Uno
- S - D12
- (+) - 5V
- (-) - Ground
Solenoid Lock → Relay
Relay acts as a high-power switch:- External 12 V → Relay COM
- Relay NO → Solenoid positive
- Solenoid negative → Power supply negative
Installing Required Library
Install the RC Switch library.Steps:
- Open Arduino IDE
- Go to Sketch → Include Library → Manage Libraries
- Search RCSwitch
- Install
Capturing Your Remote Code
Before writing the main program, we must read the code sent by the RF remote.Upload this test sketch:
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
Serial.begin(9600);
mySwitch.enableReceive(0); // Pin 11
}
void loop() {
if (mySwitch.available()) {
Serial.println(mySwitch.getReceivedValue());
mySwitch.resetAvailable();
}
}
How to Read the Code
- Open Serial Monitor
- Press a button on the remote
- Note the number displayed
This is your unlock code.
Arduino Lock Program
Replace the code value with your own remote value.
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
int relayPin = 7;
long unlockCode = 123456; // Replace with your code
void setup() {
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, LOW);
mySwitch.enableReceive(0);
}
void loop() {
if (mySwitch.available()) {
long received = mySwitch.getReceivedValue();
if (received == unlockCode) {
digitalWrite(relayPin, HIGH);
delay(5000);
digitalWrite(relayPin, LOW);
}
mySwitch.resetAvailable();
}
}
Program Explanation
RF Signal Detection
Arduino constantly listens for RF signals:mySwitch.available()
Code Verification
Only the stored code unlocks the door:
if (received == unlockCode)
Door Unlock Sequence
Relay activates for 5 seconds:
digitalWrite(relayPin, HIGH);
delay(5000);
digitalWrite(relayPin, LOW);
This prevents the lock from staying open.
You learned how to decode RF signals, control high-power devices safely, and build a practical home automation project.
This project demonstrates how simple wireless communication modules can be used to create real-world security solutions.
Testing the System
- Power the Arduino
- Connect the 12 V lock supply
- Press the remote button
Safety Notes
Always remember:- Never power the solenoid from Arduino
- Always use a relay or MOSFET
- Ensure proper insulation of 12 V wiring
- Test using LED before connecting the lock
Applications
This project can be used for:- Smart home security
- Garage doors
- Office access control
- Wireless gate automation
- IoT learning projects
Conclusion
In this tutorial, we built a wireless RF door lock system using Arduino and a 433 MHz remote.You learned how to decode RF signals, control high-power devices safely, and build a practical home automation project.
This project demonstrates how simple wireless communication modules can be used to create real-world security solutions.





Comments
Post a Comment