An infusion pump operable to pump fluid through tubing connected to the infusion pump, wherein the infusion pump comprises: at least one pressure sensor for measuring fluid pressure within the tubing, wherein the pressure sensor includes a magnet having an intended magnetic field and a primary Hall effect sensor , wherein the magnet is arranged to move relative to the primary Hall effect sensor in response to radial contraction and expansion of the tubing and the primary Hall effect sensor generates a primary output signal proportional to magnetic field strength detected thereby, the primary output signal representing fluid pressure in the tubing when the primary Hall effect sensor solely detects the intended magnetic field; at least one secondary Hall effect sensor arranged to detect an ambient magnetic field in the vicinity of the infusion pump capable of being detected by the primary Hall effect sensor, wherein the secondary Hall effect sensor generates a secondary output signal proportional to magnetic field strength detected thereby; and a memory storing an expected output signal value and an expected output signal fluctuation range of the at least one secondary Hall effect sensor generated in response to the intended magnetic field of the magnet and in the absence of the ambient magnetic field, wherein the expected output signal value corresponds to a position of the magnet at pressure equilibrium between an interior and an exterior of the tubing and the expected output signal fluctuation range represents travel limits of the magnet associated with radial contraction and expansion of the tubing; whereby presence of the ambient magnetic field is determined based on comparison of the secondary output signal to the expected output signal value. wherein the pressure sensor includes a magnet having an intended magnetic field and a primary Hall effect sensor , wherein the magnet is arranged to move relative to the primary Hall effect sensor in response to radial contraction and expansion of the tubing and the primary Hall effect sensor generates a primary output signal proportional to magnetic field strength detected thereby, the primary output signal representing fluid pressure in the tubing when the primary Hall effect sensor solely detects the intended magnetic field; at least one secondary Hall effect sensor arranged to detect an ambient magnetic field in the vicinity of the infusion pump capable of being detected by the primary Hall effect sensor, wherein the secondary Hall effect sensor generates a secondary output signal proportional to magnetic field strength detected thereby; and a memory storing an expected output signal value and an expected output signal fluctuation range of the at least one secondary Hall effect sensor generated in response to the intended magnetic field of the magnet and in the absence of the ambient magnetic field, wherein the expected output signal value corresponds to a position of the magnet at pressure equilibrium between an interior and an exterior of the tubing and the expected output signal fluctuation range represents travel limits of the magnet associated with radial contraction and expansion of the tubing; whereby presence of the ambient magnetic field is determined based on comparison of the secondary output signal to the expected output signal value. <EOS>