This project is adapted from Bradley Worley's PyPPM Earth Field NMR Spectrometer. The electronics have a few minor adjustments. The coil design is a bit different. The application is different. It runs continuously in the style of a geomagnetic observatory, making measurements of the Earth magnetic field strength. Plots are generated and uploaded periodically to a website.
A small container of water inside one of the coils is subjected for a few seconds to a strong magnetic field orthogonal to the local geomagnetic field. This aligns the nuclear spin of some fraction of the hydrogen nuclei with the applied field. The field is then rapidly quenched, after which the nuclei feel only Earth's magnetic field. This causes a precession of the protons' magnetic moment as they realign to the direction of the Earth's field lines. The precession frequency, called the Larmor frequency, depends on only two things: the strength of the geomagnetic field, and a physical constant of nature. If we can accurately measure the frequency, we can accurately determine the field strength.
This measurement is easier said than done, as the 2 KHz precession signal induced in the coil has an amplitude less than one microvolt. During the quench, the voltage on the coil rises to 120V. The two coils are wound in series opposition, similar to a 'humbucker' guitar pickup. While this helps, it doesn't eliminate the 60 Hz mains harmonics and other noise. The exponentially decreasing Larmor signal lasts for only one second before it decays below the noise floor.
The hardware performs switching, gain, and filtering to amplify and digitize the signal. Afterwards the host software performs a technique called harmonic inversion to identify a series of exponentially decaying sinusoid candidates in the data. Various checks are performed to remove the unlikely candidates, and if possible, one of the candidates is chosen as the true Larmor signal. This information is logged along with other parameters for the signal. This (noisy) time series is then median-filtered to result in a closer approximation of the real geomagnetic field. Some of the noise is electrical, and some is due to real magnetic field fluctuations due to moving vehicles, electrical machinery, changing AC power demand in the neighborhood, etc.
Under good conditions during quiet times, the field strength can be resolved to sub-nanotesla (nT) levels. Earth's field is normally around 50,000 nT so this is a reasonably good measurement. As a point of reference, "ultra-low-noise" MEMS magnetometers have about +/- 200 nT noise. Natural daily variation in my area seems to be about +/- 25 nT. Solar storms can cause this to increase significantly.
A plot of recent data is available here.
Project files are posted on github.