Quick answer
You can build a basic electromagnet door holder as a project, but a homemade version isn’t a dependable lock. For a door you rely on, buy a listed electric or magnetic lock with a published holding force, and have it installed to the manufacturer’s instructions.
What a homemade magnetic lock is
It’s an electromagnet: a coil of insulated wire around a steel core, which pulls on a steel plate when it’s powered. A hobby version usually runs on a low-voltage DC supply, with a switch to turn it on and off. The principle is the same as a commercial magnetic lock.
Why a homemade version falls short
- No known holding force. A commercial lock comes with a rating from testing. A homemade coil’s pull depends on the wire, the core, the supply and the gap, and it’s hard to measure at home.
- Heat. A coil that is too strong for its supply or enclosure can overheat.
- No fail-safe design. Commercial units are designed to release when power is lost. That matters on exit doors, and a homemade one is usually not built with it in mind.
- No door sensing or controller. Most commercial locks work with a door position switch and a controller. A homemade one usually has neither.
- No listing. Many commercial locks are tested against a recognized safety or security standard. A home build isn’t.
- Building rules. A home-built lock on a commercial or shared exit door can break building codes.
Safety rules if you experiment
- Never run a coil from mains voltage. Use a regulated low-voltage DC supply.
- Fuse the circuit and keep the supply accessible.
- Let the coil cool between tests, and don’t leave it powered and unattended.
- Don’t test on a door someone may need to leave through in an emergency.
What to look for when buying
- A holding force rating that the manufacturer recommends for your door’s size and weight.
- A fail-safe or fail-secure setup that suits the door. A fail-secure choice is often an electric strike rather than a magnetic lock.
- A recognized safety or security listing.
- A door position switch and a controller or input that works with your alarm or access setup.
- Professional installation for any commercial or shared door.
Keypad and card control
A keypad or card reader can control a magnetic lock too, through a controller that switches the lock’s power. That’s the same pattern used in a key card door access system, and a keypad can work the same way in a door code lock system.