When a magnetic compass is brought close to a current carrying wire
there is deflection in the compass due to the formation of magnetic
field. The magnetic field lines around a long wire which carries an
electric current form concentric circles around the wire. The direction
of the magnetic field is perpendicular to the wire.
The
deflection increases when the current is increased because the magnitude
of the field is directly proportional to the strength of the electric
current. That is, stronger the electric field, stronger the magnetic
field.