Electromagnet can be driven by a battery, there is no need to have to use enameled wire, with a general single-stranded wire can be, in general, a 1.5V battery, winding about a hundred turns on the magnetic, do not need to use 220V, and, the circuit is not familiar with the circuit, so there is a certain degree of danger, do not use 220V.
There are a lot of transformers on the market, they can be Use, in general, the output in a few volts on it, but for you to do electromagnet, all play the role of power supply, not as good as using batteries, but also safe.
If you wind along the thread of the screw, the magnetism is not very good, the effect is not good, the correct way, is to wind multi-layer, as if the home sewing clothes as a ball of thread, the center of the core to use thicker screws can be, it is best to screw the cap of the big point.
Wind the coil with the thinnest copper wire possible (the more turns the better), and increase the voltage of the battery pack as much as the wire can take. Note: The wire should be insulated, with good insulation between wires and between cores.
Extended information:
Electromagnet is a device that can be used to generate magnetic force by passing an electric current through it, which is a non-permanent magnet, and it can be easily activated or deactivated by its magnetism. For example, large cranes use electromagnets to lift abandoned vehicles.
When an electric current is passed through a wire, a magnetic field is created around the wire. Applying this property, when current is passed through a solenoid, a uniform magnetic field is created within the solenoid. Assuming that a ferromagnetic material is placed in the center of the solenoid, the ferromagnetic material will be magnetized and the magnetic field will be greatly enhanced.
Generally speaking, the magnetic field produced by an electromagnet is related to the size of the current, the number of coils and the ferromagnet in the center. When designing an electromagnet, attention is given to the distribution of the coils and the selection of the ferromagnet, and the current level is used to control the magnetic field. Because the material of the coils is resistive, this limits the size of the magnetic field that an electromagnet can produce, but with the discovery and application of superconductors, there will be opportunities to go beyond the existing limitations.
Baidu Encyclopedia - Electromagnet