An apparatus for detecting a stray magnetic field, comprising: a first magnetic sensor element (103, 1002, 1701, 2101, 2602) at a first position relative to a magnetic field source to detect a target magnetic field emitted by the magnetic field source (101, 901, 1602, 2002, 2501); a second magnetic sensor element (105, 1004, 1703, 2103, 2604) at a second position relative to the magnetic field source to detect the target magnetic field emitted by the magnetic field source; wherein: the first magnetic sensor element comprises anisotropic magnetoresistive, AMR, members (201, 202, 203, 204), one of the AMR members of the first magnetic sensor element being in a perpendicular arrangement with another AMR member of the first magnetic sensor element; the second magnetic sensor element comprises AMR members (301, 302, 303, 304), one of the AMR members of the second magnetic sensor element being in a perpendicular arrangement with another AMR member of the second magnetic sensor element; and the first magnetic sensor element at the first position is in a 45 degree arrangement with respect to the second magnetic sensor element at the second position; and a processor element (402, 1101) electronically coupled to the first magnetic sensor element and the second magnetic sensor element, wherein the processor element is configured to: receive a first output from the first magnetic sensor element; receive a second output from the second magnetic sensor element; and detect the stray magnetic field interfering with the target magnetic field by: calculating an output deviation between the first output and the second output; and determining whether the output deviation satisfies a deviation criterion; and wherein: the first magnetic sensor element, the second magnetic sensor element, and the processor element are contained in a same integrated circuit. a first magnetic sensor element (103, 1002, 1701, 2101, 2602) at a first position relative to a magnetic field source to detect a target magnetic field emitted by the magnetic field source (101, 901, 1602, 2002, 2501); a second magnetic sensor element (105, 1004, 1703, 2103, 2604) at a second position relative to the magnetic field source to detect the target magnetic field emitted by the magnetic field source; wherein: the first magnetic sensor element comprises anisotropic magnetoresistive, AMR, members (201, 202, 203, 204), one of the AMR members of the first magnetic sensor element being in a perpendicular arrangement with another AMR member of the first magnetic sensor element; the second magnetic sensor element comprises AMR members (301, 302, 303, 304), one of the AMR members of the second magnetic sensor element being in a perpendicular arrangement with another AMR member of the second magnetic sensor element; and the first magnetic sensor element at the first position is in a 45 degree arrangement with respect to the second magnetic sensor element at the second position; and a processor element (402, 1101) electronically coupled to the first magnetic sensor element and the second magnetic sensor element, wherein the processor element is configured to: receive a first output from the first magnetic sensor element; receive a second output from the second magnetic sensor element; and detect the stray magnetic field interfering with the target magnetic field by: calculating an output deviation between the first output and the second output; and determining whether the output deviation satisfies a deviation criterion; and wherein: the first magnetic sensor element, the second magnetic sensor element, and the processor element are contained in a same integrated circuit. the first magnetic sensor element comprises anisotropic magnetoresistive, AMR, members (201, 202, 203, 204), one of the AMR members of the first magnetic sensor element being in a perpendicular arrangement with another AMR member of the first magnetic sensor element; the second magnetic sensor element comprises AMR members (301, 302, 303, 304), one of the AMR members of the second magnetic sensor element being in a perpendicular arrangement with another AMR member of the second magnetic sensor element; and the first magnetic sensor element at the first position is in a 45 degree arrangement with respect to the second magnetic sensor element at the second position; and a processor element (402, 1101) electronically coupled to the first magnetic sensor element and the second magnetic sensor element, wherein the processor element is configured to: receive a first output from the first magnetic sensor element; receive a second output from the second magnetic sensor element; and detect the stray magnetic field interfering with the target magnetic field by: calculating an output deviation between the first output and the second output; and determining whether the output deviation satisfies a deviation criterion; and wherein: receive a first output from the first magnetic sensor element; receive a second output from the second magnetic sensor element; and detect the stray magnetic field interfering with the target magnetic field by: calculating an output deviation between the first output and the second output; and determining whether the output deviation satisfies a deviation criterion; and wherein: calculating an output deviation between the first output and the second output; and determining whether the output deviation satisfies a deviation criterion; and wherein: the first magnetic sensor element, the second magnetic sensor element, and the processor element are contained in a same integrated circuit.