The basic idea behind an electromagnet is extremely simple: By running electric current through a wire, you can create a magnetic field.
By using this simple principle, you can create all sorts of things, including motors, solenoids, read/write heads for hard disks and tape drives, speakers, and so on. In this edition of HowStuffWorks, you will learn exactly how electromagnets work. You will also have the chance to try several experiments with an electromagnet that you create yourself!
A Regular Magnet
Before talking about electromagnets, let's talk about normal "permanent" magnets like the ones you have on your refrigerator and that you probably played with as a kid.
You likely know that all magnets have two ends, usually marked "north" and "south," and that magnets attract things made of steel or iron. And you probably know the fundamental law of all magnets: Opposites attract and likes repel. So, if you have two bar magnets with their ends marked "north" and "south," the north end of one magnet will attract the south end of the other. On the other hand, the north end of one magnet will repel the north end of the other (and similarly, south will repel south).
An electromagnet is the same way, except it is "temporary" -- the magnetic field only exists when electric current is flowing.
An electromagnet starts with a battery (or some other
source of power) and a wire. What a battery produces is electrons.
If you look at a battery, say at a normal D-cell from a flashlight, you can see that there are two ends, one marked plus (+) and the other marked minus (-). Electrons collect at the negative end of the battery, and, if you let them, they will gladly flow to the positive end. The way you "let them" flow is with a wire. If you attach a wire directly between the positive and negative terminals of a D-cell, three things will happen:
Electrons will flow from the negative side of the battery to the positive side as fast as they can.
The battery will drain fairly quickly (in a matter of several minutes). For that reason, it is generally not a good idea to connect the two terminals of a battery to one another directly. Normally, you connect some kind of load in the middle of the wire so the electrons can do useful work. The load might be a motor, a light bulb, a radio or whatever.
A small magnetic field is generated in the wire. It is this small magnetic field that is the basis of an electromagnet.
The part about the magnetic field might be a surprise to you, yet this definitely happens in all wires carrying electricity. You can prove it to yourself with the following experiment. You will need:
One AA, C or D-cell battery
A piece of wire (If you have no wire around the house, go buy a spool of insulated thin copper wire down at the local electronics or hardware store. Four-strand telephone wire is perfect -- cut the outer plastic sheath and you will find four perfect wires within.)
Put the compass on the table and, with the wire near the compass, connect the wire between the positive and negative ends of the battery for a few seconds. What you will notice is that the compass needle swings. Initially, the compass will be pointing toward the Earth's north pole (whatever direction that is for you), as shown in the figure on the right. When you connect the wire to the battery, the compass needle swings because the needle is itself a small magnet with a north and south end. Being small, it is sensitive to small magnetic fields. Therefore, the compass is affected by the magnetic field created in the wire by the flow of electrons.
The figure below shows the shape of the magnetic field around the wire. In this figure, imagine that you have cut the wire and are looking at it end-on. The green circle in the figure is the cross-section of the wire itself. A circular magnetic field develops around the wire, as shown by the circular lines. The field weakens as you move away from the wire (so the lines are farther apart as they get farther from the wire). You can see that the field is perpendicular to the wire and that the field's direction depends on which direction the current is flowing in the wire. The compass needle aligns itself with this field (perpendicular to the wire). If you flip the battery around and repeat the experiment, you will see that the compass needle aligns itself in the opposite direction.
Magnetic field of a wire
Because the magnetic field around a wire is circular and perpendicular to the wire, an easy way to amplify the wire's magnetic field is to coil the wire, as shown below:
One loop's magnetic field
For example, if you wrap your wire around a nail 10 times, connect the wire to the battery and bring one end of the nail near the compass, you will find that it has a much larger effect on the compass. In fact, the nail behaves just like a bar magnet.
A simple electromagnet
However, the magnet exists only when the current is flowing from the battery. What you have created is an electromagnet! You will find that this magnet is able to pick up small steel things like paper clips, staples and thumb tacks.
Experiments to Try!
What is the magnetic power of a single coil wrapped around a nail? Of 10 turns of wire? Of 100 turns? Experiment with different numbers of turns and see what happens. One way to measure and compare a magnet's "strength" is to see how many staples it can pick up.
What difference does voltage make in the strength of an electromagnet? If you hook two batteries in series to get 3 volts, what does that do to the strength of the magnet? (Please do not try any more than 6 volts, and please do not use anything other than flashlight batteries. Please do not try house current coming from the wall in your house, as it can kill you. Please do not try a car battery, as its current can kill you as well.)
What is the difference between an iron and an aluminum core for the magnet? For example, roll up some aluminum foil tightly and use it as the core for your magnet in place of the nail. What happens? What if you use a plastic core, like a pen?
What about solenoids? A solenoid is another form of electromagnet. It is an electromagnetic tube generally used to move a piece of metal linearly. Find a drinking straw or an old pen (remove the ink tube). Also find a small nail (or a straightened paperclip) that will slide inside the tube easily. Wrap 100 turns of wire around the tube. Place the nail or paperclip at one end of the coil and then connect the coil to the battery. Notice how the nail moves? Solenoids are used in all sorts of places, especially locks. If your car has power locks, they may operate using a solenoid. Another common thing to do with a solenoid is to replace the nail with a thin, cylindrical permanent magnet. Then you can move the magnet in and out by changing the direction of the magnetic field in the solenoid. (Please be careful if you try placing a magnet in your solenoid, as the magnet can shoot out.)
How do I know there's really a magnetic field? You can look at a wire's magnetic field using iron filings. Buy some iron filings, or find your own iron filings by running a magnet through playground or beach sand. Put a light dusting of filings on a sheet of paper and place the paper over a magnet. Tap the paper lightly and the filings will align with the magnetic field, letting you see its shape!