Magnetism is the physical force generated by moving electrical charges that attracts or repels other magnetic materials and induces voltage in nearby conductors. If you are building power supplies, wiring motors, or debugging microcontrollers, you cannot ignore this force. While static electricity deals with stationary charges, magnetism is strictly the domain of current in motion. Understanding this distinction is the first step to mastering everything from basic relays to high-frequency switching regulators.
The Core Concept (and What It Changes in a Circuit)
When electrons flow through a wire, they generate a concentric magnetic field around that conductor. If you coil the wire, those individual fields stack together, creating a concentrated magnetic flux. This is the foundational principle behind electromagnetism.
But what does this actually change in a real circuit or installation? It introduces inductance. Inductance is a circuit property that opposes any change in current. Think of it like traffic inertia on a highway: when the light turns green, cars (electrons) don't instantly hit 60 mph; they take time to accelerate. When the light turns red, they don't stop instantly; they skid forward. In a circuit, a magnetic field stores energy to keep current flowing when voltage drops, and it generates a reverse voltage (back-EMF) to resist current spikes when voltage rises.
Where You Meet This in Practice
You interact with magnetic fields constantly on the workbench and in the breaker panel. Here is where this physics principle becomes a physical component:
- Transformers: Two isolated coils share a magnetic core. AC current in the primary coil creates a fluctuating magnetic field, which induces a proportional voltage in the secondary coil. This is how your 120V mains steps down to 12V for your doorbell.
- Motors and Solenoids: The magnetic field generated by the stator coils pushes against permanent magnets (or an armature), converting electrical energy into mechanical work. A 12V DC solenoid valve drawing 1.5A is essentially a linear electromagnet.
- Inductors and Chokes: Used in power supplies to smooth out current ripple. They store energy in their magnetic field during the 'on' cycle and release it during the 'off' cycle.
- Relays and Contactors: A low-voltage DC signal energizes a coil, creating a magnetic field that physically pulls a steel armature to close high-voltage AC contacts. This provides galvanic isolation between your 3.3V ESP32 GPIO and a 240V water heater.
Worked Numeric Example: Sizing an Inductor for a Buck Converter
Let's move from theory to the bench. You are designing a buck converter to step down a 12V battery to a stable 5V rail for an Arduino Mega, drawing a maximum of 2A. You need to select the output inductor. If you pick the wrong value, your magnetic field will either saturate (causing a short circuit) or your current ripple will be too high (causing output noise).
We use the standard buck converter inductor formula:
L = (V_out × (V_in - V_out)) / (V_in × f_sw × ΔI_L)
The Setup Numbers:
- V_in = 12V
- V_out = 5V
- f_sw (Switching Frequency) = 50,000 Hz (50 kHz)
- ΔI_L (Ripple Current) = 30% of I_out = 0.6A
The Calculation:
- Multiply V_out by the voltage difference: 5 × (12 - 5) = 35.
- Multiply V_in, frequency, and ripple: 12 × 50,000 × 0.6 = 360,000.
- Divide the top by the bottom: 35 / 360,000 = 0.0000972 Henrys.
This gives us 97.2 μH. You would select a standard 100 μH shielded power inductor. However, the inductance value is only half the battle. You must also check the datasheet for the saturation current (I_sat). If your inductor's I_sat is rated for only 1.5A, the magnetic core will saturate at your 2A peak load, the inductance will drop to near zero, and your switching MOSFET will instantly vaporize. Always choose an inductor with an I_sat rating at least 20% higher than your maximum peak current (e.g., ≥ 2.5A).
Real-World Scenario Walkthrough: The Melted Flyback Diode
To understand what happens when magnetic fields collapse, let's look at a common beginner failure mode: driving a 12V DC solenoid valve directly from a microcontroller without a flyback diode.
The Setup: A maker wires a 12V solenoid (drawing 1.5A) to the drain of an IRLZ44N N-channel MOSFET. The source goes to ground, and the gate is driven by a 5V Arduino GPIO pin. They write a simple script to pulse the valve on for 1 second, then off.
The Numbers: The solenoid coil has an inductance of roughly 50mH (0.050 H). While energized, it stores magnetic energy calculated by E = 0.5 × L × I2. That is 0.5 × 0.050 × 1.52 = 56.25 milliJoules. That is a significant amount of energy trapped in the magnetic field.
The Outcome: The Arduino pulls the MOSFET gate low. The MOSFET turns off in nanoseconds, instantly cutting the current path. The magnetic field around the solenoid collapses rapidly. According to Faraday's Law, this collapsing field induces a massive voltage spike to keep the current flowing. Because the switch is open, the voltage spikes until it finds a path. It hits 80V+, instantly exceeding the 55V drain-source breakdown voltage of the MOSFET.
What Went Wrong: The MOSFET avalanches and shorts out. The high-voltage spike travels backward through parasitic capacitance into the Arduino's GPIO pin, frying the microcontroller's ATmega328P silicon. The board is dead.
The Fix: Always place a flyback diode (like a 1N4007 or a faster 1N5819 Schottky) in reverse parallel across the solenoid coil. When the MOSFET turns off, the collapsing magnetic field pushes current through the diode in a safe, continuous loop, dissipating the 56.25 mJ as heat in the coil's internal resistance rather than as a destructive voltage spike.
Common Confusions: Magnetism vs. Static Electricity
What do people commonly confuse magnetism with? Static electricity. Both involve electromagnetic forces, but their circuit behaviors are entirely different.
| Feature | Magnetism (Electrodynamics) | Static Electricity (Electrostatics) |
|---|---|---|
| Charge State | Requires moving charges (current) | Deals with stationary charges (voltage) |
| Field Shape | Closed loops (no magnetic monopoles) | Diverging lines (starts at +, ends at -) |
| Circuit Effect | Inductance, back-EMF, motor torque | Capacitance, ESD shocks, dielectric breakdown |
| Measurement | Tesla (T) or Gauss (G) for flux density | Volts (V) for potential difference |
If you shuffle your feet on a carpet and shock a doorknob, that is static electricity (high voltage, zero continuous current). If you wrap a wire around a steel bolt, connect it to a car battery, and pick up paperclips, that is magnetism (low voltage, high continuous current). For a deeper dive into the physics of these fields, the Electronics Tutorials guide on Electromagnetism provides excellent visual breakdowns of flux lines.
FAQ: Quick Answers for the Workbench
Can a magnetic field induce a voltage in a stationary wire?
Yes, but only if the magnetic field itself is moving or changing in strength. A static magnetic field sitting over a stationary wire does nothing. The field must 'cut' across the conductor to induce a voltage, which is the exact principle behind AC generators and alternators.
Why do we use ferrite or iron cores in inductors instead of just air?
Air has a very low magnetic permeability. By wrapping your copper coil around a ferromagnetic core (like powdered iron or ferrite), you provide an easy path for the magnetic flux lines to travel. This multiplies the magnetic flux density, allowing you to achieve 100 μH of inductance with just 20 turns of wire instead of 2,000 turns. For more on how core materials affect inductor behavior, refer to the All About Circuits textbook chapter on Inductors.
Does magnetism cause voltage drop in long wire runs?
No. Voltage drop in long DC wire runs is caused by the wire's electrical resistance (Ohm's Law: V = I × R). However, in long AC wire runs, the magnetic fields generated by the alternating current create inductive reactance, which adds to the total impedance and can slightly increase the voltage drop beyond what DC resistance calculations predict.






