If you need to know the magnetic flux density generated by a straight, current-carrying wire, the direct answer is Ampere’s Law. To calculate the electromagnetic field (specifically the magnetic field, B) at a specific radial distance from a long straight conductor, use the formula: B = (μ0 × I) / (2πr). At 10 mm away from a standard 10 AWG wire carrying 30A, the field strength is approximately 600 microteslas (μT) — enough to severely disrupt an unshielded Hall-effect sensor.
Understanding this calculation is not just an academic exercise. On the bench, it dictates your PCB trace routing, your sensor placement, and your EMI shielding requirements. Below is the complete derivation, symbol mapping, and real-world troubleshooting framework for calculating magnetic fields in practical electrical systems.
The Core Equation and Symbol Definitions
The magnetic field surrounding an infinitely long, straight conductor in a vacuum (or air, which is functionally identical for this purpose) is derived from the Biot-Savart Law and simplified via Ampere’s Circuital Law. The working formula for bench and jobsite calculations is:
B = (μ0 × I) / (2πr)
| Symbol | Parameter | Standard SI Unit | Practical Bench Unit | Notes / Constants |
|---|---|---|---|---|
| B | Magnetic Flux Density | Tesla (T) | Microtesla (μT) or Gauss (G) | 1 T = 10,000 G. Often colloquially called "magnetic field strength". |
| μ0 | Vacuum Permeability | T·m/A or H/m | 4π × 10⁻⁷ T·m/A | Since the 2019 SI redefinition, μ0 is empirically measured (~1.256637 × 10⁻⁶), but 4π × 10⁻⁷ remains the engineering standard. |
| I | Current | Amperes (A) | Amperes (A) | Use RMS current for AC calculations; use peak or steady DC for transient analysis. |
| r | Radial Distance | Meters (m) | Millimeters (mm) | Distance from the exact center of the conductor to the measurement point. |
| π | Pi | Dimensionless | ~3.14159 | Geometric constant representing the circular integration path. |
Rearranged Forms for Design Work
When designing a system, you rarely solve for B directly. You usually know your allowable interference limit (B) and need to find the required clearance (r) or maximum allowable current (I).
- Solving for Current (I): I = (B × 2πr) / μ0
- Solving for Distance (r): r = (μ0 × I) / (2πB)
- Solving for Permeability (μ0): μ0 = (B × 2πr) / I (Useful when calibrating sensors in unknown dielectric/ferromagnetic environments)
Assumptions, Limits, and Unit Traps
When This Formula Applies
This specific formulation assumes three critical conditions:
- The wire is infinitely long and straight. In practice, if your measurement distance (r) is less than 1/10th of the wire's total length, the error from ignoring the "end effects" is negligible (under 1%).
- The surrounding medium is non-magnetic. Air, FR4 fiberglass, and standard plastics have a relative permeability (μr) of ~1.0. If you route a wire through a steel chassis or near an iron core, you must multiply μ0 by the material's μr, which can amplify the field by 100x to 5000x.
- The frequency is low or DC. At high frequencies (RF), skin effect alters the current distribution across the wire's cross-section, and electromagnetic wave propagation (radiation) takes over from simple magnetic induction.
Unit Mistakes That Break the Math
The most common reason a calculation yields a physically impossible number is a unit mismatch in the denominator. You must convert radial distance to meters before plugging it into the formula. If you measure r as 15 mm and plug "15" into the equation instead of "0.015", your calculated magnetic field will be exactly 1,000 times too weak.
Secondly, component datasheets (like those for Allegro Hall-effect sensors) often specify external field rejection in Gauss (G) or millitesla (mT). Remember the hard conversion: 1 Tesla = 10,000 Gauss. A stray field of 500 μT is 5 Gauss — enough to offset a highly sensitive unshielded sensor.
Solved Problems with Strict Unit Tracking
Problem 1: Stray Field from a High-Current Busbar
Scenario: You have a copper busbar carrying a steady 120A DC load in a solar inverter. You need to route a sensitive 3.3V I2C communication cable parallel to the busbar at a distance of 40 mm. What is the magnetic flux density at the cable?
Step 1: Identify and convert variables.
- I = 120 A
- r = 40 mm = 0.040 m
- μ0 = 4π × 10⁻⁷ T·m/A (approx 1.2566 × 10⁻⁶ T·m/A)
Step 2: Substitute and track units.
- B = (1.2566 × 10⁻⁶ [T·m/A] × 120 [A]) / (2π × 0.040 [m])
- Notice the Amperes (A) cancel out in the numerator and denominator.
- B = (1.5079 × 10⁻⁴ [T·m]) / (0.2513 [m])
- Notice the meters (m) cancel out, leaving only Tesla (T).
- B = 6.0 × 10⁻⁴ T
Step 3: Convert to practical units.
- B = 600 μT (or 6.0 Gauss)
Outcome: 600 μT is a strong localized field. While it won't induce a destructive voltage in a static I2C cable, if the 120A load is chopped via PWM (like a motor drive), this changing field will induce noise. Keep digital traces further away or use twisted-pair cabling.
Problem 2: Finding the Safe Clearance Distance
Scenario: Your PCB features a magnetometer (compass IC) that saturates and clips its readings at any external field exceeding 50 μT. You have a 5V logic trace on the board that occasionally sources 500 mA (0.5 A). How far away must you place the magnetometer?
Step 1: Rearrange formula to solve for r.
- r = (μ0 × I) / (2πB)
Step 2: Substitute variables.
- B = 50 μT = 50 × 10⁻⁶ T
- I = 0.5 A
- r = (4π × 10⁻⁷ × 0.5) / (2π × 50 × 10⁻⁶)
Step 3: Cancel and solve.
- The 2π in the denominator cancels with half of the 4π in the numerator, leaving 2.
- r = (2 × 10⁻⁷ × 0.5) / (50 × 10⁻⁶)
- r = (1 × 10⁻⁷) / (5 × 10⁻⁵)
- r = 0.002 meters
Outcome: r = 2.0 mm. You must maintain at least a 2 mm keep-out zone between the 500mA trace and the magnetometer IC to prevent saturation.
Real-World Walkthrough: The Hall Sensor Offset Disaster
Formulas on paper are clean; the workbench is not. Here is a scenario that demonstrates what happens when you ignore the 1/r decay rate of electromagnetic fields in a high-power design.
The Setup
A maker was building a custom 48V, 40A BLDC motor controller for an autonomous rover. To measure the phase current, they used an Allegro ACS724 Hall-effect current sensor. The ACS724 uses differential Hall sensing to reject uniform external magnetic fields (like the Earth's magnetic field). The DC+ main power busbar was a 1/4-inch copper bar carrying 40A peak. To save board space, the maker placed the ACS724 IC exactly 12 mm (0.012 m) away from the center of the DC+ busbar.
The Numbers
Let's calculate the stray magnetic field hitting the sensor from the busbar using our core formula:
- B = (4π × 10⁻⁷ × 40) / (2π × 0.012)
- B = (1.6 × 10⁻⁵) / (0.0753)
- B = 666 μT (or 6.66 Gauss)
The Outcome
During bench testing with no load, the sensor read 0A perfectly. But when the rover was driving and pulling heavy current, the sensor reported a phantom 15A offset, frequently tripping the microcontroller's software overcurrent protection and shutting down the rover mid-turn.
What Went Wrong
The maker assumed the ACS724's "common-mode field rejection" spec would protect it. However, common-mode rejection only works if the external magnetic field is uniform across the two internal Hall elements. Because the sensor was only 12 mm from a concentrated 40A source, the magnetic field gradient was incredibly steep. The field hitting the left side of the silicon die was significantly stronger than the field hitting the right side. The differential amplifier couldn't cancel the gradient, resulting in a massive offset voltage. The fix: Moving the sensor just 40 mm away dropped the stray field to ~200 μT, flattening the gradient enough for the IC's internal rejection circuitry to handle it.
Realistic Magnitudes: What Should Your Numbers Look Like?
When you calculate B, it is easy to get lost in scientific notation. To build intuition, you need a mental benchmark of what these numbers actually mean in the physical world. If your calculation yields 50 Tesla, you made a math error — that is the realm of destructive laboratory electromagnets. If it yields 0.0000001 Tesla, you are looking at logic-level PCB traces.
| Source / Scenario | Field Strength (Tesla) | Field Strength (μT / Gauss) | Practical Impact |
|---|---|---|---|
| Earth's Magnetic Field | 25 to 65 μT | 25 - 65 μT (0.25 - 0.65 G) | Baseline noise floor for unshielded magnetometers. |
| 10 AWG Wire @ 10A (at 10mm) | 200 μT | 200 μT (2.0 G) | Safe for most digital logic; may affect unshielded analog audio. |
| Fridge Magnet | 5,000 μT | 5,000 μT (50 G) | Will instantly saturate standard Hall sensors and erase magnetic stripes. |
| Welding Cable @ 200A (at 20mm) | 2,000 μT | 2,000 μT (20 G) | Requires twisted-pair shielding for adjacent control wiring. |
| Neodymium Magnet (N52 surface) | 1.0 to 1.4 T | 1,000,000+ μT (10,000+ G) | Will physically rip ferrous tools from your hands; destroys CRTs and pacemakers. |
| MRI Machine (Clinical 3T) | 3.0 T | 3,000,000 μT | Strictly controlled environment; turns loose wrenches into lethal projectiles. |
By anchoring your calculations to these physical realities, you can immediately spot decimal errors and design robust, noise-free electrical systems. Always respect the 1/r relationship: doubling your distance from a noisy busbar doesn't cut the interference in half; it cuts the magnetic field density exactly in half, but moving it 10x away drops the field by a factor of 10, often pulling it safely below the noise floor of your sensitive analog components.






