\section{Introduction}
    Since the 1960s, superconducting quantum interference devices (SQUIDs) have been the benchmark for sensitive magnetic field measurement at low frequencies~\cite{Ryhanen1989-ci,Pizzella2001-pl}.
    However, developments in the spin-exchange relaxation-free (SERF) regime over the past two decades have allowed optically-pumped magnetometers (OPMs) to achieve a similar, if not better sensitivity compared to SQUIDs \citep{kominis_subfemtotesla_2003}, with a number of distinct advantages.
    SQUIDs require cryogenic cooling which increases costs, limits the device portability, and increases the separation between the device and object of interest.
    OPMs offer reduced separation distances over SQUIDs, which is of particular interest for magnetoencephalography (MEG)~\cite{Sander2012-kv,Colombo2016-hg,Sheng2017-sp,Limes2020-eg}, where OPM-MEG is able to offer an improved spatial~\cite{Tan1990-yx,Boto2016-ya}, and  spatio-temporal~\cite{gialopsou_improved_2021} resolution.
   
    These advantages can be similarly applied to the diagnostic measurement of batteries through non-invasive current mapping~\cite{Hu2020-kn,bason_non-invasive_2021}, and for fundamental physics research~\cite{Pustelny2013-dq,Abel2019-tm}.
    While OPMs offer many advantages over SQUIDS, a number of challenges remain, especially around the construction of dense arrays.
    Commercially available OPMs currently focus on single-sensor designs, and when multiple units are operated in close proximity issues arise from radio frequency (RF) cross-talk, as well as high sensor surface temperatures.
    To achieve dense OPM array systems, these problems must be addressed.

    Here we present a magnetometer system designed with an emphasis on scalability and modularity, both for easy adaptability of sensor locations and sensing regimes.
    The magnetometer is constructed from individual modules, used to configure the layout of the OPM system.
   
    Additionally, optical elements inside modules can be individually replaced or reconfigured to allow implementation of different sensing schemes.
    
    To illustrate the adaptability of the magnetometer system, two configurations of the instrument operating in the ultra-sensitive SERF regime are presented. A single sensor configuration was used to capture alpha-rhythms from the brain of a human participant, demonstrating suitability for high sensitivity measurements. Additionally, a two-sensor gradiometer with superior sensitivity performance through common noise rejection was characterised.

   
   
   
    The scalability of the modular OPM system, along with the flexibility to incorporate a variety of magnetometry schemes, make this system an ideal development platform for the realisation of dense sensor arrays.
    
