# Open-Source Magnetometer for Characterizing Magnetic Fields in Ultracold Experiments
## 3 Experimental Setup
### Hardware
The longitudinal resolution per step of the automated magnetometer \(\Delta y=P_{\text{MS}}/N_{\text{step}}\) depends on the pitch of the threaded rod, \(P_{\text{MS}}\), and on the number of steps per revolution of the stepper motor, \(N_{\text{step}}\). The stepper motor we use (JK42 HM48-1684, driven by a dual H-Bridge motor driver, L298) has 400 steps per revolution and the rod has a standard M8 metric thread with a pitch of 1.25 mm, enabling the theoretical longitudinal resolution \(\Delta x=3.125\,\upmu\text{m}/\text{step}\). We recommend determining \(\Delta y\) using the Calibrate feature of our software such that measuring the pitch of the thread can be avoided. Here, the slider moves to one of the photosensors, stops and asks the user to mark the initial position of the slider. Next, the slider moves towards the other photosensor while the number of steps is counted by the control software. Once the slider has stopped, the user is asked to measure the displacement from the initial position and to enter that displacement in a pop-up window. The software calculates \(\Delta y\) (in our case, 3.123 \(\upmu\text{m}/\text{step}\)) and saves the value in a configuration file such that it can be used for future measurements. The entire device uses the metric system, but we emphasize that it is, effectively, unit blind; i.e., if the separation is entered in inches, everything will be measured in imperial units, even though the GUI would show metric units. The calibration procedure does not rely on anything particular regarding the pitch of the threaded rod. We use a standard metric M8 thread for convenience, even though the resolution could be more than doubled with a metric M8x0.5 thread. Since we envision the main application of the magnetometer to be for characterizing macroscopic coils, increasing resolution even further provides no added benefit. The Hall sensor is the key component of our magnetometer as it is responsible for detecting magnetic fields. To ensure accurate measurements, we have used a commercially available Hall sensor chip (MMC598 SMA) integrated with an electronic board. The MMC598 SMA is a 3-axis, 18-bit Hall sensor board with an operational range of \(\pm 8\,\text{G}\) and a total RMS noise of 0.4 mG. It has an internal degaussing function, which is used to remove any residual magnetization that may arise, such as from overexposure (when the magnetic field exceeds \(\pm 8\,\text{G}\)), and is realized by the Hall sensor by sending a 500 ns current pulse upon receiving a SET command. Once overexposed, every single measurement that follows cannot be trusted; therefore, degaussing is performed before every readout such that, once the field drops within the sensor's range, the measured values become reliable again and one does not lose data. The RESET function has a similar role to the SET function, but it also flips the polarization of the sensor. Each single measurement is composed of four commands: SET (degaussing), MEASURE (read out bit values from the sensor), RESET (flip the polarization of the sensor and degauss) and MEASURE (read out bit values from the sensor that is now oppositely polarized). This approach removes thermally induced offset errors and eliminates residual magnetization caused by strong external fields (Equation (4)), particularly useful if the sensor has been saturated during the measurement. To asses how good the noise performance of the sensor actually is, we have measured the magnetic field 1000 times after shielding the sensor with \(\mu\)-metal and we have obtained the RMS noise equal to 0.19 mG, 0.23 mG and 0.27 mG for the \(x,y\) and \(z\)-axis, respectively. Alternative Hall sensors with degaussing and polarization flipping features that are compatible with the I\({}^{2}\)C protocol can be implemented in our automated magnetometer (e.g., MMC5633 NJL-B, which extends the measurement range to \(\pm 30\,\text{G}\)).