# Alignment of a compass needle

From what I know, the compass needle aligns itself with the earth's magnetic field since Earth's geographic north pole(magnetic south) attracts the compass needle's north pole. However, when a compass is placed near a current carrying wire, how does it aligns itself in the direction of the wire's magnetic field even though there is no north or south pole to attract the tips of the compass needle?

You shouldn't think about it as being attracted towards one of the poles, but rather the needle aligns itself with the magnetic field lines. A magnet generates field lines that look like the following:

The field lines from the magnet extend throughout all space, which is how we are able to detect them on the surface of the earth. What your compass needle is doing is aligning itself with the arrows in the diagram above, which tells you in what direction the field points at that location, which also implies in what direction the south pole of the magnet is.

Magnetic fields are also generated by current carrying wires. To understand why moving charges (currents) create a magnetic field, see this answer: How do moving charges produce magnetic fields?. Up close, these fields can be stronger than that of the earth, and therefore the needle will align it self with the net field near the wire.

• Why does a compass needle align itself along a magnetic field if it is not for the north-south pole attraction? – xasthor Nov 18 '15 at 14:19
• @xasthor The compass needle itself is actually a small magnet, and the lowest energy state will be when the fields of the two magnets (one being the earth or the wire) are aligned. North-South pole attraction is a generalization of this concept, as if you thought about bringing another magnet into the picture I have above, the fields would be in alignment when the south pole and north pole are facing each other. – tmwilson26 Nov 18 '15 at 15:05
• "the lowest energy state will be when the fields of the two magnets (one being the earth or the wire) are aligned." That pretty much clears it up for me. Is there any reason for this or is it just one of the facts about nature that we just have to accept? – xasthor Nov 18 '15 at 15:09
• @xasthor This article may explain it well: physicspages.com/2013/07/24/…. It basically comes down to work that is done on a dipole when aligning it with the field. You add energy when aligning anti-parallel and remove energy when aligning parallel, with parallel being the lowest energy state. – tmwilson26 Nov 18 '15 at 15:13
• Thanks a lot for the help! This has cleared a question that has been on my mind for quite a while :D – xasthor Nov 18 '15 at 15:15

This is a property of a magnet: A force that pulls on other ferromagnetic materials, such as iron and attracts or repels other magnets. A permanent magnet is an object made from a material that is magnetized and creates its own persistent magnetic field.