In this lesson's two-orientation comparison, placing the straight wire parallel above the needle (North–South) produces an orthogonal East–West field B_I, giving deflection angle tan θ = B_I / B_E.
Magnetic Field of an Electric Current
Electric currents create magnetic fields whose direction follows Ampère's right-hand rule and whose field lines have no endpoints. Field strength obeys B = μ₀|I|/(2πr) near a straight wire, B₀ = μ₀N|I|/(2R) at a loop center, and B = μ₀n|I| inside a long solenoid. Test Oersted's compass deflection, iron filings, and solenoid probes below.
Interactive 3D Lab Preview
Runs right on this page in fullscreen · No account required
- Use the two-orientation comparison to explain why a straight wire aligned North–South directly above a resting compass needle produces a clear deflection. Contrast this with an East–West wire, which creates a collinear field and no deflection when weaker than the horizontal geomagnetic reference.
- Switch accurately between the two forms of Ampère's right-hand rule (thumb along current for a straight wire vs. curled fingers along current for a loop or solenoid) and trace continuous return field lines running S→N inside a solenoid and N→S outside.
- Apply vector superposition and component addition to 2D cross-sections of perpendicular dot (⊙) and cross (⊗) current-carrying wires to compute the net magnetic flux density B at symmetric points and predict a compass needle's N-pole direction.
Press Esc or your browser Back button anytime to return to the guide.
Magnetic Field of an Electric Current
Use the two-orientation comparison to explain why a straight wire aligned North–South directly above a resting compass needle produces a clear deflection. Contrast this with an East–West wire, which creates a collinear field and no deflection when weaker than the horizontal geomagnetic reference.
Switch accurately between the two forms of Ampère's right-hand rule (thumb along current for a straight wire vs. curled fingers along current for a loop or solenoid) and trace continuous return field lines running S→N inside a solenoid and N→S outside.
Apply vector superposition and component addition to 2D cross-sections of perpendicular dot (⊙) and cross (⊗) current-carrying wires to compute the net magnetic flux density B at symmetric points and predict a compass needle's N-pole direction.
In 1820, Oersted discovered during a lecture that an electric current deflects a compass needle, then tested the effect systematically by placing a wire parallel above a resting needle. In this lesson's East–West vs. North–South comparison, why is deflection far easier to observe when the wire runs North–South?
In 1820, Hans Christian Ørsted first observed a current deflecting a magnetic needle during a lecture in Copenhagen, then confirmed it in his paper Experimenta by holding a wire parallel above a resting compass. Left undisturbed, the needle aligns with Earth's local magnetic meridian (roughly North–South; total field near the surface is about 50 μT, and this lesson sets the horizontal geomagnetic reference to 50 μT as a lesson setting). In this bench's two-orientation comparison, placing the wire East–West directly above the needle creates a North–South current field collinear with the horizontal geomagnetic reference: when aligned, it only pulls the needle tighter without turning it, and when opposite yet weaker than the reference, it still produces no deflection (it flips 180° only if opposite and stronger than the horizontal geomagnetic field). Aligning the wire North–South parallel to the needle creates an orthogonal East–West magnetic field (lesson settings: 20.0 μT at 2.0 A, r = 2.0 cm on the straight-wire station; about 27.3 μT at 3.0 A, h = 2.2 cm on the Oersted station), which combines perpendicularly with 50 μT to swing the needle by a clear 28.6°.
Cause-and-Effect Chain
For a straight wire, point the right thumb along current and curl fingers along B. For a loop or solenoid, curl the right fingers along current so the thumb points along the internal axial field.
Magnetic flux density B is a vector (unit: tesla, T; 1 T = 10⁶ μT). Find each component direction with the right-hand rule first, then combine vectors by the parallelogram rule (or signed algebraic sums along a shared axis).
Core Formulas & Quantitative Relations
Always use your right hand. When holding a pen in your right hand during class or problem solving, it is easy to raise your free left hand out of habit, which reverses every direction.
Here B denotes magnitude using |I| (from the Biot–Savart law and Ampère's law), with direction given by the right-hand rule. In air or vacuum, we use μ₀ = 4π × 10⁻⁷ T·m/A (NIST CODATA 2022 value: 1.256 637 061 27 × 10⁻⁶ N/A²). Parallel wires attract when currents flow in the same direction and repel when currents flow in opposite directions.
A small compass needle placed inside the center of a solenoid aligns its N pole with the local field direction—pointing toward the solenoid's N pole, not toward its S pole.
From 3D Field Lines to 2D Diagrams: Zero-Field Quadrants of Perpendicular Wires
2D electromagnetism problems frequently show two perpendicular or parallel wires with dot (⊙) and cross (⊗) symbols and ask which quadrants can have net magnetic field equal to 0:
- Step ① (Mark each wire's half-planes separately): for an upward vertical current I₁, the field points out of the page (⊙) to the left and into the page (⊗) to the right. For a rightward horizontal current I₂, the field points out of the page (⊙) above and into the page (⊗) below.
- Step ② (Add same-direction components and subtract opposite ones): in Quadrant I (⊗ + ⊙) and Quadrant III (⊙ + ⊗), the two fields oppose and can cancel. When I₁ = I₂, the zero-field line lies right along the angle bisector (if currents differ, it shifts toward the weaker current). In Quadrant II (⊙ + ⊙) and Quadrant IV (⊗ + ⊗), the fields reinforce.
Concept Breakdown
Electrostatic field lines start and end on charges, whereas magnetic field lines have no endpoints (the return lines drawn here connect inside and outside).
Magnetic field lines look much like electric field lines—what is the fundamental difference?
Electrostatic field lines begin on positive charges and terminate on negative charges. Because no magnetic monopole has ever been observed, magnetic fields are divergence-free (∇·B = 0), so magnetic field lines have neither starting points nor endpoints. For a bar magnet or a finite solenoid, aside from the central symmetry axis extending to infinity at both ends, every return field line drawn in this lesson runs from the N pole back to the S pole outside and continues from S to N inside to form a continuous loop. That is why a compass placed at the center inside a solenoid points its N pole along the internal field (S→N) toward the solenoid's N pole, whereas a compass in the side return region outside points along the external return line (N→S) toward the S pole.
The first current creates a magnetic field at the second wire's location, which then exerts a magnetic force on the second current.
Why do two parallel wires attract with same-direction currents and repel with opposite currents?
A magnetic field is a real physical field that mediates magnetic forces (only the field lines are geometric visual aids). Picture two vertical parallel wires carrying upward currents I₁ (left) and I₂ (right). By Ampère's right-hand rule, left wire I₁ produces a magnetic field pointing into the page (⊗) at wire I₂. Applying the magnetic-force hand rule to upward current I₂ in an into-the-page field gives a force pointing left—toward wire I₁. Same-direction parallel currents therefore attract; reversing one current reverses the force, causing the wires to repel.
Modern physics explains magnetization and demagnetization through ferromagnetic domains growing and aligning, while Ampère's molecular current hypothesis serves as a historical equivalent-loop model.
Why does an iron nail become magnetized near a magnet, and why does heating above its Curie temperature or striking it without an external field weaken its magnetism?
In the 19th century, Ampère proposed the molecular current hypothesis, modeling magnets as collections of tiny circulating currents to unify permanent magnets and electromagnets before electrons and spin were discovered (the circulating loops in this bench's 3D viewer are an illustrative equivalent model). In modern physics (OpenStax Physics §20.1, Figs. 20.7–20.8), ferromagnetic materials such as iron, cobalt, and nickel contain microscopic regions called magnetic domains where atomic magnetic moments align spontaneously. In unmagnetized soft iron, domain orientations point randomly and cancel. In an external magnetic field, domains aligned with the field grow and rotate into alignment, producing strong net magnetism. Conversely, heating a ferromagnet with no external field above its Curie temperature (for elemental iron, 1043 K, about 770 °C; OpenStax §20.1 & USGS Bulletin 2131; alloy magnets vary with composition) uses thermal agitation to randomize domain order. Striking a magnet sharply with no external field weakens magnetism via mechanical disturbance (whereas tapping it inside an external field actually helps domains align, Fig. 20.7)—heating and mechanical shock are distinct demagnetization mechanisms.
Reference & Comparison Table
| Current Source | Right-Hand Rule Grip | 3D Field-Line Geometry | Interior / Center Field Features | Benchmark Probe Readings (Lesson Setting) |
|---|---|---|---|---|
| Long straight wire | Thumb along current I; curled fingers along B | Concentric circles in planes perpendicular to the wire | Denser closer to the wire (B ∝ |I|/r) | 20.0 μT at r = 2.0 cm (0.40× Earth); 10.0 μT at r = 4.0 cm (0.20× Earth) |
| Circular current loop (R = 5.0 cm) | Curled fingers along loop current; thumb along axial B | Return loops wrapping the wire plus the central axis | Perpendicular to loop plane and strongest at center (B ∝ N·|I|) | Center: 25.1 μT (1 turn), 50.3 μT (2 turns), 251 μT (10 turns); 1 turn at z = 5.0 cm: 8.89 μT |
| Closely wound solenoid (L = 12.0 cm, 400 turns) | Curled fingers along coil current; thumb along internal B (N pole) | Bar-magnet-like return loops plus central symmetry axis | Nearly uniform inside (S→N); drops to roughly half at the ends | Interior center z = 0: 8128 μT (163× Earth); end face z = 6.0 cm: 4156 μT (0.51× center) |
Common Misconceptions
In the East–West vs. North–South comparison, should I place the straight wire East–West above the compass needle to see a clearer deflection?
No. When the bench's current field (27.3 μT, lesson setting) is weaker than the horizontal geomagnetic reference (50 μT, lesson setting), an East–West wire creates a North–South field collinear with Earth's field, leaving the needle undeflected. Aligning the wire North–South parallel to the resting needle generates an orthogonal East–West field that yields a clear 28.6° deflection. Test both orientations in Step 1 of the 3D bench.
Do magnetic field lines run from the N pole to the S pole both outside and inside a solenoid?
Only outside. External return lines run from N to S, but inside a solenoid or bar magnet the field lines continue from the S pole back to the N pole so the loops have no endpoints. A compass needle placed inside the solenoid therefore points its N pole toward the solenoid's N pole. Verify this directly by dragging needles inside and alongside the solenoid in Step 8.
If a diagram leaves blank space between magnetic field lines, does that mean there is no magnetic field there?
No. A magnetic field is a real, measurable physical field that exists continuously everywhere in space—even in the gaps between drawn lines. Only the field lines themselves are visual aids drawn at representative spacing to show direction and relative strength. Drag the 3D probe continuously across the acrylic (plexiglass) boards in Steps 2–7 to see smooth, nonzero readings everywhere.
Embed this simulation
Sources, Revision & Feedback
- H. C. Ørsted (1820) — Experiments on the Effect of a Current of Electricity on the Magnetic Needle (Tekstnet English Translation) ↗
- OpenStax — Physics §20.1: Magnetic Fields, Field Lines, and Force ↗
- OpenStax — College Physics 2e §22.3: Magnetic Fields and Magnetic Field Lines ↗
- OpenStax — College Physics 2e §22.9: Magnetic Fields Produced by Currents (Ampere's Law) ↗
- OpenStax — University Physics Vol. 2 §12.4: Magnetic Field of a Current Loop ↗
- OpenStax — University Physics Vol. 2 §12.6: Solenoids and Toroids ↗
- NIST CODATA 2022 — Vacuum Magnetic Permeability μ₀ ↗
- USGS Bulletin 2131 — Thermodynamic Properties of Minerals and Related Substances (Elemental Iron Curie Temperature Reference) ↗