Patent ID: 7265541

Claim:
A magnetic sensor comprising: a magnetic movable that moves correspondingly to a movement of an object-being-detected; a sensor section provided opposite to the magnetic movable through a gap and for detecting a change of magnetic field in the gap based on a movement of the magnetic movable; a converting section that converts a change of magnetic field, detected by the sensor section, into an electric amount change and outputs an electric amount change converted; in a sensor unit having a power terminal and a ground terminal for grounding, and an output terminal; a determining section that determines a moving direction of the object-being-detected depending upon an output of the converting section through the output terminal of the sensor unit; a current control section that controls an amount of current flowing through at least one of the power terminal and the ground terminal correspondingly to a moving direction of the magnetic movable; the determining section detecting a moving direction of the object-being-detected depending upon the amount of current.