Magnetic field created by a current and Laplace’s force
Magnetic field created by an electric current
Magnetic field around a straight wire
When an electric current of intensity I flows through a straight wire, it creates a magnetic field around it. The field lines are circles centred on the wire, lying in planes perpendicular to it. The direction of the field is determined by the right-hand rule: the thumb points in the direction of the current, whilst the curled fingers point in the direction of the field lines.
The magnitude of the magnetic field B (in tesla), at a distance d (in metres) from an infinite straight wire carrying a current I (in amperes), is given by:
B = μ₀ * I / (2π * d)
where μ₀ = 4π × 10⁻⁷ T·m/A is the magnetic permeability of free space.
Magnetic field of a coil
A coil (or solenoid) is a wire wound into numerous turns. Inside a long coil, the magnetic field is almost uniform and aligned along the axis of the coil. Its value depends on the number of turns N, the length L of the coil and the current I:
B = μ₀ * N * I / L
The greater the number of turns per unit length (N/L) or the current I, the stronger the field. Adding a soft-iron core to the coil significantly strengthens the resulting field.
Common pitfall
Be careful with the units: d and L must be expressed in metres and I in amperes. Forgetting to convert centimetres to metres is a very common mistake that distorts the result by a factor of 100.

