Solenoids and Magnetic Fields. A solenoid is a long coil of wire wrapped in many turns. When a current passes through it, it creates a nearly uniform magnetic field inside. Solenoids can convert electric current to mechanical action, and so are very commonly used as switches.