The Core Magnetism Equation for Solenoids and Electromagnets
When designing relays, inductors, electromagnets, or actuators, the fundamental magnetism equation you need is the magnetic field density inside an ideal solenoid. The direct answer for the magnetic flux density (B) generated by a coil is:
B = μ₀ · μᵣ · (N / L) · I
This equation dictates exactly how much magnetic field you will generate based on your physical coil geometry and the material inside it. Below is the strict definition of every symbol, its SI unit, and the realistic magnitude you should expect on the bench.
| Symbol | Parameter | SI Unit | Realistic Bench Magnitude |
|---|---|---|---|
| B | Magnetic Flux Density | Tesla (T) | Earth: 50 μT. Fridge magnet: 5 mT. Neodymium: 1.2 T. Iron saturation: ~1.8 T. |
| μ₀ | Vacuum Permeability | T·m/A | ~1.256637 × 10⁻⁶ T·m/A (See note on 2019 SI redefinition below). |
| μᵣ | Relative Permeability | Dimensionless | Air/Vacuum: 1. Ferrite: 200-2500. Silicon Steel: 4000-8000. |
| N | Number of Turns | Dimensionless (turns) | Typically 10 to 10,000 depending on wire gauge and bobbin size. |
| L | Length of the Coil | Meters (m) | 0.01 m (1 cm) for small relays up to 0.5 m for large contactors. |
| I | Current | Amperes (A) | 0.05 A (50 mA) for signal relays up to 10 A for heavy-duty contactors. |
When This Formula Applies (And When It Breaks)
The solenoid magnetism equation is a powerful design tool, but it relies on strict physical assumptions. If you violate these assumptions, your calculated B-field will not match your measured B-field.
Valid Assumptions
- Ideal Solenoid Geometry: The length of the coil (L) must be significantly greater than its radius (typically L > 10 × radius). If you are winding a short, fat coil (like a pancake coil), the field at the center drops off, and you must apply a geometric correction factor or use the Biot-Savart law.
- Uniform Core Material: The formula assumes the core material fills the entire cross-section of the magnetic path uniformly.
- Linear B-H Region: The equation assumes μᵣ is constant. In reality, ferromagnetic materials exhibit a non-linear B-H curve. Once the core approaches magnetic saturation (typically 1.5 T to 2.0 T for iron), μᵣ drops rapidly toward 1, and pushing more current (I) yields almost zero increase in B.
Unit Mistakes That Break the Math
The most common reason a DIY electromagnet fails to generate the expected holding force is a unit conversion error. Watch out for these:
- Centimeters instead of Meters for L: If you plug in L = 5 cm as '5' instead of '0.05', your calculated B-field will be off by a factor of 100. Always convert length to meters before calculating.
- Gauss instead of Tesla: Older datasheets and cheap handheld Gaussmeters use Gauss. 1 Tesla = 10,000 Gauss. If your target is 500 Gauss, you must enter B = 0.05 T into the rearranged equation.
- Ignoring μᵣ for Air Cores: If you are winding an air-core inductor, μᵣ is exactly 1. Do not accidentally leave a default value of 1000 (iron) in your calculator.
Rearranged Forms for Component Selection
In practice, you rarely solve for B. You usually have a target magnetic field (to actuate a relay armature or avoid core saturation) and need to size your physical components. Here are the rearranged forms solving for each design variable:
- To find required Turns (N):
N = (B · L) / (μ₀ · μᵣ · I) - To find required Current (I):
I = (B · L) / (μ₀ · μᵣ · N) - To find required Coil Length (L):
L = (B · μ₀ · μᵣ · N) / I(Useful for determining bobbin size) - To find required Permeability (μᵣ):
μᵣ = (B · L) / (μ₀ · N · I)(Useful for selecting core material)
Worked Examples with Strict Unit Tracking
Let's apply these rearranged formulas to two distinct bench scenarios, tracking every unit to ensure dimensional consistency.
Example 1: Designing a 12V DC Relay Coil
Scenario: You are winding a custom DC relay. You need a magnetic flux density (B) of 0.6 T to reliably pull in the armature. Your bobbin allows for a coil length (L) of 0.04 m. You are using a soft iron core with a linear relative permeability (μᵣ) of 2,000. Your power supply can deliver a maximum current (I) of 0.25 A. How many turns (N) do you need?
Step 1: Identify and convert variables to SI base units.
- B = 0.6 T
- L = 0.04 m
- μᵣ = 2000 (dimensionless)
- I = 0.25 A
- μ₀ = 1.2566 × 10⁻⁶ T·m/A
Step 2: Select the rearranged formula.
N = (B · L) / (μ₀ · μᵣ · I)
Step 3: Substitute and track units.
N = (0.6 [T] · 0.04 [m]) / (1.2566 × 10⁻⁶ [T·m/A] · 2000 [1] · 0.25 [A])
N = 0.024 [T·m] / (0.0006283 [T·m])
Step 4: Calculate final value.
N = 38.19
Decision: You cannot wind a fraction of a turn. Round up to 39 turns to ensure you exceed the 0.6 T pull-in threshold. Verify that 39 turns of your chosen wire gauge (e.g., 28 AWG) physically fits within the 0.04 m bobbin length.
Example 2: Sizing Current for an Air-Core RF Choke
Scenario: You are building an air-core inductor for a high-frequency LC oscillator. To avoid core saturation and hysteresis losses, you are using a non-magnetic form (μᵣ = 1). The coil is 0.1 m long, has 400 turns, and you need a peak magnetic field of 5 mT (0.005 T) during operation. What peak current (I) is required?
Step 1: Identify variables.
- B = 0.005 T (Converted from 5 mT)
- L = 0.1 m
- μᵣ = 1
- N = 400
- μ₀ = 1.2566 × 10⁻⁶ T·m/A
Step 2: Select the rearranged formula.
I = (B · L) / (μ₀ · μᵣ · N)
Step 3: Substitute and track units.
I = (0.005 [T] · 0.1 [m]) / (1.2566 × 10⁻⁶ [T·m/A] · 1 · 400)
I = 0.0005 [T·m] / (0.00050264 [T·m/A])
Step 4: Calculate final value.
I = 0.9947 A
Decision: You need approximately 1.0 A of peak current. Because this is an RF application, skin effect will increase the effective resistance of the wire. Select 18 AWG magnet wire (rated for ~1.4 A at high frequencies) rather than 20 AWG to minimize I²R heating.
Decision Path: Sizing Your Electromagnet or Inductor Core
Choosing the right core material and wire gauge is where theoretical math meets physical constraints. Use the decision matrix below to terminate your design process with a concrete component selection.
| Condition / Target | Required Action | Concrete Component Pick |
|---|---|---|
| Target B < 0.3 T AND Frequency > 10 kHz | Use a high-resistivity ceramic core to prevent eddy current heating. μᵣ is moderate. | Fair-Rite Type 43 Ferrite (μᵣ ≈ 800). Excellent for RF chokes and SMPS transformers up to 500 kHz. |
| Target B = 0.5 T to 1.5 T AND Frequency = DC to 60 Hz | Use a laminated or solid high-permeability metal core. Watch for saturation above 1.8 T. | M19 Silicon Steel Laminations or 1018 Soft Iron rod. Standard for 50/60Hz line transformers and heavy DC contactors. |
| Target B > 1.5 T (High Holding Force) | Electromagnets become highly inefficient past iron saturation (I²R heat spikes for negligible B gain). Switch to permanent magnets. | N42 or N52 Neodymium (NdFeB) permanent magnet (Remanence Br ≈ 1.3 to 1.48 T). |
| Calculated I < 0.5 A | Standard enamel magnet wire is sufficient. Focus on turn count over wire thickness. | 26 AWG to 30 AWG Polyurethane enameled copper wire (e.g., MWS Wire). |
| Calculated I > 2.0 A | Thermal management is critical. Use thicker wire and consider potting the coil in thermally conductive epoxy. | 14 AWG to 16 AWG magnet wire, potted in MG Chemicals 832TC thermal epoxy. |
If your worked example yields a B-field greater than 2.0 T using an iron core (μᵣ > 1000), your math is theoretically correct but physically impossible. The core has saturated, μᵣ has collapsed to ~1, and the excess current is simply generating heat. Always cross-reference your calculated B with the manufacturer's B-H curve for your specific core material. For a deep dive into material selection, consult the Fair-Rite Material Selection Guide to match your operating frequency and flux density targets.
By strictly tracking units, respecting the geometric assumptions of the solenoid equation, and terminating your design with a concrete material pick based on the B-H saturation limits, you will eliminate the trial-and-error phase of electromagnet and inductor design.






