A full bridge circuit comprises first to fourth magnetic resistance elements. The first and fourth magnetic resistance elements have a first polarity, while the second and third magnetic resistance elements have a second polarity. A comparison circuit compares a first value indicating a difference between a potential of a first connecting node and a first potential and a second value indicating a difference between a potential of a second connecting node and a second potential to determine presence/absence of an external magnetic field. An initial magnetization vector of a magnetization free layer of the first magnetic resistance element is the reverse of that of a magnetization free layer of the second magnetic resistance element. An initial magnetization vector of a magnetization free layer of the third magnetic resistance element is the reverse of that of a magnetization free layer of the fourth magnetic resistance element.