Skip to main content

Arduino RF 433 MHz Door Lock System with Solenoid Lock & Wireless Remote

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:
  • 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
This project is ideal for beginners interested in wireless home automation and embedded systems.

Watch the Project Overview

How the System Works

The system operates in three stages:
  1. A 433 MHz RF remote transmits a wireless signal when a button is pressed.
  2. The RF receiver connected to Arduino captures the signal.
  3. 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
This protects your Arduino from damage.

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:
  1. Open Arduino IDE
  2. Go to Sketch → Include Library → Manage Libraries
  3. Search RCSwitch
  4. Install
This library allows Arduino to decode RF signals.

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

  1. Open Serial Monitor
  2. Press a button on the remote
  3. Note the number displayed
Example: Received: 123456
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.

Testing the System

  1. Power the Arduino
  2. Connect the 12 V lock supply
  3. Press the remote button
The lock should open for 5 seconds.

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.

FAQ

Why use RF instead of IR?

RF has longer range and does not require line-of-sight.

Can multiple remotes be used?

Yes. Store multiple codes and check them in the program.

Can this work through walls?

Yes. That is one of the biggest advantages of RF.

Can I use ESP32 instead of Arduino Uno?

Yes, with minor pin changes.

Comments

Popular posts from this blog

Arduino Serial Communication Beginner Guide (UART Explained)

Serial communication is the backbone of most Arduino projects. It allows your Arduino to talk to your computer, Bluetooth modules, Wi-Fi modules, sensors, and even other Arduinos. If you have ever used the Serial Monitor, you have already used serial communication - now you will understand how it really works. By the end of this guide, you will learn: What serial communication is What UART means How Arduino communicates with devices How to send and receive data How baud rate works Common mistakes beginners make What is Serial Communication? Serial communication is a method of sending data one bit at a time over a single wire. Instead of sending many bits simultaneously (parallel communication), serial sends bits sequentially: Example: The letter A in binary = 01000001 These bits are sent one after another very quickly. This method is: Simple Reliable Perfect for microcontrollers What is UART? UART stands for: Universal Asynchronous Receiver Transmitter It is the hardware ins...

How to Connect HC-06 Bluetooth Module with Arduino (Step-by-Step Beginner Guide)

Bluetooth communication is one of the easiest ways to make Arduino projects wireless. Once you understand how to use a Bluetooth module, you can build robots, home automation systems, and smartphone-controlled devices. In this tutorial, you will learn how to interface the HC-06 Bluetooth module with Arduino and send data wirelessly using your phone.    By the end of this guide, you will be able to: Understand how the HC-06 Bluetooth module works Configure the module using AT commands Safely connect it to an Arduino Send and receive serial data over Bluetooth Build the foundation for wireless Arduino projects Watch the Project Overview What is the HC-06 Bluetooth Module? The HC-06 is a Bluetooth-to-Serial module designed to add wireless communication to microcontrollers such as Arduino. It uses Bluetooth 2.0 (SPP - Serial Port Protocol), which means it behaves like a wireless serial cable. Whatever is sent from the phone appears in Arduino’s Serial Monitor and vice versa. ...

How to Use SoftwareSerial on Arduino (Connect Multiple Serial Devices)

In the previous tutorial, you learned how Arduino uses hardware serial communication through pins 0 (RX) and 1 (TX). That built-in serial port is mainly used to communicate with your computer through the USB cable and Serial Monitor . But here is the problem beginners quickly face: Many popular modules use serial communication, such as: Bluetooth modules ( HC-05 / HC-06 ) GPS modules GSM modules Wi-Fi modules ( ESP8266 ) Arduino Uno has only one hardware serial port. So how can we connect these modules while still using the Serial Monitor? The solution is SoftwareSerial . In this tutorial you will learn how to create additional serial ports using normal digital pins. By the end, your Arduino will be able to talk to multiple serial devices. What is SoftwareSerial? SoftwareSerial is a special Arduino library that allows digital pins to behave like RX and TX pins. This means Arduino can create extra serial ports using software instead of hardware. Hardware Serial vs Software Seri...