# Open-Source Magnetometer for Characterizing Magnetic Fields in Ultracold Experiments
## 3 Experimental Setup
### Software  
The 'Telemetrix' firmware has its API package built for Python 3 programming language. By using the API functions in this package, one can send commands to the Arduino for executing specific tasks. The firmware supports synchronous and asynchronous programming. Asynchronous operations are considered to be an advanced programming method for performing tasks concurrently without blocking the execution of other running  
Figure 2: Schematic of the connections for the electronic components of the automated magnetometer. The Arduino Mega is controlled by a computer via a USB serial connection.  
tasks. By utilizing techniques such as event loops and callbacks, asynchronous programming enables the program to initiate tasks and continue execution without waiting for their completion. This concurrent execution approach improves resource utilization and responsiveness, especially in situations involving waiting for external events or performing I/O operations. In synchronous programming, tasks are executed in a sequential manner, where each task must finish before the next one can begin. This can introduce delays if a task takes a significant amount of time to complete as subsequent tasks have to wait their turn. Sensors that only work with I\({}^{2}\)C protocol can be difficult to integrate into a program that requires fast readouts. The I\({}^{2}\)C protocol can be described as a query-based protocol. In I\({}^{2}\)C communication, the master device initiates communication by sending a query or command to the slave device. The slave device then responds with the requested data or performs the requested action. In synchronous programming, the requested data are often handled with the threading method, where a thread of the processor is assigned to report request data. Asynchronous programming, characterized by the efficient utilization of event loops, offers significant advantages in scalability compared to synchronous threading. Event loops, such as the one used in asynchronous programming, facilitate the execution of multiple tasks efficiently by minimizing resource usage and reducing task creation time. In our specific case, these benefits can be leveraged in the implementation of functions related to the Hall sensor and stepper motor driving. This is particularly important when dealing with long-running operations, such as I/O operations or network requests.  
To compare the readout time for synchronous and asynchronous programming, we measured the time required to retrieve readouts. Therefore, after the first readout, a second one is obtained with a flipped sensor polarization to calculate the offset introduced by the sensor itself (see Equation (4c)). We have collected 10,000 data points (20,000 readouts in total) for each mode to compare the two programming approaches and have determined that the average time per single data point is 186 ms for synchronous programming and 93 ms for asynchronous programming. These results indicate that the use of asynchronous programming significantly reduces the time required for data retrieval in real-time applications that benefit from fast readouts while guaranteeing a high level of flexibility in implementation of alternative hardware, like a different Hall sensor model.