Create a secure Arduino RFID Door Lock with Visual Programming in Visuino! This tutorial shows how to connect the MFRC522 RFID module, check RFID card IDs, and control a magnetic solenoid lock. When a valid RFID card is detected, the door unlocks and a green LED lights up as a visual confirmation. Swipe the same card again to lock the door. Unauthorized cards are denied access.
🔹 What you’ll learn:
- Wiring and configuring MFRC522 with Arduino
- Using Visual Programming in Visuino to detect RFID card UIDs
- Checking IDs against an authorized list (access control)
- Controlling a solenoid lock with Arduino + Visuino
- Adding a green LED indicator for successful unlock
- Implementing re-swipe toggle logic (lock again)
🔹 Hardware Required:
- Arduino board (Uno, Nano, Mega, or compatible)
- MFRC522 RFID module + RFID tags/cards
- Magnetic solenoid lock (or electric strike) with driver (relay/MOSFET)
- Green LED + resistor (for unlock indication)
- External power supply for solenoid
- Breadboard, jumper wires, optional buzzer
🔹 Why this project is great:
- No coding — 100% Visual Programming with Visuino
- Beginner-friendly but practical for smart home security
- Includes both lock control and LED feedback for clear status
Watch the Video!
Step 1: What You Will Need- RFID module MFRC522
- Electromagnetic solenoid lock DC 12V
- Power Supply
- Relay module
- Some RFID card for the test
- LED
- 1K ohm resistor
- Arduino UNO
- Jumper wires
- Breadboard
- Visuino program: Download here
- Connect RFID module pin[SDA] to Arduino digital pin[10]
- Connect RFID module pin[SCK] to Arduino digital pin[13]
- Connect RFID module pin[MOSI] to Arduino digital pin[11]
- Connect RFID module pin[MISO] to Arduino digital pin[12]
- Connect RFID module pin[GND] to Arduino pin[GND]
- Connect RFID module pin[RST] to Arduino digital pin[9]
- Connect RFID module pin[3.3v] to Arduino pin[3.3v]
- Connect Arduino digital pin [3] to 1K ohm resistor
- Connect 1K ohm resistor to LED positive pin (+)
- Connect LED negative pin (-) to Arduino Pin GND
- Connect Relay VCC pin(+) to Arduino 5V pin
- Connect Relay GND pin(-) to Arduino GND pin
- Connect Relay signal pin(S) to Arduino Digital pin 2
- Connect power supply 12V (+) to Electromagnetic lock red wire(+)
- Connect power supply 12V (-) to relay pin(com)
- Connect Electromagnetic lock black wire (-) to relay pin(NO)
Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2
Step 4: In Visuino Add Components- Add "RFID MFRC522/WS1850S (SPI)" component
- Add "Binary To Text" component
- Add "Text Multi Source" component
- Add "Text Value" component
- Add "Find Text Position" component
- Add "Delay" component
- Add "Toggle(T) Flip-Flop" component
Select "BinaryToText1" and in the properties window set "Begin Text", "End Text" and "Separator Text" to empty
Select "TextValue1" and in the properties select "Value", click on the 3 dots button and in the Value window set you card IDs
Select "FindPosition1" and in the properties window select "Text", click on the pin icon and select "String SinkPin"
Select "Delay1" and in the properties window set "Interval" to 500000 (0.5s) you can adjust this value according to your needs, in this project it is used to add a small delay in reading the RFID tag to prevent double reading when you swipe the tag.
Step 6: In Visuino Connect Components- Connect (Byte) from RFID1.Card.ID OutputPin to BinaryToText1.InputPin
- Connect (Digital Output Pin) from RFID1.ChipSelect OutputPin to Arduino.Digital.Digital[ 10 ].DigitalInputPin
- Connect (SPI Communication) from RFID1.Interface OutputPin to Arduino.SPIChannels.SPI.InputPin
- Connect (Digital Output Pin) from RFID1.Reset OutputPin to Arduino.Digital.Digital[ 9 ].DigitalInputPin
- Connect (Sting) from BinaryToText1.OutputPin to MultiSource1.InputPin
- Connect (Sting) from MultiSource1.OutputPins.Pin [0] to FindPosition1.Text
- Connect (Clock) from MultiSource1.OutputPins.Pin [1] to TextValue1.Clock InputPin
- Connect (Sting) from TextValue1.OutputPin to FindPosition1.InputPin
- Connect (Clock) from FindPosition1.OutputPin to Delay1.Start InputPin
- Connect (Clock) from FindPosition1.Missing OutputPin to TFlipFlop1.Reset InputPin
- Connect (Clock) from Delay1.OutputPin to TFlipFlop1 ClockInputPin
- Connect TFlipFlop1.OutputPin to MultiSource2.InputPin
- Connect MultiSource2.OutputPins.Pin [0] to Arduino.Digital.Digital[ 2 ].DigitalInputPin
- Connect MultiSource2.OutputPins.Pin [1] to Arduino.Digital.Digital[ 3 ].DigitalInputPin
In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.
Step 8: PlayCongratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it and open it in Visuino: https://www.visuino.eu
Comments