Device that detects presence of magnetic field via hall effect