The electromagnet is a device that can be formed by a nail wrapped around a wire; when an electric current runs through the wire, it makes the nail behave like a permanent magnet; and when the current ceases, the nail is demagnetized, ceasing to be a magnet.
To make an electromagnet you need:
A big iron nail;
1m enameled copper wire with a diameter equivalent to 1mm;
Two large 1.5V batteries;
5 small iron nails.
Scrape the ends of the copper wire with a knife, the size should be enough to make contact between it and the pile.
Now wrap the copper wire on the nail as shown in the figure below:
Connect one battery to another in series.
Connect the ends of the wire to the batteries, one at each pole.
The electromagnet is ready.
Spread the small nails on a surface and run the electromagnet over them and you will see that the little nails will be attracted to the device.
By Frederico Borges de Almeida
Graduated in Physics
Brazil School Team
Electromagnetism - Physics - Brazil School
Source: Brazil School - https://brasilescola.uol.com.br/fisica/como-fazer-um-eletroima.htm