A device for measuring the components of an ambient magnetic field including: - an optically pumped scalar magnetometer comprising a cell filled with a gas, a laser source emitting a light beam, a polarizer rectilinearly polarizing said beam along a direction of polarization, a photodetector receiving the polarized beam that passed through the cell and providing an electrical signal, a coil surrounding the cell, powered by a radiofrequency generator and the axis of which registers with said direction of polarization, frequency locking means receiving said electrical signal and locking the frequency of the radiofrequency generator to the Larmor frequency, a frequency estimator estimating the frequency of the radiofrequency signal generated by said generator, the scalar magnetometer providing a signal representative of the module of the magnetic field in which the cell is located from the frequency thus estimated; - two conductive windings (Ex, Ey), having orthogonal axes (Ox, Oy), provided around the cell, respectively powered by two generators (Gx, Gy) having distinct frequencies ( F x, F y), demodulation means (Dx,D'x; Dy,D'y) adapted to demodulate the signal provided by the scalar magnetometer in phase and quadrature to both distinct frequencies and to provide the spectral components of this signal at these two frequencies, calculation means determining from said spectral components and from the module of the ambient magnetic field, the components along three orthogonal axes (Ox,Oy,Oz) of the ambient magnetic field; characterised in that: - both conductive windings (Ex,Ey) and the coil are mechanically integral with a swivel support, the axes of both conductive windings and of the coil being located in a same plane; - said support is mounted on swivel mechanical or electromechanical means, so as to be able to swivel said plane substantially orthogonally to the direction of the ambient magnetic field. - an optically pumped scalar magnetometer comprising a cell filled with a gas, a laser source emitting a light beam, a polarizer rectilinearly polarizing said beam along a direction of polarization, a photodetector receiving the polarized beam that passed through the cell and providing an electrical signal, a coil surrounding the cell, powered by a radiofrequency generator and the axis of which registers with said direction of polarization, frequency locking means receiving said electrical signal and locking the frequency of the radiofrequency generator to the Larmor frequency, a frequency estimator estimating the frequency of the radiofrequency signal generated by said generator, the scalar magnetometer providing a signal representative of the module of the magnetic field in which the cell is located from the frequency thus estimated; - two conductive windings (Ex, Ey), having orthogonal axes (Ox, Oy), provided around the cell, respectively powered by two generators (Gx, Gy) having distinct frequencies ( F x, F y), demodulation means (Dx,D'x; Dy,D'y) adapted to demodulate the signal provided by the scalar magnetometer in phase and quadrature to both distinct frequencies and to provide the spectral components of this signal at these two frequencies, calculation means determining from said spectral components and from the module of the ambient magnetic field, the components along three orthogonal axes (Ox,Oy,Oz) of the ambient magnetic field; - both conductive windings (Ex,Ey) and the coil are mechanically integral with a swivel support, the axes of both conductive windings and of the coil being located in a same plane; - said support is mounted on swivel mechanical or electromechanical means, so as to be able to swivel said plane substantially orthogonally to the direction of the ambient magnetic field.