When an electric current flows in a wire, it creates a magnetic field around the wire. This effect can be used to make an electromagnet. A simple electromagnet comprises a length of wire turned into a coil and connected to a battery or power supply.
You can make an electromagnet stronger by doing these things:
There is a limit to how much current can be passed safely through the wire because the resistance of the wire causes heating.
Electromagnets have some advantages over permanent magnets. For example:
These properties make electromagnets useful for picking up scrap iron and steel in scrapyards.
The magnetic field around an electromagnet is just the same as the one around a bar magnet. It can, however, be reversed by reversing the current (turning the battery around).