
Our earlier keypad and RFID lock projects moved a physical bolt with a servo motor. This project uses a genuinely different kind of actuator — a 12V electric solenoid lock, the same style of hardware used in commercial electric door strikes.
How a solenoid lock differs from a servo-driven bolt
A servo-driven lock physically rotates a small mechanism to slide a bolt — useful for lightweight DIY builds. A solenoid lock instead uses an electromagnetic coil: when powered, the coil's magnetic field pulls a metal locking pin back, releasing the door; when unpowered, a spring returns the pin to its locked position. It draws meaningfully more current than a small hobby servo, which is why it's switched through a relay rather than driven directly from an Arduino pin.
Components needed
An Arduino Uno, a 5V relay module, a 12V electric solenoid lock, a 12V power adapter, and jumper wires.
Wiring it up
The relay's control pin connects to Arduino digital pin 12, acting as the switch between Arduino's control signal and the separate 12V circuit powering the solenoid lock — the relay is essential here since Arduino's own pins can't safely switch a 12V load directly.
Programming it
The base sketch simply alternates the relay between energized (unlocked) and de-energized (locked) states every two seconds, as a demonstration — in a real deployment, this timing would instead be triggered by an actual input, like a keypad code, RFID card, or button press, rather than running on a fixed timer.
Where this fits among our other lock projects
Compared to the servo-based keypad and RFID lock builds we've covered before, this solenoid approach fits situations closer to a real commercial door — higher holding force, standard electric-strike hardware — while the relay-switching pattern here is easy to combine with any of those earlier keypad or RFID access-control projects instead of the demo timer.
You can find 12V solenoid lock modules and relay modules at Juthour Tech.
Leave your comment