A permanent magnet generates a persistent magnetic field from aligned atomic domains, while an electromagnet creates a controllable magnetic field only when electric current flows through a wire coil. This fundamental difference dictates your power budget, thermal management, and fail-state behavior in any build. Permanent magnets require zero holding current but cannot be turned off without mechanical force; electromagnets demand continuous power and generate heat, but offer instant electronic control.

The Physics and the Circuit Impact

In a permanent magnet (like Neodymium or Ferrite), the magnetic domains are locked into alignment during manufacturing. The field is always 'on'. In an electromagnet, the magnetic field is generated by moving charges (current) through a conductor, governed by Ampere's Law. Wrapping that conductor into a coil multiplies the field, and inserting a ferromagnetic core (like soft iron) concentrates it further.

Key Metric: Magnetic field strength is measured in Tesla (T) or Gauss (G), where 1 Tesla = 10,000 Gauss. A typical N42 neodymium magnet yields ~1.3 T at its surface, while a standard 12V DIY electromagnet hits 0.1 T to 0.5 T depending on the core material.

What this changes in your circuit is the fail-state and thermal load. If you use an electromagnet for a door lock, you must design for continuous current draw (often 0.5A to 2A at 12V/24V) and manage the I²R heat generated in the coil. If power fails, an electromagnet drops its load (fail-safe). A permanent magnet latch holds the load during a blackout (fail-secure) but requires a mechanical strike or a secondary motor to release it.

Worked Example: Calculating Electromagnet Pull

Let's calculate the magnetic force of a DIY electromagnet on the bench to see how it stacks up against a permanent magnet. The driving force of an electromagnet is measured in Ampere-turns (AT), which is the current multiplied by the number of wire loops.

The Build: We wind 400 turns of 24 AWG enameled copper magnet wire around a 1-inch diameter mild steel bolt.

  1. Wire Length: The circumference of a 1-inch core is roughly 3.14 inches. For 400 turns, we need 1,256 inches (104.6 feet) of wire.
  2. Resistance: 24 AWG copper has a resistance of 25.67 ohms per 1,000 feet at 20°C. Our 104.6 feet yields 2.68 ohms.
  3. Current: Applying 12V DC, Ohm's Law (I = V/R) gives us 12V / 2.68Ω = 4.47 Amps.
  4. Ampere-Turns: 400 turns × 4.47A = 1,788 AT.

According to Georgia State University's HyperPhysics solenoid equations, this generates a strong internal magnetic field, but the actual pull force on a steel plate depends on the air gap and core saturation. This DIY coil will pull roughly 15 to 25 Newtons (3.5 to 5.5 lbs) against a flat steel surface. By contrast, a 1-inch diameter N42 Neodymium permanent magnet of the same size will pull over 200 Newtons (45 lbs). The electromagnet sacrifices raw holding power for the ability to release the part instantly by cutting the 12V supply.

Where You Meet This in Practice

You will encounter the interplay between magnets and electromagnets in almost every electromechanical system:

  • Relays and Contactors: A low-power electromagnet pulls a steel armature to close high-current contacts. The core is designed to release instantly when the coil is de-energized.
  • Magnetic Door Locks (Maglocks): Used in commercial access control. These are massive electromagnets (often 600 to 1,200 lbs of pull force) that fail-safe during a fire alarm power cut.
  • Brushless DC (BLDC) Motors: Permanent magnets are mounted on the rotor, while electromagnets (stator coils) are switched in sequence by an ESC to chase the rotor's magnetic field.
  • Scrap Yard Cranes: Massive electromagnets lift ferrous scrap. When the crane reaches the drop zone, the operator cuts the power, and gravity takes over.

Common Confusions and Bench Mistakes

Confusion 1: Tesla vs. Pull Force. Makers often look at a magnet's Gauss/Tesla rating and assume it dictates pull force. A tiny 1/8-inch neodymium magnet has a massive surface Tesla rating but very low total pull force because the surface area is so small. Pull force (Newtons/pounds) is what actually holds your jig together.

Confusion 2: Core Saturation. A common bench mistake is assuming that adding more turns or pumping more current into an electromagnet will infinitely increase its strength. Ferromagnetic cores experience saturation. Once all the magnetic domains in the soft iron core are aligned (usually around 1.6 to 2.0 Tesla), the core acts like air. Pushing 20A through the coil instead of 5A will just burn up the wire with I²R heat without adding meaningful pull force.

Confusion 3: Using the Wrong Core Material. Never use a hard permanent magnet (like a neodymium bar) as the core for an electromagnet. Hard magnets have high coercivity, meaning they resist changes to their magnetic state. Electromagnets require soft magnetic materials (like mild steel or silicon electrical steel) that magnetize and demagnetize easily when the current switches.

Decision Tree: Picking the Right Magnet for Your Build

Use this decision path to select the correct holding mechanism for your next automation or access control project.

Project RequirementIf Yes...If No...
Must the load drop automatically if power fails? (Fail-safe)Go to Electromagnet path.Go to Permanent Magnet path.
Do you have a strict zero-standby-current budget? (e.g., battery/solar powered)Use Permanent Magnet + mechanical release.Use Electromagnet or Latching Solenoid.
Is the holding force required > 100 lbs?Use Commercial Maglock or large custom coil.Standard 12V DIY electromagnets are sufficient.
The Concrete Pick: If your decision tree leads to a 12V automated sorting gate, a DIY pick-and-place arm, or a small fail-safe latch, do not wind your own coil for the final build. Buy the Adafruit 12V Solenoid Electromagnet (Product ID 412). It features a steel core optimized for 12V DC, draws about 1A, and provides a reliable 25N (5.6 lb) pull stroke with built-in mounting threads, saving you hours of winding and heat-testing.

FAQ: Magnets and Electromagnets

Q: Why does my 12V electromagnet get too hot to touch after 3 minutes?
A: Most small DC electromagnets and solenoids are rated for intermittent duty (e.g., 25% duty cycle). They are designed to pull hard for a few seconds, not hold continuously. If you need continuous holding, you must either use a 'latching' solenoid (which uses a permanent magnet to hold and a brief reverse pulse to release) or add a power resistor in series to drop the holding current once the armature is seated.

Q: Can I use PWM to control the strength of an electromagnet?
A: Yes, but with a catch. Because the coil is an inductor, rapid PWM switching without a flyback diode will generate massive voltage spikes that will fry your MOSFET or Arduino. Always place a reverse-biased flyback diode (like a 1N4007) across the coil terminals. Additionally, the magnetic pull force scales with the square of the current, so a 50% PWM duty cycle yields roughly 25% of the maximum pull force, not 50%.

Q: Will a permanent magnet damage my ESP32 or Arduino?
A: The static magnetic field itself will not harm solid-state silicon or flash memory. However, moving a strong neodymium magnet near your board can induce a voltage in the PCB traces (Faraday's Law of Induction), potentially causing a brownout or resetting the microcontroller. Keep strong moving magnets at least 2 inches away from sensitive logic boards.