The invention relates to a
magnetic field sensor (10), comprising: an excitation
light source (6) for emitting excitation light (4), a measurement region (7) which has colour centres (3) in a
crystal (1), preferably NV centres in
a diamond, which emit
fluorescent light (5) when excited with the excitation light (4), a
detector (8) for detecting the
fluorescent light (5) from the measurement region (7), a
microwave emitter (11) for applying a
microwave field (9) to the measurement region (7), a
signal generator (14) which is designed to generate a
microwave signal (15) for the microwave emitter (11) and has two frequency components (fsb-(t), fsb+,π(t)) phase-shifted in relation to one another by π, in order to simultaneously excite
magnetic field resonances at two different resonant frequencies (f-, f+) in the
crystal (1) in order to determine a
magnetic field (B), and an evaluation device (12) which has a demodulator (13) for forming a demodulated magnetic
resonance signal from the detected
fluorescent light (5) of the measurement region (7), wherein the evaluation device (12) is designed to determine a detuning (∆B) of the resonant frequencies (f-, f+) due to a change in the magnetic field (B), and to generate a
frequency shift (∆f) of the microwave signal (15) according to the magnetic-field-related detuning (∆B) of the resonant frequencies (f-, f+). The magnetic field sensor (10) is designed to determine, in a temperature calibration step, a temperature-related detuning (∆T) of the resonant frequencies (f-, f+) and to take same into account in the
frequency shift (∆f) of the microwave signal (15) in order to determine the magnetic field (B). The invention further relates to an associated method for calibrating the temperature of a magnetic field sensor (10).