The relationship between magnetism and electricity is the physical principle where a moving electric charge generates a magnetic field, and a changing magnetic field induces an electric current in a conductor. This isn't just abstract textbook theory; it fundamentally changes how real circuits behave by introducing inductance, causing massive voltage spikes when switching inductive loads, and dictating the physical operation of every transformer and motor on your bench.
The Core Mechanism: Moving Charges and Changing Fields
When current flows through a wire, it creates a magnetic field around that wire. Conversely, if you move a magnet near a wire, or change the strength of a magnetic field passing through a coil, it forces electrons to move, creating a voltage. This two-way street is governed by Ampere's Law and Faraday's Law of Induction. For a deeper mathematical breakdown of these field interactions, the MIT OpenCourseWare Physics II curriculum provides excellent foundational lectures.
In a real circuit or installation, this relationship changes everything about how we manage energy. It means that a simple piece of wire isn't just a resistor; it's also an inductor. When you try to change the current flowing through an inductor, the collapsing or expanding magnetic field fights that change. This is what causes inductive kickback (back-EMF) when you open a switch on a motor or relay circuit. According to Electronics Tutorials, this self-inductance is the primary reason we need snubber circuits and flyback diodes in DC power electronics.
The Math on the Bench: Calculating Back-EMF
Let's put actual numbers to this phenomenon. The voltage spike generated by a collapsing magnetic field is calculated using the formula:
V = L × (di / dt)
Where V is the induced voltage, L is the inductance in Henrys, di is the change in current, and dt is the time it takes for that change to happen.
Bench Example: You are switching a 12V automotive relay using a logic-level MOSFET. The relay coil has an inductance (L) of 50 mH (0.05 H). It draws a steady-state current of 100 mA (0.1 A). When the MOSFET turns off, it interrupts the current in roughly 1 microsecond (0.000001 seconds).
Let's run the math:
- V = 0.05 H × (0.1 A / 0.000001 s)
- V = 0.05 × 100,000
- V = 5,000 Volts
Even though you are only working with a 12V battery, the collapsing magnetic field generates a 5,000V spike. If your MOSFET is only rated for 60V drain-to-source breakdown, it will avalanche and fail instantly. This is why a flyback diode is non-negotiable; it provides a safe path for the induced current to circulate until the magnetic field dissipates.
Where You Meet This in Practice
You interact with the relationship between magnetism and electricity every time you power up a project. Here is where it physically manifests on the jobsite or workbench:
- Transformers: AC current in the primary winding creates a constantly changing magnetic field in the iron core, which induces a proportional voltage in the secondary winding. This is how we step down 120V mains to 12V for LED drivers.
- Electric Motors: Current through the stator windings creates a magnetic field that pushes against the rotor's permanent magnets (or induced fields), converting electrical energy into mechanical torque.
- EMI and RFI Filtering: High-frequency noise on a power line is blocked by ferrite beads and common-mode chokes. The changing noise current creates a magnetic field in the ferrite that opposes the noise, effectively choking it out while letting clean DC pass.
- Inductive Proximity Sensors: These sensors generate a high-frequency magnetic field. When a metal target enters the field, it induces eddy currents in the metal, which draws energy from the sensor's oscillator circuit, triggering the output transistor.
Scenario Walkthrough: The Fried Microcontroller
To see what happens when we ignore this relationship, let's look at a common DIY disaster involving a 12V DC diaphragm water pump.
The Setup: A maker is building an automated irrigation system. They use an ESP32 DevKit V1 to drive the gate of an IRLZ44N N-channel MOSFET. The MOSFET switches the ground path for a 12V, 2A Shurflo-style diaphragm pump. They wire the 12V supply, the pump, and the MOSFET drain, but they skip the flyback diode to save space on the perfboard.
The Numbers: The pump motor has an internal inductance of roughly 20 mH (0.02 H) and draws 2A under load. The IRLZ44N is a fast-switching MOSFET, turning off in about 500 nanoseconds (0.0000005 s).
The Outcome: When the ESP32 pulls the gate low, the MOSFET shuts off. The pump's magnetic field collapses. Using our formula: V = 0.02 × (2 / 0.0000005) = 80,000V. The MOSFET's internal avalanche diode clamps this at around 55V, but the massive dV/dt (rate of voltage change) couples capacitively back into the gate and the shared 5V USB power rail. The ESP32's onboard AMS1117 3.3V voltage regulator instantly overheats and shorts, permanently bricking the microcontroller.
What Went Wrong: The maker treated the pump as a simple resistive load. Because of the relationship between magnetism and electricity, the pump is an inductor. The collapsing magnetic field had nowhere to go, so it forced its energy backward through the circuit. The Fix: Always place a Schottky diode (like an SS34) or a standard rectifier (1N4007) in reverse bias directly across the inductive load's terminals. This gives the collapsing field a localized loop to dissipate its energy safely.
Think of it like the water hammer effect in plumbing. If water (current) is flowing heavily through a pipe and you slam a valve shut instantly, the momentum of the water creates a massive pressure spike that can burst the pipes. The flyback diode acts like a pressure relief valve, absorbing the shock.
Common Confusions and Troubleshooting
When diagnosing circuits involving magnetic fields, hobbyists frequently trip over a few specific misconceptions.
Does a static magnetic field induce a current?
No. This is the most common confusion. A magnet sitting perfectly still next to a coil will induce exactly zero voltage. Faraday's Law dictates that the magnetic flux must be changing over time, or there must be relative physical motion between the conductor and the field. This is why transformers only work with AC (constantly changing current) and fail if you apply steady DC.
What is the difference between Magnetic Flux and Magnetic Field Strength?
People often use these interchangeably, but they are distinct. Magnetic Field Strength (measured in Tesla or Gauss) is the intensity of the field at a specific point. Magnetic Flux (measured in Webers) is the total amount of field passing through a given area. For inducing voltage in a coil, it is the rate of change of the total flux that matters, which is why adding an iron core (which concentrates and increases total flux) dramatically increases a transformer's efficiency.
Why does my multimeter read continuity across an inductor but it sparks when disconnected?
A multimeter measures DC resistance, which for a relay coil or motor winding might be very low (e.g., 5 ohms). However, inductance is an AC property. As Fluke's electrical troubleshooting guides note, an inductor's opposition to current change (reactance) only reveals itself when the current is fluctuating or interrupted. The spark you see when disconnecting a live inductive load is the physical manifestation of that collapsing magnetic field ionizing the air gap to keep current flowing.






