---
title: Fields from currents
heading: Every current is circled by a magnetic field
eyebrow: B5 · Lesson 4 · Fields from currents
xp: 40
---

::: hook
In 1820, Hans Christian Ørsted noticed a compass needle twitch whenever he switched on a current in a nearby wire. That twitch joined electricity and magnetism into one subject. A current makes a magnetic field that circles around it; two currents push or pull on each other through those fields; and that push between two wires was, until 2019, the very definition of the ampere.

::: play
- Two long parallel wires, seen end on, carry currents $I_1$ and $I_2$ out of the page (negative means into the page). The arrows show their combined magnetic field.
- Make the currents flow the same way. Where is the field weakest? Now make them flow opposite ways. Where is it strongest?
- The readout gives the force between the wires. When do they attract, and when do they repel?
:::
:::

```sim plot
view: flow
x: x = -3..3 cm
y: y = -2..2 cm
slider: I1 = -10..10 step 1 = 5 A
slider: I2 = -10..10 step 1 = 5 A
slider: d = 0.5..4 step 0.1 = 2 cm
dx: -I1*y/((x + d/2)^2 + y^2) - I2*y/((x - d/2)^2 + y^2)
dy: I1*(x + d/2)/((x + d/2)^2 + y^2) + I2*(x - d/2)/((x - d/2)^2 + y^2)
arrows: scaled
grid: 18
dot: -d/2, 0 | label: I₁
dot: d/2, 0 | label: I₂ | color: ch2
readout: force per meter in mN/m = 2e-7*I1*I2/(d/100)*1000
readout: field at the midpoint in µT = 2e-7*abs(I1 - I2)/(d/200)*1e6
```

::: predict
## Two parallel wires carry current in the same direction. Do they attract or repel?

- [x] Attract
- [ ] Repel
- [ ] Neither
- [ ] It depends on the size of the currents

::: reveal
They attract. Each wire sits in the other's circling field, and the force on a current in that field ($I\mathbf L \times \mathbf B$) points toward the other wire. Opposite currents repel. It's the reverse of electric charges, where likes repel. The force is weak for ordinary currents (2 × 10⁻⁷ N per meter for 1 A each, 1 m apart, which defined the ampere until 2019) but large in busbars during a short circuit, where tens of kiloamps can bend copper.
:::
:::

::: nameit
## Magnetic fields of currents

**A long straight wire.** The field circles the wire, with strength

$$B = \frac{\mu_0I}{2\pi r} \qquad \mu_0 = 4\pi \times 10^{-7}\ \text{T·m/A}$$

