The connection between magnetism and electricity is the physical principle where moving electrical charges generate a magnetic field, and a changing magnetic field induces a voltage in a conductor. In a real circuit, this connection fundamentally changes how energy behaves: it introduces inductance, creates back-EMF in motors, and enables transformers to step voltages up or down. Beginners commonly confuse this dynamic relationship with static fields, mistakenly assuming that a steady DC current doesn't produce a magnetic field, or that magnetic fields only exist inside permanent magnets.

The Two-Way Street: Ampere’s and Faraday’s Laws

To use electromagnetism on the bench, you need to internalize it as a two-way street. The first direction (Ampere's Law) dictates that any current flowing through a wire generates a concentric magnetic field around it. The strength of this field is directly proportional to the current. The second direction (Faraday's Law of Induction) dictates that a changing magnetic field passing through a coil of wire will force electrons to move, inducing a voltage.

Think of it like a mechanical gear system. The electrical current is the input shaft, the magnetic field is the interlocking gear, and the induced voltage is the output shaft. If the input shaft stops turning (steady-state DC), the magnetic field remains static, and the output shaft (induced voltage) stops completely. This is why transformers only work with AC or pulsed DC; the 'gear' must be in motion to transfer energy.

Worked Numeric Example: Sizing a Burden Resistor for a Current Transformer

Let's apply Faraday's Law to a common maker task: measuring AC mains current with an ESP32-WROOM-32 using a split-core Current Transformer (CT). A CT uses the magnetic field generated by the primary AC wire to induce a proportional current in its secondary coil.

Target Hardware: SCT-013-000 (100A:50mA ratio)
Microcontroller: ESP32 (3.3V logic, 12-bit ADC, 0-3.3V input range)

The SCT-013-000 outputs a current, not a voltage. To read it with an ADC, we must convert that current to a voltage using a 'burden resistor'. Here is the exact math to size it:

  1. Find the peak secondary current: The 50mA rating is RMS. Peak current = 50mA × √2 (1.414) = 70.7mA (0.0707A).
  2. Determine target peak voltage: The ESP32 ADC reads 0 to 3.3V. Since AC swings positive and negative, we must bias the signal at 1.65V (half of 3.3V). Therefore, our maximum peak voltage swing can be 1.65V before clipping.
  3. Calculate resistance (Ohm's Law): R = V / I → 1.65V / 0.0707A = 23.3Ω.

The nearest standard E12 resistor value is 22Ω. With a 22Ω burden resistor, your peak voltage will be 1.55V. Biased at 1.65V, your AC wave will swing cleanly from 0.10V to 3.20V, maximizing the ESP32's ADC resolution without clipping. According to SparkFun's current sensing guides, failing to calculate this burden resistor properly is the #1 reason makers fry their microcontroller ADC pins when measuring mains.

Where You Meet This in Practice (and What Goes Wrong)

You don't just meet this connection in sensors; it dictates the survival of your components in almost every high-power circuit.

Inductive Kickback in Relays and Solenoids

When you de-energize a relay coil, the magnetic field collapses rapidly. Faraday's Law states that the induced voltage is proportional to the rate of change of the magnetic field ($V = -L \frac{di}{dt}$). If a 10mH relay coil carrying 50mA is switched off by a transistor in 1 microsecond, the induced voltage spike is $0.010 \times (0.050 / 0.000001) = 500V$. This 500V spike will instantly punch through the junction of your switching transistor or back-feed into your 3.3V GPIO, bricking the pin.

Bench Rule: Never drive an inductive load (relay, solenoid, DC motor) without a flyback diode. For coils under 1A, a standard 1N4007 is sufficient. For 3A contactors, step up to a 1N5408 or a fast-recovery UF4007 to clamp the spike before it damages modern, sensitive MOSFETs.

Motor Back-EMF and H-Bridge Sizing

When a DC motor spins, it acts as a generator, creating a voltage that opposes the supply voltage (Back-EMF). If you are driving a 12V motor that draws 2A at stall, but generates 10V of back-EMF at full speed, your H-bridge MOSFETs must be rated not just for the 12V supply, but for the transient spikes when you abruptly reverse polarity. Always select MOSFETs with a $V_{DS}$ rating at least 2x your nominal supply voltage (e.g., use 30V or 40V MOSFETs for a 12V system).

Decision Tree: Picking the Right Current Sensor Module

Choosing how to measure current relies entirely on which side of the magnetism-electricity connection you exploit. Use this decision matrix to select the exact module for your next build.

Measurement Scenario Exploited Principle Recommended Tech Exact Part Number
AC Mains (120V/240V) non-invasive Faraday's Law (Induction) Current Transformer (CT) SCT-013-000 (with 22Ω burden)
DC Battery (12V/48V) non-invasive Hall Effect (Lorentz Force) Hall Effect IC ACS724-30AB (Bidirectional)
Precise low-power DC (LiPo testing) Ohm's Law (Ignores magnetism) Shunt Resistor + I2C Amp INA219 Breakout Board
High-side DC switching (>50A) Hall Effect (Lorentz Force) Isolated Hall Sensor LEM DHAB s/14 (Automotive grade)
The Default Pick: Stop debating sensor topologies for standard home energy monitoring. If you are measuring AC branch circuits for an IoT dashboard, default to the SCT-013-000. It provides galvanic isolation (keeping 120V/240V away from your low-voltage logic), requires no external power for the sensor head, and costs under $5. If you are measuring DC solar or battery current, default to the INA219; the older ACS712 Hall sensors suffer from severe temperature drift and noise that will ruin your Coulomb counting accuracy.

Common Confusions Clarified

"Does DC current create a magnetic field?"

Yes, absolutely. A steady DC current creates a static magnetic field. This is how DC electromagnets and solenoid valves work. The confusion arises because a static magnetic field will not induce a voltage in a nearby coil (Faraday's Law requires change). But the magnetic field itself is very much present and exerts physical force.

"Do inductors block DC?"

No. Inductors block changes in current. Once a DC circuit reaches steady state, the magnetic field stops expanding, the induced back-EMF drops to zero, and the inductor acts like a plain piece of wire (limited only by its parasitic DC resistance). They only 'block' DC during the microsecond transient of switch-on or switch-off.

"Can I use a Current Transformer (CT) to measure DC?"

No. A CT relies on a changing magnetic field to induce a secondary current. DC produces a static field, meaning zero induced voltage on the secondary side. If you clamp a CT over a DC wire, it will read exactly 0A, and if you leave it clamped while the DC circuit is active, the core may saturate, ruining its accuracy for subsequent AC measurements.

Understanding the connection between magnetism and electricity moves you from blindly copying schematics to actively predicting circuit behavior. Whether you are calculating a burden resistor to protect an ESP32 ADC or sizing a flyback diode to save a MOSFET, the math remains the same: respect the rate of change, and the magnetic field will work for you instead of against you.