An integrated circuit comprising: at least one on chip Hall sensor plate configured to measure an external magnetic field; and an on chip inductor element connected to two current sense pins (2, 3) of said integrated circuit, wherein the on chip inductor element is configured to generate an internal magnetic field sensed by said on chip Hall sensor plate to measure an applied electrical current flowing through said on chip inductor element via said current sense pins (2, 3) of said integrated circuit; wherein the integrated circuit further comprises: an overcurrent protection circuit comprising a current sensing element and a low resistance switch connected in series with the on chip inductor element; wherein the circuit is configured such that a voltage drop at the current sensing element is amplified by a voltage amplifier adapted to control the low resistance switch of the overcurrent protection circuit; and wherein, if the voltage drop at the current sensing element exceeds a threshold voltage, the voltage amplifier is configured to switch the low resistance switch off to interrupt a current flow through said on chip inductor element; characterized in that the on chip inductor element is formed by a metal planar coil on a passivation layer covering the on chip Hall sensor plate and an interconnection metal layer. at least one on chip Hall sensor plate configured to measure an external magnetic field; and an on chip inductor element connected to two current sense pins (2, 3) of said integrated circuit, wherein the on chip inductor element is configured to generate an internal magnetic field sensed by said on chip Hall sensor plate to measure an applied electrical current flowing through said on chip inductor element via said current sense pins (2, 3) of said integrated circuit; wherein the integrated circuit further comprises: an overcurrent protection circuit comprising a current sensing element and a low resistance switch connected in series with the on chip inductor element; wherein the circuit is configured such that a voltage drop at the current sensing element is amplified by a voltage amplifier adapted to control the low resistance switch of the overcurrent protection circuit; and wherein, if the voltage drop at the current sensing element exceeds a threshold voltage, the voltage amplifier is configured to switch the low resistance switch off to interrupt a current flow through said on chip inductor element; characterized in that the on chip inductor element is formed by a metal planar coil on a passivation layer covering the on chip Hall sensor plate and an interconnection metal layer. an overcurrent protection circuit comprising a current sensing element and a low resistance switch connected in series with the on chip inductor element; wherein the circuit is configured such that a voltage drop at the current sensing element is amplified by a voltage amplifier adapted to control the low resistance switch of the overcurrent protection circuit; and wherein, if the voltage drop at the current sensing element exceeds a threshold voltage, the voltage amplifier is configured to switch the low resistance switch off to interrupt a current flow through said on chip inductor element; characterized in that the on chip inductor element is formed by a metal planar coil on a passivation layer covering the on chip Hall sensor plate and an interconnection metal layer.