falling as $1/r$ (A9.42, from Ampère's law). Its direction follows the **right-hand rule**: grip the wire with your thumb along the current, and your fingers curl the way the field goes.

**The Biot–Savart law.** For any shape of wire, each small piece $d\mathbf l$ of current contributes

$$d\mathbf B = \frac{\mu_0}{4\pi}\frac{I\,d\mathbf l \times \hat{\mathbf r}}{r^2}$$

and the total is the sum over the whole wire. At the center of a circular loop of radius $R$, every piece contributes in the same direction, giving $B = \mu_0I/(2R)$.

**Force between parallel wires.** Wire 2 sits in wire 1's field, $\mu_0I_1/(2\pi d)$, so each meter of it feels

$$\frac{F}{L} = \frac{\mu_0I_1I_2}{2\pi d}$$

Currents the same way attract; opposite ways repel.

**Superposition.** Fields from several currents add as vectors. Two wires with opposite currents, like the two conductors of a power cord, make fields that nearly cancel at a distance, which is why cords with the go and return wires together make far less stray field than separated ones. Coax cables take this further: outside the shield, the field cancels completely.
:::

::: example
## What field does a wire carrying 10 A make 2 cm away?

::: solution
1. **Field of a long wire.**
   $$\begin{aligned} B &= \frac{\mu_0I}{2\pi r} \\ &= \frac{4\pi \times 10^{-7} \times 10}{2\pi \times 0.02} \\ &= 100\ \mu\text{T} \end{aligned}$$
2. **Compare with the Earth's field.** That's twice the Earth's field, so a compass near a power cable can be thrown off.

**Answer:** the wire makes 100 µT at 2 cm, twice the Earth's field.
:::
:::

::: example
## Two long parallel wires 1 m apart each carry 1 A. What force per meter acts between them?

::: solution
1. **Force per meter.**
   $$\begin{aligned} \frac{F}{L} &= \frac{\mu_0I_1I_2}{2\pi d} \\ &= 2 \times 10^{-7}\ \text{N/m} \end{aligned}$$
2. **The old ampere.** That was the ampere's definition until 2019, when it was redefined through the elementary charge.

**Answer:** a force of $2 \times 10^{-7}$ N acts on each meter of wire.
:::
:::

::: check
given: I = 1..20 int; r = 1 | 2 | 5 | 10
answer: 2e-7*I/(r/100)*1e6
unit: µT
tolerance: 0.5%

## How strong is the field {r} cm from a long wire carrying {I} A, in µT?

::: right
Right. $\mu_0I/(2\pi r)$ = {answer}.
:::

::: misses
- [2e-7*I/r*1e6] Convert centimeters to meters.
- [4e-7*pi*I/(r/100)*1e6] Divide by $2\pi$: $B = \mu_0I/(2\pi r)$.
- [any] Not yet. $B = \mu_0I/(2\pi r)$.
:::
:::

::: check
given: I1 = 1..10 int; I2 = 1..10 int; d = 1 | 2 | 5
answer: 2e-7*I1*I2/(d/100)*1000
unit: mN/m
tolerance: 0.5%

## Two parallel wires {d} cm apart carry {I1} A and {I2} A. What force per meter acts between them, in mN/m?

::: right
Right. $\mu_0I_1I_2/(2\pi d)$ = {answer}.
:::

::: misses
- [2e-7*I1*I2/d*1000] Convert centimeters to meters.
- [2e-7*I1*I2/(d/100)^2*1000] It goes as $1/d$, not $1/d^2$.
- [any] Not yet. $F/L = \mu_0I_1I_2/(2\pi d)$.
:::
:::

::: check
given: I = 1..10 int; R = 1 | 2 | 5
answer: 4*pi*1e-7*I/(2*R/100)*1e6
unit: µT
tolerance: 0.5%

## What is the field at the center of a circular loop of radius {R} cm carrying {I} A?

::: right
Right. $\mu_0I/(2R)$ = {answer}.
:::

::: misses
- [4*pi*1e-7*I/(2*pi*R/100)*1e6] That's the straight-wire formula. At a loop's center every piece adds: $\mu_0I/(2R)$.
- [4*pi*1e-7*I/(2*R)*1e6] Convert centimeters to meters.
- [any] Not yet. $B = \mu_0I/(2R)$.
:::
:::

::: check
given: I = 1..10 int; d = 1 | 2
answer: 2*2e-7*I/(d/200)*1e6
unit: µT
tolerance: 0.5%

## Two wires {d} cm apart carry {I} A in opposite directions. How strong is the field exactly midway between them?

::: right
Right. Midway, both fields point the same way, each $\mu_0I/(2\pi \cdot d/2)$: together {answer}.
:::

::: misses
- [0] Opposite currents make fields that add between the wires and cancel only far away.
- [2e-7*I/(d/200)*1e6] Count both wires.
- [any] Not yet. Find each wire's field at $d/2$, then add.
:::
:::

::: check
kind: choice

## Current flows north along a wire. Directly above the wire, which way does its field point?

- [ ] North
- [ ] Up
- [x] West
- [ ] East

::: right
Right. Thumb north, fingers curl over the top of the wire toward the west.
:::

::: misses
- [1] The field circles the wire; it's never along it.
- [2] It circles the wire, so above the wire it's horizontal.
- [4] Check the right-hand rule: above a north-flowing current, the field points west.
:::
:::

::: check
kind: parts
given: I = 1 | 10 | 100; r = 1 | 5 | 20; R = 2 | 5 | 10

## A long straight wire and, separately, a single circular loop each carry {I} A.

::: part
answer: 4*pi*1e-7*I/(2*pi*r*1e-2)*1e6
unit: µT
tolerance: 0.5%

### What field does the straight wire make {r} cm away?

::: misses
- [4*pi*1e-7*I/(2*r*1e-2)*1e6] That's the loop's formula. A straight wire gives $\mu_0I/(2\pi r)$.
- [any] Not yet. $B = \mu_0I/(2\pi r)$.
:::
:::

::: part
answer: 4*pi*1e-7*I/(2*R*1e-2)*1e6
unit: µT
tolerance: 0.5%

### What field does the loop make at its center, if its radius is {R} cm?

::: misses
- [4*pi*1e-7*I/(2*pi*R*1e-2)*1e6] That's the straight wire's formula. A loop's center field is $\mu_0I/(2R)$.
- [any] Not yet. $B = \mu_0I/(2R)$.
:::
:::

::: right
Right. A loop concentrates its field at the center: π times stronger than a straight wire at the same distance.
:::
:::

::: explain
## Why do two wires carrying current in the same direction attract each other?

::: model
Each wire makes a magnetic field that circles it, and the other wire sits in that field. The force on a current in a field is $I\mathbf L \times \mathbf B$. With both currents in the same direction, working out the cross product shows the force on each wire points toward the other. With opposite currents the force reverses, so they repel. It's a magnetic interaction between moving charges, which is why it behaves differently from the attraction between opposite electric charges.
:::
:::

::: practice

::: check
given: I = 5..50 step 5; r = 0.1 | 1 | 10
answer: 2e-7*I/r*1e6
unit: µT
tolerance: 0.5%

## What is the field {r} m from a wire carrying {I} A, in µT?

::: misses
- [any] $B = \mu_0I/(2\pi r)$.
:::
:::

::: check
kind: choice

## Two parallel wires carry current in opposite directions. What do they do?

- [ ] Attract
- [x] Repel
- [ ] Twist around each other
- [ ] Nothing

::: right
Right. Opposite currents repel.
:::

::: misses
- [1] Same-direction currents attract; opposite ones repel.
- [3] The force is straight toward or away.
- [4] There's a force whenever both carry current.
:::
:::

::: check
given: k = 2 | 3 | 4
answer: 1/k
tolerance: 0.5%

## You move {k} times farther from a long wire. By what factor does its field change?

::: misses
- [1/k^2] A long wire's field falls as $1/r$.
- [any] $B \propto 1/r$.
:::
:::
:::
