Gradually (slowly) drag the magnetic sensor from left to right:
Magnetic Field of a Solenoid?
Simulation Home