Magnetic locks come in two varieties--types that use electromagnetic force to hold a door closed unless the lock is released, and those that use magnetism to manipulate latches or deadbolts. In principle, magnetic locks are a straightforward and reliable approach to security, provided that a few basic precautions are observed during the engineering process.
A standard electromagnetic lock features an iron plate affixed to the door and an electromagnet attached to the secure side of the entry. When locked, the electromagnet engages, pulling the iron plate toward the magnet with enough force that a person cannot pull the door open. This type of lock is easy to create--simply attach the iron plate to the door and attach the electromagnet on the inside. Beware, however, that the power needed to create an electromagnetic field of enough force to stop a normal intruder can be significant, so a dedicated circuit may be necessary, rated for higher amperage than a normal household outlet.
A magnet-assisted lock uses magnetic forces to open or close bolts. A do-it-yourself version might feature a deadbolt that is actuated by a magnetic servo. A remote-access device like a garage-door opener or game controller activates the servo, which engages or disengages the deadbolt. This type of lock has minimal power requirements, as electromagnetic force is not holding the door closed. Disassemble a remote-controlled car or plane to get the motors and remote controller needed to actuate the deadbolt.
Magnetic locks can be activated or deactivated in a variety of ways--by keys that physically open or close an electric circuit, by computer keypads or card readers, or by remote controls. Take appropriate steps to ensure that the means of access control is secure. Also, conduct proper contingency planning in case a magnet-assisted lock fails in the locked position. Make sure you have another means of gaining entry to the secured area.
Always mount the hardware for a magnetic lock on the secure side of the door to reduce the risk of lock tampering. Because electromagnetic locks require a continuous supply of power to remain active, consider a battery backup or generator bypass to address power-failure scenarios. Remember that although a well-designed electromagnet can hold with forces that meet or exceed the failure force of traditional deadbolts, the lock is only as secure as its housing, so be sure to reinforce the lock's connection to the walls to avoid having the lock itself torn off the wall during an attempted intrusion.