A current sensor comprising: a substrate comprising an aperture configured to receive a conductor carrying an alternating current to be measured; and a Rogowski coil positioned along a perimeter of the aperture; wherein the current sensor further comprises: an analog circuit, an analog-to-digital converter, and a microprocessor; wherein the Rogowski coil is configured to generate an analog signal proportional to a magnitude of the current carried by the conductor; wherein the analog circuit is configured to receive the analog signal from the Rogowski coil and apply a variable gain to the analog signal to generate a gain-amplified analog output; wherein the analog-to-digital converter is configured to receive the gain-amplified analog output and generate a digital signal; and wherein the microprocessor is configured to: receive the digital signal and generate an output indicative of the magnitude of the current carried by the conductor; decrease the variable gain applied to the analog output if both the magnitude of the analog signal exceeds a first value and a rate of change of the magnitude of the analog signal exceeds a second value; and increase the variable gain applied to the analog output if both the magnitude of the analog signal falls below a third value and the rate of change of the magnitude of the analog signal falls below a fourth value. a substrate comprising an aperture configured to receive a conductor carrying an alternating current to be measured; and a Rogowski coil positioned along a perimeter of the aperture; wherein the current sensor further comprises: an analog circuit, an analog-to-digital converter, and a microprocessor; wherein the Rogowski coil is configured to generate an analog signal proportional to a magnitude of the current carried by the conductor; wherein the analog circuit is configured to receive the analog signal from the Rogowski coil and apply a variable gain to the analog signal to generate a gain-amplified analog output; wherein the analog-to-digital converter is configured to receive the gain-amplified analog output and generate a digital signal; and wherein the microprocessor is configured to: receive the digital signal and generate an output indicative of the magnitude of the current carried by the conductor; decrease the variable gain applied to the analog output if both the magnitude of the analog signal exceeds a first value and a rate of change of the magnitude of the analog signal exceeds a second value; and increase the variable gain applied to the analog output if both the magnitude of the analog signal falls below a third value and the rate of change of the magnitude of the analog signal falls below a fourth value. an analog circuit, an analog-to-digital converter, and a microprocessor; wherein the Rogowski coil is configured to generate an analog signal proportional to a magnitude of the current carried by the conductor; wherein the analog circuit is configured to receive the analog signal from the Rogowski coil and apply a variable gain to the analog signal to generate a gain-amplified analog output; wherein the analog-to-digital converter is configured to receive the gain-amplified analog output and generate a digital signal; and wherein the microprocessor is configured to: receive the digital signal and generate an output indicative of the magnitude of the current carried by the conductor; decrease the variable gain applied to the analog output if both the magnitude of the analog signal exceeds a first value and a rate of change of the magnitude of the analog signal exceeds a second value; and increase the variable gain applied to the analog output if both the magnitude of the analog signal falls below a third value and the rate of change of the magnitude of the analog signal falls below a fourth value. receive the digital signal and generate an output indicative of the magnitude of the current carried by the conductor; decrease the variable gain applied to the analog output if both the magnitude of the analog signal exceeds a first value and a rate of change of the magnitude of the analog signal exceeds a second value; and increase the variable gain applied to the analog output if both the magnitude of the analog signal falls below a third value and the rate of change of the magnitude of the analog signal falls below a fourth value.