Magnetic Locks

Magnetic Lock Connection Diagram and Wiring Guide

How a magnetic lock is wired: the power supply, controller relay, request-to-exit button and door sensor, with a basic diagram and safety notes.

On this page
  1. Quick answer
  2. Parts you need
  3. Basic connection diagram
  4. Step-by-step wiring
  5. Fail-safe behavior
  6. Fire alarm and building codes
  7. Wire gauge and run length
  8. Where the access control parts fit
  9. Common wiring mistakes
  10. Safety

Quick answer

A magnetic lock needs low-voltage DC power, a switch that controls that power, and a way for the controller to know whether the door is closed. In the usual layout, the controller’s relay sits in the positive line. When the relay closes, the lock holds the door. When the relay opens, the lock releases. Follow the lock’s own manual for the exact connections, because layouts differ by manufacturer.

Parts you need

  • The magnetic lock: the electromagnet body and its armature plate, which mounts on the door.
  • A regulated DC power supply that matches the lock’s voltage, usually 12 or 24 volts DC, with enough current for the lock’s rating.
  • A relay or access controller that switches the lock’s power.
  • A request-to-exit (REX) button on the inside, if people should be able to leave without a card or code.
  • A door position switch, sometimes called a door contact, that tells the controller whether the door is closed.
  • Low-voltage wire sized for the run length.

Basic connection diagram

DC power supply (+) ---- relay contacts ---- magnetic lock (+)
DC power supply (-) ------------------------- magnetic lock (-)

Access controller output ---- relay coil
Door position switch -------- controller input
REX button ------------------ controller input

The relay contacts sit in the positive line. When the controller energizes the relay, the contacts close and the lock holds the door. When the relay opens, power to the lock stops and the door releases. The door position switch and the REX button send their signals back to the controller.

Step-by-step wiring

  1. Turn the power off. Switch off the power supply and confirm it’s off before touching any wire.
  2. Mount the lock and plate. Fit the lock body to the frame and the armature plate to the door. Line them up so the faces meet squarely and the gap matches the manufacturer’s specification.
  3. Set the voltage. Some locks have jumpers or switches for 12 or 24 volts. Set it before applying power.
  4. Run the lock wires. Connect the supply’s positive through the relay contacts to the lock’s positive, and the supply’s negative straight to the lock’s negative.
  5. Wire the controller. Connect the relay coil to the controller’s output, and the door position switch and REX button to its inputs. Check whether each input expects a normally open or normally closed contact.
  6. Test before you finish. With the door both closed and open, check that the lock holds, releases on command, releases from the REX button, and reports the door status correctly.

Fail-safe behavior

Electromagnetic locks need continuous power to hold a door. When power is lost, the pull stops and the door releases. This is called fail-safe. It suits exit doors, because people can always leave during an outage. The trade-off is that a power cut also unlocks the door. If the door must stay locked during an outage, ask about a fail-secure electric strike, or a battery backup for the power supply.

Fire alarm and building codes

In many commercial and multi-family buildings, codes require electric locks on exit doors to release when power is lost, and often when a fire alarm or sprinkler system activates. The exact rules depend on the code edition in force and on the local fire marshal or building official, and they change over time. Check with them before wiring a lock to any commercial or shared exit door.

Wire gauge and run length

Long runs and high current cause voltage drop. A lock that gets less voltage than it needs can hold weakly, or fail to hold at all. Use the wire chart in the lock’s manual, which relates current and distance to a wire size, rather than guessing.

Where the access control parts fit

If the lock is part of a larger setup, the door access control system wiring diagram shows how the controller, card readers, keypads and locks connect. A key card door access system follows the same pattern: the reader sends a signal to the controller, and the controller switches the lock’s power. A keypad on a magnetic lock also needs a controller in the power path, as in a door code lock system.

Common wiring mistakes

  • Powering the lock from an unregulated or undersized supply, which can leave it with a weak hold.
  • Setting the wrong voltage on the lock.
  • Switching the lock’s power with a contact rated only for small signals. The coil draws far more current than a signal can carry.
  • Reversing the door position switch, so the controller reads a closed door as open, or the reverse.
  • Skipping the test with the door open and closed.

Safety

Work only on the low-voltage DC side unless you are qualified for mains wiring, and have a licensed electrician do any mains work. Mount the power supply in a ventilated, accessible spot. Use listed products and follow the installation manual. Some warmth is normal in some designs. A burning smell, smoke, or a case too hot to touch means switch the power off and inspect the wiring. For a commercial door, hire a licensed electrician or access control installer.

Keep exploring

Guides from other topics

All topics →