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.)
- A compass
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.