Design and Experimental Validation of a Cloud-Based Web-Controlled Measurement System for Magnetic Flux Leakage-Based Diagnostics ()
1. Introduction
Machine-to-machine (M2M) refers to autonomous communication between computers, embedded systems, smart sensors, actuators and mobile devices without or with limited human intervention [1]. Advancements in radio frequency identification technology (RFID), wireless sensor networks (WSN) [2], embedded systems, wired and wireless networks, as well as reduction in transmission costs [3] have accelerated the development of M2M systems [4]. According to the Internet of Things (IoT) terminology, three interconnected common technologies lay the foundation for M2M communications. These are wired or wireless sensors, transport networks, and application servers in the cloud [5]. Smart sensors embedded in devices capture various physical phenomena (pressure, temperature, fluid quality or flow, velocity, magnetic field, vibration, brightness, etc.) and transmit them to relevant applications. These devices are often located over long physical distances and may include wireless adapters to transmit data through data networks to a centralized or distributed application server that will process and transform the data into meaningful information [6]. Beyond connectivity, M2M devices offer a high-processing-power architecture, a robust high-end operating system (OS) or a real-time operating system, large amounts of memory and long battery life [7].
Remote surveillance [8], health and environmental monitoring [9]-[12], smart grids [13], smart cities [14] [15], smart homes [16]-[18], traffic safety and intelligent transportation [19]-[22], smart retail [23], personal navigation, e-payment and industry automation [24], aviation management [16] [25], energy management [26] [27], data security management [28]-[30] and smart education (inclusive education) [27] are among well-known examples of M2M communication [6]. Recent studies in the literature have focused on new application areas utilizing M2M technology and addressing its shortcomings. New applications include plant breeding systems [31], weather (fog) detection systems, smart building construction research and development [32], trash bin monitoring and control systems [33], Tap Water Supply Alert Systems [34], Blockchain-Based Payment Mechanisms [35], M2M Autonomous Charging Infrastructures [36] and 5G wireless network applications [37]. Studies on topics such as open source database management systems [38], visible light communication (VLC) based communication systems [39], intelligent forensic analysis mechanisms [40], use of SQL Server, a popular database management system, in M2M communication [41], development of M2M compatible sensor technologies [42], integration of laser-based optical wireless communication (OWC) with fiber sensor systems [43], identity-based encryption of e-health cloud systems [44], network traffic prediction [45], data privacy protection in e-health applications [46], priority-based resource allocation in Long-Term Evolution (LTE) networks [47], effects of network protocols in industrial communication [48] and classification of security issues in M2M communication [49] have also focused on overcoming the shortcomings of the M2M technology.
Despite the breadth of IoT/M2M deployments, there is a lack of cloud-based, web-controlled multisensor measurement platforms tailored to academic experimentation that i) orchestrate precise five-axis (5D) sensor positioning, ii) support real-time acquisition, cloud storage, and live visualization, and iii) provide quantitative, reproducible performance evidence under a controlled case study.
This study aims to develop a cloud-based, web-controlled multisensor measurement platform using a smart-sensor architecture and a 5D scanner for precise sensor positioning; enable real-time acquisition, cloud storage, and live visualization (Arduino Mega 2560 + Raspberry Pi + Node.js + Firebase) with remote start and streaming; validate the platform via a Magnetic Flux Leakage (MFL) case study on buried ferromagnetic objects to demonstrate end-to-end operation; and quantify performance with concrete metrics reported in this paper (scan area 50.0 × 40.0 cm, step size 0.5 cm, 2 s dwell per step, ~8000 samples per object; 10-bit ADC with a 4.88 mV step and an effective resolution of ≈24 mV set by the observed baseline jitter; remote command-to-start latency < 100 ms; localization of prismatic and cylindrical samples in two demonstration cases).
Machine-to-machine (M2M) communication is an important technology for industrial Internet of Things (IIoT) applications and academic studies, which began with the fourth phase of the industrial revolution (Industry 4.0). A review of the literature reveals that the integration of M2M technology into academic experimental measurement systems is quite uncommon due to high cost and special experimental conditions (sensor type, data resolution, experimental environment, variability of sensor position control, etc.). The software for said system, which is an M2M application, has been developed using Node.js, an open-source, server-side application generally used in networked applications. Thanks to the developed software, wired and wireless communication was established with the sensors on the 5D scanner; location information and sensor data were collected via Arduino Mega 2560 and Raspberry Pi, saved to the Firebase cloud database and plotted in real time. All the details of the operation of the developed measurement system are explained in the paper, and the operation of the system is demonstrated with a case study using a type of analog sensor. The operation of the system was also tested with a case study in which an analog sensor was used. In the sample case, ferromagnetic objects were buried under the soil, and the change in magnetic field values of the region due to the anomaly created by the objects in the Earth’s magnetic field was determined by measurement. The measurement data were analysed with the algorithms added to the system, and the points where the objects were located under the soil were determined. Thus, the correct operation of the system was proved. Although many magnetic materials were tested in the study, the results of a prismatic and a cylindrical material are presented in the article.
2. Material and Method
A remote-controlled measurement system based on M2M technology was developed within the scope of the study, which can be used in all academic science and engineering branches, controlling a 5D scanner system, collecting data from analog and digital, wired and wireless sensors that can be installed on this system, saving them to the cloud and converting them into graphics. The developed system consists of two separate parts: a server where the remotely connected researcher controls the system and sees the results, and a part where measurements are performed. In Figure 1, these two separate parts are presented with their hardware and communication technologies and the dataflow block diagram of the measurement system.
Figure 1. Block diagram of the developed M2M system and dataflow.
As seen in Figure 1, the user controls the system via a web interface. This web interface was developed using HTML, CSS, JavaScript and the React Framework. React is a comprehensive framework developed by Facebook for building user interfaces. A responsive design has been provided to enable users to easily control the system via both mobile devices and computers. Views of the system’s web interface from a mobile phone and a computer screen are shown in Figure 2.
As seen in Figure 2, the “Movement Options” section in the system’s web
Figure 2. (a) Mobile device view; (b) Computer screen view of the web interface developed for the system.
control interface allows the user to choose which of the 5 axes to measure. The same section also provides the user with the option to determine how many steps to measure in the selected axes and how much distance to move in each step. The “Sensors” section in the web control interface allows the user to select which sensors are connected to the system and through which ports they are connected. Following such operations, the measurement process is started using the “Start Measurement” button.
To start the measurement process, a WebSocket connection is established between the web interface and the management software running on the server. WebSocket connection enables very fast data flow in real time [50]. The connection is written in Node.js. The settings constitute the command to start the measurement, and all other data streams are transmitted in JSON format. An example start measurement command is shown below.
{ "start":1, "x":30, "y":20, "xstep":0.5, "ystep":0.5,
"pins": [ {"type": "digital", "port_number": 15, "name": "D1"}, {"type": "digital", "port_number": 16, "name": "D2"} ]}
The system utilizes a virtual computer as a server (VPS-Virtual Private Server). Said computer runs continuously and has a broadband Internet connection. The server also has a 4-core processor, 8 GB of memory and a connection speed of 1 Gbit/s. The web interface through which the system is controlled is published by this server. However, the measurement unit also remains connected to the server whenever it is active. Through said connection, the server informs the researcher via the web interface whether or not the measurement system is currently active. The server also connects to the Firebase real-time database to record the data of the measurements made, reads the recorded data and transmits the same to the web interface to be converted into graphs and displayed to the researcher. Firebase real-time database is a cloud-based NoSQL database [51].
The measurement unit consists of a Raspberry Pi, a 5D scanner system and sensors connected to the system. The sensors and the scanner system are controlled by two Arduino Mega microcontrollers. The measurement unit also establishes a WebSocket connection with the server. The command-to-start latency was measured as the round-trip time of ping-pong frames over the established WebSocket connection between the web client and the Raspberry Pi; all measured values remained below 100 ms. This value refers only to command delivery over the WebSocket link and excludes the 2 s sampling dwell per step and the browser display delay. The measurement unit is managed by a Raspberry Pi, a mini computer [52]. Management software was developed using Node.js, which runs on a Raspberry Pi.
The management software basically fulfills three functions. Its first function is to transfer commands from the web interface via the server to the browser system. In order to achieve this function, it generates the necessary G codes according to the axes to be measured and the step sizes thereon, sequentially sends such codes to the Arduino Mega and ensures that the scanner system moves accurately. An example G code required for the scanner system to initiate motion and move 1 cm in the x direction is presented below.
G91G90 X10
In the scanner system, the movement of the sensor platform in 5 axes is provided by stepper motors with a holding torque of 1.85 Nm and a 200 step/turn (1.8˚ step angle) ratio. The driver control of the stepper motors (ZM-2H504) is provided by the second Arduino Mega microcontroller (Figure 3). This Arduino Mega controls all motors via the GRBL open-source software. This software moves the motors according to the G-codes received by the Arduino Mega from the Raspberry Pi.
Figure 3. (a) Arduino Mega connection with ZM-2H504 stepper motor drivers; (b) 5D scanner system.
The second function of the management software is to take measurements from the selected sensors after each step of the scanner system. All sensors on the scanner system are connected to the Arduino Mega via an amplifier interface (Figure 4). The connection to this hardware is established using a library named Johnny-Five [4]. Thanks to the library, data from all analog and digital ports on the Arduino Mega can be easily read via serial connection. An example analog and digital port reading code is shown below.
pins[0] = new five.Sensor({ pin: "A2", freq: 100, type: "analog", threshold: 5})pins[0].on('data', function() { measurement.sensor[0].cur_value = this.value })
During baseline calibration (probe stationary, all axes disabled), the raw 10-bit ADC output exhibited random jitter of about 5 counts (1 LSB ≈ 4.88 mV at a 5 V reference), i.e., ≈24 mV; therefore, the Johnny-Five threshold was set to 5 counts to suppress sub-24 mV fluctuations in UI/stream updates, while all raw samples were retained for analysis.
The last function of the management software is to transmit the data collected from the sensors back to the server. Such data transmission is made in JSON format over the already established WebSocket connection. An example of the return data is shown below.
Figure 4. (a) Sensor platform on the scanner system; (b) Amplifier interface, Arduino Mega and Raspberry Pi connection.
{ "xstep":1, "ystep":5, "data": [ {"type": "digital", "port_number": 15, "name": "D1", "value":15.7}, {"type": "digital", "port_number": 16, "name": "D2", "value":15.8} ]}
3. Case Study for the System
In this section of the study, the developed measurement system is tested on a selected case study, and the results are presented. The case study aims to remotely determine, in real time with the help of an analog fluxgate sensor, the magnetic anomalies caused by objects with ferromagnetic characteristics which are buried in the soil, in the Earth’s magnetic field and to determine the positions of the objects. No external magnetizing field was applied; the buried specimens are magnetized by the Earth’s magnetic field alone, and the resulting leakage flux was measured with the fluxgate sensor (Earth-field-induced, passive MFL). First, 30.0 cm-high soil was placed under the 5-axis scanner system in a chamber with dimensions of 90.0 × 90.0 × 45.0 cm. After that, the American Iron and Steel Institute’s AISI 1030-coded manufacturing steels of various sizes and shapes were placed in the centre of the chamber at a depth of 1.0 cm from the soil surface. Figure 5 shows the sample objects (prismatic and cylindrical) and the measurement system.
TE100 fluxgate sensors (specified accuracy at 20˚C: ±(2% of reading) ± 0.3 µT), which are analog magnetic units, were preferred for the case study. The analog ports of these sensors are connected to the Sensor Agent in the “Measurement System” following a differential amplification interface shown in Figure 6. Finally, the Raspberry Pi running the control software was connected to the Internet, and the management software was run. The infrastructure required for the testing process is thereby fully prepared.
In the subsequent step, the web interface controlling the measurement system
Figure 5. (a) (b) Ferromagnetic objects; (c) Position of the objects in the soil chamber.
Figure 6. Differential amplification circuit.
was accessed to start the test process and sensor adjustments were made by moving the 5-axis scanner. Since the objects were buried parallel to the soil surface, it was thought that moving the scanner in the X and Y axes would be sufficient to determine the centres and shapes of the objects. A scanning area of 50.0 × 40.0 cm was set so that the objects would remain in the center of the scanning area, and adjustments were made on the web interface to scan at 0.5 cm intervals in both axes (Figure 7).
In the next step, the sensor settings were made using the web interface. In the system, the sensor connected to analog pin A0 of the Sensor Agent is designated as the measurement sensor. Therefore, a setting was made via the Web interface as shown in Figure 7(a).
Finally, following completion of all settings, the measurement process was initiated. Measurements were taken after waiting for 2 seconds at each step taken within the scanning area. This ensured a stable state for the sensor platform connected to the scanner system, thereby preventing vibration-induced errors. At the end of the measurement process, a total of 8000 sensor data points were obtained for each object, corresponding to a 100 × 80 measurement grid with 0.5 cm spacing in both axes (the starting edge of the scan area included and the far edge excluded), with one measurement retained per position, and these data were saved in JSON files on the Raspberry Pi. The data were also instantly recorded in Firebase and presented as graphs and tables in the web interface monitored by the researcher, as shown in Figure 8.
Figure 7. (a) Web interface settings of the scanner system; (b) Movement of the sensor platform in the scanning area.
Figure 8. Tabular and graphical representation of sensor data.
In addition, snapshots of the web interface and the mobile application showing the data collected when the sensor reached x = 10.0 cm, x = 20.0 cm, x = 30.0 cm, x = 40.0 cm and x = 50.0 cm, respectively, were taken during the experiment and are presented in Figure 9.
Figure 9. Snapshots of the web interface and mobile application at (a) x = 10.0 cm, (b) x = 20.0 cm, (c) x = 30.0 cm, (d) x = 40.0 cm, (e) x = 50.0 cm.
Measurement procedures were carried out separately for each object. After the completion of the measurement processes, the data were analysed on the developed system. All measurement and analysis steps are given in Figure 10. In addition, all analysis steps for a sample object are presented in the following section.
In the analysis phase, first, an attempt was made to eliminate the noise in the sensor voltage values due to the magnetic character of the soil, which is clearly seen in the graphs of the measurement data. For this purpose, a moving average filter was applied to the measurement data. In this filtering process, the original sorted value is replaced by the average value of a specified number of its neighbours. In this study, a value of 5 was used as the neighbourhood interval for moving average filtering. In other words, the original value is replaced with the average value of the neighbouring values within 2 units. The interval of 5 was selected on the basis of our previous studies and experience with similar magnetic measurements; it was tested and provided satisfactory noise suppression in the present data. For example, when this filtering process is applied to the location (3, 3), the original value of 0.8554 is replaced by 0.8582, calculated as the arithmetic mean of the 25 values within the 5 × 5 neighbourhood.
![]()
Figure 10. Process steps in the analysis.
Since a value of 5 was taken as the neighbour interval in the filtering, the moving average filter was not applied to the two data points on the edge of the matrix. These data were replaced with the mean value of the nearest neighbouring data after the moving average filtering process. The first measurement surface plot for the sample, the surface plot of the moving average filtered sensor voltage values and the progress of the filtering process are presented in Figure 11.
Figure 11. Pre-processing, processing and output of the moving average filter.
Figure 11 shows that there are small changes in the horizontal component of the Earth’s magnetic field due to the magnetic character of the soil in the regions outside the sample, and this changes the sensor voltage values. When the square matrix of the sample is analysed, it is determined that these voltage values are not the same at every point in the soil, but they are close to each other at different points. A base filter was developed to remove this voltage value, which is noise that prevents the detection of the sample. By using the base filter, the average of the voltage values in the top and bottom rows and the left and right columns of the matrix was subtracted from each voltage value in the matrix (Figure 12). Subsequently, for all samples, the mean of all values was subtracted from each value, and the absolute value of the result was taken. Finally, the threshold filter was applied to determine the approximate boundaries and the exact position of the object within the scanning area. In this filter, values of 0 were left as 0 and values different from 0 were changed to 1 (Figure 12).
![]()
Figure 12. (a) Moving average; (b) Base filter; (c) Thresholding filter output; (d) Top view for Sample 13 and Sample 45.
4. Results and Discussion
A measurement system based on M2M technology (using a smart sensor structure and compatible with all sensor types which provide analog or digital output, including a 5D scanner system for sensor position control) was developed within the scope of this study. Furthermore, the operation of said system was validated with a case study. The use of Arduino Mega as the Sensor Agent in the developed system allowed reception of sensor data with 10-bit resolution, and data could therefore be displayed remotely in real time on the web interface with a resolution of one ADC step, i.e., 4.88 mV at the 5 V reference (210 levels). Consistent with this, the baseline jitter of ≈5 ADC counts (≈24 mV) observed during calibration defines the effective resolution of the present configuration. The sensitivity of the system can be increased by using ADCs of various resolutions (12, 24, 32 bits, etc.) between the Arduino Mega and the analog sensor. For instance, the nominal step size of a 24-bit ADC at a 5 V reference is ≈298 nV; however, the achievable sensitivity is lower, since it is limited by noise and the effective number of bits (typically 19 - 21 noise-free bits in practice). Such data resolution would be sufficient for all academic science and engineering disciplines. It should be noted that the digital inputs of the Arduino Mega should be used for data resolutions other than 10-bit. In addition, when a digital sensor is used in the system, the measurement data will be limited to the sensor output resolution. The web interface and management software developed within the scope of the study are posted at https://github.com/huseyingunes/measurement_online, accessible to the academic community. This aims to ensure that experimental academicians can perform data collection and evaluation processes remotely with minor changes (such as resolution, amplification stage of the amplifier interface). Moreover, the web interface and management software developed within the scope of this study can be used not only in academic experimental studies but also in many applications, such as smart grids [13], smart cities [15], smart homes [18], smart transportation [22], industrial automation [24] and energy management [27], where analog and digital sensors play an active role.
There are two major sources of error in the system: the first arises from the sensor itself, and the second from the data acquisition resolution. The TE100 analog sensors used in the system have an error margin of ±0.3 µT, corresponding to approximately 6 mV. In addition, since the analog data are sampled via Arduino with a 10-bit resolution, variations of 4.88 mV are recorded in the database.
Compared with recent IoT-enabled magnetic sensing work, our platform targets spatially resolved experimentation rather than single-point monitoring or authentication: industrial prototypes typically pair a Raspberry Pi with a Hall sensor for real-time field tracking and cloud upload but do not report scan-level granularity, whereas we add programmable 5D positioning and MFL-based localization over a defined grid [53]. In security scenarios, MagSign leverages dynamic magnetism for user authentication and reports low error rates (FAR 0.38%, FRR 3.13%), while our goal is area mapping and target localization rather than identity verification [54]. Broad surveys and reviews underline both the ubiquity of Hall/AMR/GMR/TMR sensors across IoT applications and a trend toward higher-sensitivity GMR/TMR in industrial use—trends our sensor-agnostic, cloud-controlled architecture can accommodate via plug-in heads and higher-resolution ADCs [55] [56].
Our results stem from a lab-scale tank with shallowly buried samples, a single fluxgate channel read by a 10-bit ADC, and X-Y raster scans under a cloud-connected pipeline with lightweight filtering; we did not quantify temperature/EMI effects, long-duration drift, or absolute localization against an external ground truth.
5. Future Work
Next, we plan to integrate ≥24-bit ADCs and alternative magnetic sensors (including gradiometers), enable 3-D scanning and inversion-based depth estimation, adopt adaptive scanning and auto-calibration (tilt/temperature), harden edge/offline operation for intermittent links, and perform broader field validations over varied soils and depths with standardized reporting.