\section{Method} \label{sec.Method}
    \begin{figure}
        \centering
        \includegraphics[width=\columnwidth]{images/Modular_OPM_2x2.png}
        \caption{An example of multi-axis magnetic gradiometer connecting 4 sensor modules in $2\times 2$ array configuration with light source and beam distribution modules. The laser beam is conditioned with lens, linear polariser (LP) and quarter-waveplate ($\lambda/4$). After passing through vapour cells, the beam power is monitored with photodiodes (PD). A non-polarising $50:50$ beam splitter ($50:50$ BS) and a mirror ensure that the probe light from a single beam is delivered to all sensors.}
        \label{fig:2x2}
   \end{figure}

    Our system utilises \SI[product-units = repeat]{45 x 45 x 40}{\milli\metre} cubic modules which inter-connect to produce a desired OPM system layout. An example of $2\times 2$ sensor array is shown in Fig.~\ref{fig:2x2}.
    The enclosure of each module is 3D-printed from polycarbonate, allowing for design flexibility while also providing excellent mechanical rigidity with a \SI{139}{\degree C} glass transition temperature~\cite{Shamim2014-zu}.
    The system is assembled from three types of modules: light source, sensor, and beam distribution modules. Light source modules introduce and condition laser light for use in the magnetometer system. Light can be internally generated by a vertical cavity surface-emitting laser (VCSEL), or brought from external sources via optical fibres. 
    
            \begin{figure}
            \centering
            \includegraphics[width=1\columnwidth]{images/Modular_OPM_grad.png}
            \caption{
           
            A schematic (top) and a photograph (bottom) of the single-axis gradiometer modular OPM consisting of a light source module and two sensor modules. The dimensions of each module are $W\times D\times H=\SI[product-units = repeat]{45 x 45 x 40}{\milli\metre}$. Modules can be snapped together to produce different array configurations.
           
           
           
           
            }
            \label{fig:optics}
        \end{figure}
        
    Sensor modules contain optical elements, vapour cells, magnetic field coils and photodiodes required for magnetic field measurements.
    Finally, beam distribution modules are used for light delivery, allowing for greater flexibility in positioning of the sensors.
    Due to the adaptability of its optics packages, measurement schemes and array configurations, the magnetometer can be tailored to a large variety of applications. 
   
    
    
    
  
  
  
  
  
    
    The sensor module design presented in this paper operates in the high-sensitivity SERF regime, requiring large atomic densities in a low magnetic field environment~\citep{allred_high-sensitivity_2002}.
   
    A gradiometer (Fig.~\ref{fig:optics}) is constructed using one light source module and two sensor modules in a similar configuration to~\cite{nardelli_conformal_2020}. 
    Our modular system can further be extended to a multi-axis gradiometer instrument as shown in Fig.~\ref{fig:2x2}.
    
    
    The SERF sensor modules utilise the Hanle resonance (zero-field resonance) as a measurement scheme~\cite{Dupont-Roc1969-yj}, relying on the monitoring of the transmitted power of a resonant circularly polarised laser beam probing a vapour cell.
    
   
    
   
    
    When a magnetic field component that is perpendicular to the laser beam direction, $B_{x}$ (respectively $B_{z}$), is scanned through zero field, atoms are pumped into a dark state and the magnitude of the transmitted light follows a Lorentzian distribution with peak transmission at $B_{x}=0$ (respectively $B_{z}=0$). By applying a modulating field $B_{x,RF}\cos{(\omega t)}$ across the zero-field resonance peak, and passing the photodiode response through a lock-in amplifier (LIA), a dispersion signal is produced of the form~\cite{cohen-tannoudji_diverses_1970,tierney_optically_2019}
    \begin{equation}
        V(B_x)= A\frac{\gamma B_x \tau}{1 +(\gamma B_x \tau)^2},
    \end{equation}
    where $\gamma$ is the gyromagnetic ratio for the active atomic species,
    $\tau$ is the relaxation time of the spin-polarised atomic population, and $A$ is a proportionality constant (with units \SI{}{\volt/\pico\tesla}) determined by calibrating the sensor output.
    The LIA also reduces 1/f noise, improving the signal-to-noise ratio of the resonance signal~\cite{kastler_hanle_1973}. A similar argument can be made for the other orthogonal component $B_z$.
    
    A sensor module contains three orthogonal coil pairs positioned around a vapour cell, used to apply offset and modulation fields. The field $B_{x}$ is modulated at frequency $\omega=\SI{926}{\hertz}$ with a peak-to-peak of ~ \SI{60}{\nano\tesla} at the centre of the vapour cell.
    To achieve sufficient atomic density for the SERF regime, the vapour cells are heated using alternating currents at \SI{81}{\kilo\hertz} and \SI{200}{\kilo\hertz}, driven through twisted manganin heating wires wrapped around the vapour cells. These AC frequencies are chosen to be orders of magnitude higher than the rubidium atomic response bandwidth to avoid broadening of the measured resonance. The vapour cell housing is thermally insulated to minimise heating power and surface temperature of sensor module. In doing so, a stand-off distance of \SI{8.5}{\milli\metre} from the end of the sensor module housing to the cell centre was achieved. 
    
    Light from an external cavity diode laser, tuned to the \ensuremath{{}^{87}\mathrm{Rb}}{} D1 transition (\SI{795}{\nano\metre}), is coupled into a polarisation maintaining (PM) optical fibre and input to the light-source module of the sensor (Fig.~\ref{fig:optics}).
    The linearly polarised beam is then collimated to a $1/e^2$ diameter of \SI{3}{\milli\metre} before being circularly polarised and split with a 50:50 non-polarising beamsplitter cube.
    The reflected beam is directed through a \SI[product-units = repeat]{5 x 5 x 5}{\milli\metre} blown-glass \ensuremath{{}^{87}\mathrm{Rb}}{} cell in sensor module 1, containing \SI{50}{\torr} of N$_{2}$ and \SI{650}{\torr} of Ne as buffer gases \footnote{Blown-glass \ensuremath{{}^{87}\mathrm{Rb}}{} cells were procured from Twinleaf LLC.}. In sensor module 2, an identical vapour cell is probed with the beam coming from the transmitted arm of the beamsplitter. Photodiodes are placed behind the vapour cells to monitor the probing beam power. Their signals are passed through external trans-impedance amplifiers and fed to a pair of synchronised LIAs before being recorded with a digital acquisition card (DAQ) \footnote{LabJack T7 pro, LabJack Corporation, Co, USA}.
    
    Sensitivity measurements were taken inside a four-layer mumetal cylindrical shield \footnote{MS-2 mu-metal shield, Twinleaf LLC} with an internal magnetic field magnitude below \SI{10}{\nano\tesla} and magnetic noise of \SI{10}{\femto\tesla/\sqrt{\hertz}}. The offset fields were applied using the sensor module's internal coils, and modulation fields were generated using field coils built into the shield. The LIA output voltages were calibrated by applying well-defined $B_x$ fields. 
    
    To demonstrate suitability of the modular OPM system for MEG applications, a single-sensor magnetometer configuration was operated to capture human brain alpha-rhythms~\cite{Cohen1968-nf}. The setup is similar to the three-module gradiometer configuration shown in Fig. \ref{fig:optics}, with the difference that only one sensor module is present. The MEG measurements were taken inside a three-layer mumetal cylinder, with an internal diameter of \SI{50}{\centi\metre} and axial length of \SI{100}{\centi\metre}. The single-sensor module OPM was placed at the centre of the cylinder, supported by a wooden arm which the participant was able to rest their head against. A prerecorded voice prompted the participant to open and close their eyes every \SI{12}{\second} for \SI{150}{\second} to stimulate an alpha-band response when their eyes were shut (photic blocking)~\cite{Cohen1972-jw}. The optimum placement of the sensor over the primary visual cortex (Oz position) was measured according to the standard $10-10$ system~\cite{Koessler2009-pc}. The analogue signal from the OPM-MEG system was sampled at \SI{200}{\hertz} using the same DAQ setup as previously described.
    
   

