A current sensor using the compensation principle, in particular for measuring
direct and alternating currents, includes an entirely digital evaluation circuit
for signal processing. This substantially lowers the cost of the control electronics,
in particular through integration in an ASIC. The magnetic field probe is, for
example, supplied with a square wave voltage of a predetermined frequency, the
probe signal is recorded by one or two comparators and the pulse width is digitally
measured by counters. Furthermore, the conventional analog final stage for the
compensation current is replaced by a PWM end stage with a series connected sigma-delta
modulator. The square wave can be synchronized with a defined synchronization signal,
which can be derived, for example, from the processed measurement values.