\section{Results and discussion}
    \begin{figure}
            \centering
            \includegraphics[width=\columnwidth]{images/Noise_Floor_Figure.png}
            \caption{The \SIrange{1}{200}{\hertz} frequency compensated linear spectral density of the demodulated signals from the sensor module 1 (blue), the sensor module 2 (red) and from the balanced photodiodes gradiometer configuration (yellow). The gradiometer configuration removes common-mode noise between the two sensors, which can be seen by the noise reduction at \SI{50}{\hertz}, and the broader peak in the \SIrange{55}{75}{\hertz} band. Sensor module 1 has a noise-floor of \SI{65}{\femto\tesla/\sqrt{\hertz}}, sensor module 2, \SI{83}{\femto\tesla/\sqrt{\hertz}}, and the gradiometer configuration \SI{47}{\femto\tesla/\sqrt{\hertz}} in the \SIrange{5}{45}{\hertz} band.
            }
            \label{fig:ffts}
        \end{figure}
        
 
  The sensitivity measurements were taken over a period of \SI{60}{\second} during which the magnetometer signals from sensor modules 1 and 2 were recorded.
  Data were analysed for each sensor separately, and as a software gradiometer (sensor module 1 -- sensor module 2).
   The frequency spectra in Fig.\,\ref{fig:ffts} show noise floors of sensor modules 1 and 2 to be \SI{65}{\femto\tesla/\sqrt{\hertz}} and \SI{83}{\femto\tesla/\sqrt{\hertz}}, respectively, in the \SIrange{5}{45}{\hertz} band.
   As both the \ensuremath{{}^{87}\mathrm{Rb}}{} atoms and the LIA act as a low-pass filter, the linear density spectrum has been divided by the transfer function of each sensor module~\cite{colombo_four-channel_2016}. The transfer function follows a first-order low-pass filter from \SI{1}{\hertz} to \SI{250}{\hertz}, and the bandwidths of the sensor modules were found to be \SI{213}{\hertz} for module 1, and \SI{219}{\hertz} for module 2.
   Using the gradiometer configuration the sensitivity improves to \SI{47}{\femto\tesla/\sqrt{\hertz}}, exploiting the suppression of common light intensity noise. In addition, the gradiometer configuration offers a common-mode noise suppression ratio of 6.1 on the \SI{50}{\hertz} powerline peak compared to module 2. When considering the inter-cell distances, the gradiometer measurement translates to a magnetic field gradient sensitivity of \SI{10.4}{\femto\tesla/\centi\metre/\sqrt{\hertz}} in the frequency range between \SI{5}{\hertz} and \SI{45}{\hertz}.
   For this measurement the \ensuremath{{}^{87}\mathrm{Rb}}{} vapour cells were operated at temperatures of \SI{129}{\degree C} and \SI{124}{\degree C} in sensor modules 1 and 2, respectively.
   We note that the optimal sensitivity of \ensuremath{{}^{87}\mathrm{Rb}}{} vapour in the SERF regime occurs at \SI{150}{\degree C}~\cite{Shah2007-sa}, leading to a factor 4 increase in vapour density~\cite{Seltzer2008-kh}, which would require an alternative to the polycarbonate-printed material. 
   In addition to the potential sensitivity increase from the \ensuremath{{}^{87}\mathrm{Rb}}{} density, further gains can be made in the low-frequency domain by implementing active feedback on vapour cell temperature and laser power.
  
   These adaptions, currently in development, coupled with the sensor design presented here, will result in a fully modular OPM system, re-configurable by the user.
    
    \begin{figure}
        \centering
        \includegraphics[width=\columnwidth]{images/Window_Hann_summer_reduced_range.png}
        \caption{Spectrogram of the \SIrange{8}{12}{\hertz} alpha-band response to a participant opening/closing their eyes. The overlaid white trace denotes the audio cue trigger signal from the stimulus PC. High values of the trigger signal indicate the time when the participant is instructed to close their eyes, the low value is when the participant has their eyes open. The spectrogram colour scheme details the high periods of activity in yellow, and the low periods in green.}
        \label{fig:spectrogram}
    \end{figure}
    
   Data from the alpha-rhythm measurement with a single sensor module were analysed in the frequency domain, with the spectrogram shown in Fig.~\ref{fig:spectrogram}. We see an increase in the activity in the \SIrange{8}{12}{\hertz} alpha-band when the participant's eyes are closed, with a strong correlation with the TTL cue. Although we already show that the current modular sensor is suitable for MEG, future improvements of the signal-to-noise ratio can be made by suppressing common-mode noise using a gradiometer.
   
  We have designed a modular OPM system and have demonstrated its operation in two configurations, one of which was used to record MEG signals from a human participant.
  The ability of this highly-customisable OPM system to implement new measurement schemes, array configurations, dual-scheme OPM arrays, or multi-modal quantum sensor systems, offers a unique combination of adaptability and the capability for in-field use.
  This modular system is an important development tool for the advancement of dense OPM arrays in medical and industrial fields, providing a rapid testing platform to benchmark OPM system architectures.
  
\section*{Additional material}
    The participant gave written informed consent to take part, after explanation of the procedure and purpose of the experiment.
    The study has been approved by the Brighton and Sussex Medical School Research Governance and Ethics Committee (ER/BSMS3100/1).
    
    The data and code that support the findings of this study are available from the authors upon reasonable request.
    
\bibliographystyle{ieeetr}  
