# A Novel Tilt and Acceleration Measurement System Based on Hall-Effect Sensors Using Neural Networks

Authors: Majid Nour; Nihat Daldal; Mehmet Fatih Kahraman; Hatem Sindi; Adi Alhudhaif; Kemal Polat
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

A tilt sensor is a device used to measure the tilt on many axes of a reference point. Tilt sensors measure the bending position according to gravity and are used in many applications. Slope sensors allow easy detection of direction or slope in the air. These tilt gauges have become increasingly popular and are being adapted for a growing number of high-end applications. As an example of practical application, the tilt sensor provides valuable information about an aircraft’s vertical and horizontal tilt. This information also helps the pilot understand how to deal with obstacles during flight. In this paper, Hall-effect effective inclination and acceleration sensor design, which makes a real-time measurement, have been realized. 6 Hall-effect sensors with analog output (UGN-3503) have been used in the sensor structure. These sensors are placed in a machine, and the hall sensor outputs are continuously read according to the movement speed and direction of the sphere magnet placed in the assembly. Hall sensor outputs produce 0–5 Volt analog voltage according to the position of the magnet sphere to the sensor. It is clear that the sphere magnet moves according to the inclination of the mechanism when the mechanism is moved angularly, and the speed of movement from one point to the other changes according to the movement speed. Here, the sphere magnet moves between the hall sensors in the setup according to the ambient inclination and motion acceleration. Each sensor produces analog output values in the range of 0–5 V instantaneous according to the position of the spheroid. Generally defined, according to the sphere magnet position and movement speed, the data received from the hall sensors by the microcontroller have been sent to the computer or microcomputer unit as UART. In the next stage, the actual sensor has been removed. The angle and acceleration values have been continuously produced according to the mechanism’s movement and output as UART. Thanks to the fact that the magnet is not left idle and is fixed with springs, problems such as vibration noises and wrong movements and the magnet leaning to the very edge and being out of position even at a slight inclination are prevented. In addition, the Hall-effect sensor outputs are given to an artificial neural network (ANN), and the slope and acceleration information is estimated in the ANN by training with the data obtained from the real-time slope and accelerometer sensor.


---

## Body

## 1. Introduction

A tilt sensor is used in situations where accurate positioning or continuous monitoring of the angle concerning gravity is required. The tilt sensor measures the angle relative to a horizontal position so that an imaginary line from the center of the earth serves as a reference [1, 2]. Tilt sensors are in demand in many industrial applications, from robotics to construction, and a wide range of uses. Due to this general application area, inclination sensors with different operating principles have been studied both theoretically and experimentally. This type of tilt sensor has been reported in the literature’s magnetic, inductive, capacitive, and optical research [1–6]. In addition, some research has been done on magnetic and inductive type inclination sensors designed using magnetic fluid and magnets [2–8].Acceleration sensors are electromechanical elements used to measure acceleration, vibration, and mechanical shock values. Acceleration sensors have different methods of operation. Some acceleration sensors use the piezoelectric effect. The microscopic crystal structures they contain are stretched with accelerating force; this allows voltage to be generated. Another way is to perceive the change in capacity. A capacitive effect occurs between two microstructures close to each other, and the capacitance value is revealed. Capacitive Accelerometer: The capacitive transmission principle is used. A diaphragm is used as the seismic mass. When an acceleration occurs, the distance between the stationary electrode and the seismic electrode changes. As the distance changes, the capacitance changes, and a proportional output is obtained with acceleration [9, 10].Tilt sensors are generally hollow cylindrical shapes. However, there are also noncylindrical shapes. Inside this cavity is a freely moving conductive material. This substance can be a mercury drop or a spinning ball. There are poles made up of two conductors at one end of the recess. When the sensor is bent, the conductive moving material comes to this end, and the two conductors short-circuit. Mercury was used quite often in older tilt sensor applications. However, due to its excessive toxicity, the use of mercury tilt switches has decreased considerably today. The advantage of using mercury is that the drop is dense enough and does not bounce. In this way, the key is not affected by vibration.On the other hand, ball-shaped sensors are easy to produce, do not crack, and do not cause environmental pollution. In addition, although tilt sensors may not work as accurately as accelerometers, they can measure motion and orientation. Another advantage is that large enough tilt switches can self-power control. On the other hand, accelerometers have an analog or digital output, and extra circuitry is required to analyze the results [10–12]. Figure 1 shows a commercially available tilt and angle sensor [10].Figure 1
A commercially available tilt and angle sensor [10].Allison DeGraff et al. designed a new tilt sensor using ferrofluid [10]. Their proposed sensor design uses the motion of an induced ferrofluid through a transformer installation that senses induced voltage in a sensing coil due to device tilting [10].Acceleration sensors have analog and digital output types. Acceleration sensors with analog output give a continuous voltage depending on the acceleration value. Digital acceleration sensors are available in models that support various interfaces for output (I2C, SPI, UART, etc.…) and models that output in a modulated manner (e.g., PWM) [9]. Olaru and Dragoi proposed a new tilt sensor based on four magnets and a magnetic fluid [4]. The acceleration sensor is one of the sensors that has become very important due to the development of MEMS technology. The acceleration sensor is an element that senses and measures the acceleration and produces an electrical (analog or digital) output voltage proportional to the value of the acceleration. Acceleration occurs when there is a change in the velocity of the object or the direction in which the speed is directed. In addition to acceleration, an accelerometer is used to measure variable states such as impact, vibration, rotation, and tilt [13, 14].The output signal of an accelerometer needs operations such as offset, boost, and filtering. For acceleration sensors with analog output voltage, the output signal can be positive or negative voltage depending on the direction of the acceleration. As with other sensors, the value for the analog-digital converter must be scaled and/or increased to achieve the maximum gain [14, 15]. Acceleration and tilt information measurement was provided by using the position of the magnet placed at the center point of the developed system to the axes and the change in movement speed. The position information measurement to the axes is determined by the information obtained from the six Hall-effect sensor outputs placed around the magnet.Accelerometers measure the static (gravity) or dynamic (sudden acceleration or stopping) acceleration falling on them. The value we get from the sensor can be expressed as m/s2 or gravity (g force). In applications, it is generally expressed in terms of gravity. If it is not in space or within the scope of any gravitational field, a 1 g gravitational force acts on the sensor. This value is approximately 9.8 m/s2 and varies according to the point in the world. Since the sensor is constantly under the influence of gravity, it can be used as an inclinometer. It is expressed with values such as ±1 g, ±2 g, ±4 g, etc., as a measurement scale, and some derivatives can measure in one, two, and three axes [16].There is no gravitational effect in space and the weight is 0. When there is a sphere in a box, when there is no gravitational effect, the sphere remains motionless without touching any surface. When the box is accelerated with a force of 1 g in the +X direction, the globe exerts a force of 1 g on the −X surface of the box due to inertia. When the box is placed on the ground, it exerts a 1 g force on the sphere –Z surface due to the Earth's 1 g gravitational force [16].When the angle of the sensor with the Earth changes, the force applied to the axes of the sensor changes, and the angle made with the Earth is calculated by trigonometry by reading the surface pressure values; for example, when the box is turned 45 degrees to the right, a force of 1⁄2 in the root is applied to the sphere’s –X and –Z surfaces, equal to 0.707 g [16].Considering the 3 axes together,R is the resultant vector length:(1)R2=Rx2+Ry2+Rz2.It is calculated with the formula. If theRx, Ry, and Rz components are known, the angles of the R vector with the X and Y axes can be calculated with the help of trigonometric functions, as can be seen in Figure 2, and the position of the sensor relative to the Earth can be calculated. The conversion of these values to angles is(2)CosAxr=RxR,Axr=arccosRxR,CosAyr=RyR,Ayr=arccosRyR,CosAzr=RzR,Azr=arccosRzR.Figure 2
Accelerometer sensor structure and obtaining thex-y-z value.Axis angles are calculated with their formulas [16].In this study, since it is difficult for the sensor to detect the pressure of all sides of the box surface in existing sensor productions, as a more practical solution, it is based on the evaluation of the sensor output data according to the approach situations of the Hall-effect sensors on the outer parts of the sensor of the sphere fixed in the center.The primary purpose is to obtain the acceleration and slope information with high accuracy with the sensor structure to be developed. The data received from 6 multiplaced Hall-effect transformer sensors around the system has been sent to the computer and evaluated with the ANN (Artificial Neural Network) model running on the computer. At this stage, our existing system structure has been created by using the target value of the slope and acceleration information obtained from the actual sensitive inclination and acceleration sensors as the output data of the ANN as the target value, and the system has been developed without the need for the slope and acceleration sensors that we use as the target and the inclination and acceleration information with high accuracy produced.In addition, for the ANN (Artificial Neural Network), different network methods were used to compare the prediction accuracy between these structures. By testing the system size and spring lengths at different rates, the effect on the measurement results will be examined, and the most appropriate length of the spring has been selected. According to the input values from the obtained network structure, the result values have been modeled with a microcontroller to be added to the system. Thus, the measurement values have been obtained with the microcontroller without the need for a computer.The rest of this study is organized as follows: The details of methods are given in Section2. The experimental results and discussion are presented in Section 3. Lastly, concluding remarks are given in Section 4.


## 2. The Proposed Measurement Method

This paper implements a Hall-effect effective tilt and acceleration sensor design for real-time measurement. 6 Hall-effect sensors (UGN-3503) with analog output are used in the developed sensor structure. These sensors are placed in a mechanism, as seen in Figure3, and the cube magnet placed in the assembly is placed in the assembly with four springs. With the movement of this system developed here according to the slope of the environment, the cube magnet will move with the acceleration of gravity and apply different amounts of force to the springs and the distance of the cube magnet to the Hall-effect sensors will change according to the tension and pull of the springs. According to the distance ratio of the magnet to the hall sensors, an analog voltage in the range of 0–5 V is read from each sensor output. When the mechanism is moved angularly, the movement speed of the cube magnet changes from one point to another point according to the movement speed of the mechanism. Here, the cube magnet moves between hall sensors in the setup according to the ambient inclination and motion acceleration. Therefore, each sensor instantly produces analog output values in the range of 0–5 V according to the cube magnet position.Figure 3
Schematic representation of the developed sensor assembly.The block diagram of the system made in the paper is shown in Figure4. Generally defined, according to the cube magnet position and movement speed, the data received from the hall sensors with the microcontroller are sent to the computer or microcomputer unit as UART; according to the input data with the artificial neural network created in the computer unit, the acceleration values from the real sensors and the inclination values from the inclination sensor are target. Determining and training the network, an output that gives acceleration and slope value is produced. In the next stage, the real sensor was removed, and the acceleration and slope values were continuously produced in real-time according to the mechanism’s movement and sent to the output as UART.Figure 4
Block diagram representation of the system proposed in the paper.The proposed solution consists of 6 work packages (WPs, or steps). The first work package includes Hall-effect sensors placement and magnetic dimensions. In the second work package, the model was created by applying the voltage outputs of the Hall-effect sensors to the input of artificial neural networks. The third work package obtained actual (reference) tilt information with an actual tilt sensor. In the training of artificial neural networks, real-time measurements have been made, as training is done to actual (reference) values. In the fourth work package, reference acceleration measurement values were obtained by performing real acceleration measurement. After the artificial neural network model was created in the fifth and gold packages, the estimated acceleration and slope measurements were obtained.It is the developed primary system consisting of 6 Hall-effect sensors, with a cube magnet in the middle and springs where the magnet is connected to the edges from 4 points. The stress force of the springs used here is 40 Mpascals. The microcontroller structure, in which instant measurements are made and the acceleration and slope information are output, is also placed under this system. First, the system was created mechanically in the solid-works program, and the stress and deformation tests in the springs were performed with reference to gravity acceleration according to the movement angles. According to the range of motion of the springs, the approach range of the magnet to the Hall-effect sensors was determined, and accordingly, the sensor output values were estimated. In the analyses, the spring and magnet weight data to move the magnet to the sensors in a maximum range of 5 mm were obtained. Figure5 shows the workflow chart of our paper.Figure 5
Workflow chart of our proposed method for measuring tilt and acceleration based on the hall effects.Step 1.
Hall-effect sensor placement.Step 2.
Magnet centering and mounting.Step 3.
Installation of spring to the main body and magnet.Step 4.
Modeling of system data by creating a computer and ANN network.Step 5.
Reading slope information from tilt sensor for ANN network slope output data.Step 6.
Reading acceleration information from actual acceleration sensor for ANN network acceleration output data.Step 7.
Integration of ANN network into microcontroller software and development Kalman filter.Step 8.
Sending acceleration and angle values with microcontroller USART.
We have given the details about the working packages in the proposed measurement system in the following subsections.


### 2.1. System Mechanical Design

It is the developed primary system consisting of 6 Hall-effect sensors, with a cube magnet in the middle and springs where the magnet is connected to the edges from 4 points. The stress force of the springs used here is 40 Mpascals. The microcontroller structure, in which instant measurements are made and the acceleration and slope information are output, is also placed under this system. First, the system was created mechanically in the solid-works program, and the stress and deformation tests in the springs were performed with reference to gravity acceleration according to the movement angles. According to the range of motion of the springs, the approach range of the magnet to the Hall-effect sensors was determined, and accordingly, the sensor output values were estimated. In the analyses, the spring and magnet weight data to move the magnet to the sensors in a maximum range of 5 mm were obtained.


#### 2.1.1. Step 1 Hall-Effect Sensor Placement

The UGN3503LT, UGN3503U, and UGN3503UA Hall-effect sensors accurately track minimal changes in magnetic flux density—changes generally too small to operate Hall-effect switches. Motion detectors, gear tooth sensors, and proximity detectors are magnetically driven mirrors of mechanical events. As sensitive monitors of electromagnets, they can effectively measure a system’s performance with negligible system loading while providing isolation from contaminated and electrically noisy environments [17, 18]. The UGN Hall-effect sensor is a 3-pin field-effect sensor that produces analog voltage according to the magnetic field strength. The sensor structure is shown in Figure 6. The sensitivity value is 1.30 mV/Gauss.Figure 6
Hall-effect sensor structure.Hall sensor output voltages according to angular displacements in the system and ADC values measured with the microcontroller are given in Table1.Table 1
Hall sensor output voltages according to angular displacements in the system and ADC values measured with the microcontroller.
AngleMagnet total movement4. Hall sensor output voltage10 Bit ADC value05,26 mm3,81 V780155,61 mm3,9 V797306,00 mm4 V818456,06 mm4.015 V821605,84 mm3,96 V810755,47 mm3,86 V789The data taken from a single sensor according to different angles in the system are shown in Table1. Here, the purpose of collecting data using a multisensor structure is to increase the power of accurate angle estimation by ANN analysis of the values taken from the Hall-effect sensors in 6 different positions of the system, even at lower angles.It is the main body of the sensor and is made about 3 cm in diameter. The sensors are placed at an equal angle, and the plane where the sphere magnet moves between the sensors is designed as a smooth surface. A microcontroller that measures the sensor data and delivers it digitally to the analysis layer is placed below this body. Figure7 shows the connection of the sensors to the microcontroller.Figure 7
Reading hall sensor outputs with microcontroller.With the MPU to be placed under the sensor plane, hall output values are measured with the ADC unit of the microcontroller and sent as UART in turn. Here, the microcontroller works at high speed.


#### 2.1.2. Step 2: Magnet Centering and Mounting

The units for the sphere magnet used in the system are shown in Figure8 [19].Br: Remanence field, independent of the magnet’s geometry,z: Distance from the sphere edge on the symmetry axis,R: Semidiameter (radius) of the sphere.Figure 8
Sphere magnet variables. Formula for the B field on the symmetry axis of an axially magnetised block or sphere magnet.(3)B=Br2.23.R3R+z2.The high magnetic field value of the magnet used in the system makes the sensor structure more sensitive.


#### 2.1.3. Step 3: Installation of Spring to the Main Body and Magnet

In mechanical systems subjected to dynamic loads, caliper springs are typically mechanical devices used to store energy. Helical springs can be found in two different configurations in parallel and in series in automated systems. For these cases, it is necessary to obtain an equivalent spring hardness. The determination of equal spring hardness for parallel connection is expressed as follows [19–23]. Parallel spring: as shown in Figure 9, the parallel spring configuration is located in a mechanical system, and the equivalent spring rigidity is calculated as follows.Figure 9
Spring variables and connection.In the mechanical system, the amount of migration in spiral springs that come in parallel is equal and has a value ofx. Therefore, the sum of the reaction forces of the springs is expressed in the equation below [19–23].(4)∑F=k1x+k2x+⋯⋯+knx=∑i=1nkix=keqx⟶keq=∑i=1nki.Spring stiffness calculation in helical springs under axial loading:Helical spring hardness depends on spring material and geometric factors:(5)keq=Gd48nD3,where G is the shear modulus, the number of active turns, d is the wire diameter, and D is the average spring diameter. Figure 10 shows spring connections.Figure 10
Magnet and spring connections to the assembly.


#### 2.1.4. Step 4: Modeling of System Data by Creating a Computer and ANN Network

Values from the sensor plane are applied as input to an ANN network. The best network condition was determined by changing the network properties in experimental studies (number of hidden layers, algorithms, methods, etc.). Network work was done on a computer with a programming toolbox; then the need for a computer was removed by modeling the ANN network with a high-speed microcontroller. Figure11 shows the transmission of hall sensor data to the ANN network according to the cube magnet position.Figure 11
Transmission of sensor data to the ANN network.


#### 2.1.5. Step 5: Reading Slope Information from Tilt Sensor for ANN Network Slope Output Data

When Step1 plane is moved angularly, the actual angle values were read from the sensor, making the exact precise angle measurement that will make the same movement. These values will be used as the angled target while training the net [20]. In Figure 12, the actual angle, slope, and acceleration values for the target are shown from the sensor.Figure 12
Reading angle and slope values.


#### 2.1.6. Step 6: Reading Acceleration Information from Real Acceleration Sensor for ANN Network Acceleration Output Data

When Step1 plane is moved angularly, the acceleration values were read from the sensor, making the actual precise acceleration measurement that will make the same movement. These values were used as the acceleration target while training the network. Figure 13 shows the real accelerometer sensor and data.Figure 13
Reading the acceleration values.


#### 2.1.7. Step 7: Integration of ANN Network into Microcontroller Software and Development of Kalman Filter

The angle and acceleration values obtained at the net outlet are cleaned from vibration values using the Kalman filter, and more stable output values are obtained. Kalman filter structure can be seen in Figure14 [21]. The aim here is to prevent data corruption in vibrations by getting constant values in sudden changes between the previous and subsequent values of the data.Figure 14
Reading the acceleration values.At this stage, the Kalman filter was obtained software in Step4 process step.


#### 2.1.8. Step 8: Sending Acceleration and Angle Values with Microcontroller USART

Finally, the stable angle and acceleration values are transmitted at 500 ms intervals to be sent to other units as USART. At this stage, the angle and acceleration values obtained as software after Step5 process were sent via USART communication. In USART communication, angle and acceleration values were instantly sent at 19200 bauds rate.


## 2.1. System Mechanical Design

It is the developed primary system consisting of 6 Hall-effect sensors, with a cube magnet in the middle and springs where the magnet is connected to the edges from 4 points. The stress force of the springs used here is 40 Mpascals. The microcontroller structure, in which instant measurements are made and the acceleration and slope information are output, is also placed under this system. First, the system was created mechanically in the solid-works program, and the stress and deformation tests in the springs were performed with reference to gravity acceleration according to the movement angles. According to the range of motion of the springs, the approach range of the magnet to the Hall-effect sensors was determined, and accordingly, the sensor output values were estimated. In the analyses, the spring and magnet weight data to move the magnet to the sensors in a maximum range of 5 mm were obtained.


### 2.1.1. Step 1 Hall-Effect Sensor Placement

The UGN3503LT, UGN3503U, and UGN3503UA Hall-effect sensors accurately track minimal changes in magnetic flux density—changes generally too small to operate Hall-effect switches. Motion detectors, gear tooth sensors, and proximity detectors are magnetically driven mirrors of mechanical events. As sensitive monitors of electromagnets, they can effectively measure a system’s performance with negligible system loading while providing isolation from contaminated and electrically noisy environments [17, 18]. The UGN Hall-effect sensor is a 3-pin field-effect sensor that produces analog voltage according to the magnetic field strength. The sensor structure is shown in Figure 6. The sensitivity value is 1.30 mV/Gauss.Figure 6
Hall-effect sensor structure.Hall sensor output voltages according to angular displacements in the system and ADC values measured with the microcontroller are given in Table1.Table 1
Hall sensor output voltages according to angular displacements in the system and ADC values measured with the microcontroller.
AngleMagnet total movement4. Hall sensor output voltage10 Bit ADC value05,26 mm3,81 V780155,61 mm3,9 V797306,00 mm4 V818456,06 mm4.015 V821605,84 mm3,96 V810755,47 mm3,86 V789The data taken from a single sensor according to different angles in the system are shown in Table1. Here, the purpose of collecting data using a multisensor structure is to increase the power of accurate angle estimation by ANN analysis of the values taken from the Hall-effect sensors in 6 different positions of the system, even at lower angles.It is the main body of the sensor and is made about 3 cm in diameter. The sensors are placed at an equal angle, and the plane where the sphere magnet moves between the sensors is designed as a smooth surface. A microcontroller that measures the sensor data and delivers it digitally to the analysis layer is placed below this body. Figure7 shows the connection of the sensors to the microcontroller.Figure 7
Reading hall sensor outputs with microcontroller.With the MPU to be placed under the sensor plane, hall output values are measured with the ADC unit of the microcontroller and sent as UART in turn. Here, the microcontroller works at high speed.


### 2.1.2. Step 2: Magnet Centering and Mounting

The units for the sphere magnet used in the system are shown in Figure8 [19].Br: Remanence field, independent of the magnet’s geometry,z: Distance from the sphere edge on the symmetry axis,R: Semidiameter (radius) of the sphere.Figure 8
Sphere magnet variables. Formula for the B field on the symmetry axis of an axially magnetised block or sphere magnet.(3)B=Br2.23.R3R+z2.The high magnetic field value of the magnet used in the system makes the sensor structure more sensitive.


### 2.1.3. Step 3: Installation of Spring to the Main Body and Magnet

In mechanical systems subjected to dynamic loads, caliper springs are typically mechanical devices used to store energy. Helical springs can be found in two different configurations in parallel and in series in automated systems. For these cases, it is necessary to obtain an equivalent spring hardness. The determination of equal spring hardness for parallel connection is expressed as follows [19–23]. Parallel spring: as shown in Figure 9, the parallel spring configuration is located in a mechanical system, and the equivalent spring rigidity is calculated as follows.Figure 9
Spring variables and connection.In the mechanical system, the amount of migration in spiral springs that come in parallel is equal and has a value ofx. Therefore, the sum of the reaction forces of the springs is expressed in the equation below [19–23].(4)∑F=k1x+k2x+⋯⋯+knx=∑i=1nkix=keqx⟶keq=∑i=1nki.Spring stiffness calculation in helical springs under axial loading:Helical spring hardness depends on spring material and geometric factors:(5)keq=Gd48nD3,where G is the shear modulus, the number of active turns, d is the wire diameter, and D is the average spring diameter. Figure 10 shows spring connections.Figure 10
Magnet and spring connections to the assembly.


### 2.1.4. Step 4: Modeling of System Data by Creating a Computer and ANN Network

Values from the sensor plane are applied as input to an ANN network. The best network condition was determined by changing the network properties in experimental studies (number of hidden layers, algorithms, methods, etc.). Network work was done on a computer with a programming toolbox; then the need for a computer was removed by modeling the ANN network with a high-speed microcontroller. Figure11 shows the transmission of hall sensor data to the ANN network according to the cube magnet position.Figure 11
Transmission of sensor data to the ANN network.


### 2.1.5. Step 5: Reading Slope Information from Tilt Sensor for ANN Network Slope Output Data

When Step1 plane is moved angularly, the actual angle values were read from the sensor, making the exact precise angle measurement that will make the same movement. These values will be used as the angled target while training the net [20]. In Figure 12, the actual angle, slope, and acceleration values for the target are shown from the sensor.Figure 12
Reading angle and slope values.


### 2.1.6. Step 6: Reading Acceleration Information from Real Acceleration Sensor for ANN Network Acceleration Output Data

When Step1 plane is moved angularly, the acceleration values were read from the sensor, making the actual precise acceleration measurement that will make the same movement. These values were used as the acceleration target while training the network. Figure 13 shows the real accelerometer sensor and data.Figure 13
Reading the acceleration values.


### 2.1.7. Step 7: Integration of ANN Network into Microcontroller Software and Development of Kalman Filter

The angle and acceleration values obtained at the net outlet are cleaned from vibration values using the Kalman filter, and more stable output values are obtained. Kalman filter structure can be seen in Figure14 [21]. The aim here is to prevent data corruption in vibrations by getting constant values in sudden changes between the previous and subsequent values of the data.Figure 14
Reading the acceleration values.At this stage, the Kalman filter was obtained software in Step4 process step.


### 2.1.8. Step 8: Sending Acceleration and Angle Values with Microcontroller USART

Finally, the stable angle and acceleration values are transmitted at 500 ms intervals to be sent to other units as USART. At this stage, the angle and acceleration values obtained as software after Step5 process were sent via USART communication. In USART communication, angle and acceleration values were instantly sent at 19200 bauds rate.


## 2.1.1. Step 1 Hall-Effect Sensor Placement

The UGN3503LT, UGN3503U, and UGN3503UA Hall-effect sensors accurately track minimal changes in magnetic flux density—changes generally too small to operate Hall-effect switches. Motion detectors, gear tooth sensors, and proximity detectors are magnetically driven mirrors of mechanical events. As sensitive monitors of electromagnets, they can effectively measure a system’s performance with negligible system loading while providing isolation from contaminated and electrically noisy environments [17, 18]. The UGN Hall-effect sensor is a 3-pin field-effect sensor that produces analog voltage according to the magnetic field strength. The sensor structure is shown in Figure 6. The sensitivity value is 1.30 mV/Gauss.Figure 6
Hall-effect sensor structure.Hall sensor output voltages according to angular displacements in the system and ADC values measured with the microcontroller are given in Table1.Table 1
Hall sensor output voltages according to angular displacements in the system and ADC values measured with the microcontroller.
AngleMagnet total movement4. Hall sensor output voltage10 Bit ADC value05,26 mm3,81 V780155,61 mm3,9 V797306,00 mm4 V818456,06 mm4.015 V821605,84 mm3,96 V810755,47 mm3,86 V789The data taken from a single sensor according to different angles in the system are shown in Table1. Here, the purpose of collecting data using a multisensor structure is to increase the power of accurate angle estimation by ANN analysis of the values taken from the Hall-effect sensors in 6 different positions of the system, even at lower angles.It is the main body of the sensor and is made about 3 cm in diameter. The sensors are placed at an equal angle, and the plane where the sphere magnet moves between the sensors is designed as a smooth surface. A microcontroller that measures the sensor data and delivers it digitally to the analysis layer is placed below this body. Figure7 shows the connection of the sensors to the microcontroller.Figure 7
Reading hall sensor outputs with microcontroller.With the MPU to be placed under the sensor plane, hall output values are measured with the ADC unit of the microcontroller and sent as UART in turn. Here, the microcontroller works at high speed.


## 2.1.2. Step 2: Magnet Centering and Mounting

The units for the sphere magnet used in the system are shown in Figure8 [19].Br: Remanence field, independent of the magnet’s geometry,z: Distance from the sphere edge on the symmetry axis,R: Semidiameter (radius) of the sphere.Figure 8
Sphere magnet variables. Formula for the B field on the symmetry axis of an axially magnetised block or sphere magnet.(3)B=Br2.23.R3R+z2.The high magnetic field value of the magnet used in the system makes the sensor structure more sensitive.


## 2.1.3. Step 3: Installation of Spring to the Main Body and Magnet

In mechanical systems subjected to dynamic loads, caliper springs are typically mechanical devices used to store energy. Helical springs can be found in two different configurations in parallel and in series in automated systems. For these cases, it is necessary to obtain an equivalent spring hardness. The determination of equal spring hardness for parallel connection is expressed as follows [19–23]. Parallel spring: as shown in Figure 9, the parallel spring configuration is located in a mechanical system, and the equivalent spring rigidity is calculated as follows.Figure 9
Spring variables and connection.In the mechanical system, the amount of migration in spiral springs that come in parallel is equal and has a value ofx. Therefore, the sum of the reaction forces of the springs is expressed in the equation below [19–23].(4)∑F=k1x+k2x+⋯⋯+knx=∑i=1nkix=keqx⟶keq=∑i=1nki.Spring stiffness calculation in helical springs under axial loading:Helical spring hardness depends on spring material and geometric factors:(5)keq=Gd48nD3,where G is the shear modulus, the number of active turns, d is the wire diameter, and D is the average spring diameter. Figure 10 shows spring connections.Figure 10
Magnet and spring connections to the assembly.


## 2.1.4. Step 4: Modeling of System Data by Creating a Computer and ANN Network

Values from the sensor plane are applied as input to an ANN network. The best network condition was determined by changing the network properties in experimental studies (number of hidden layers, algorithms, methods, etc.). Network work was done on a computer with a programming toolbox; then the need for a computer was removed by modeling the ANN network with a high-speed microcontroller. Figure11 shows the transmission of hall sensor data to the ANN network according to the cube magnet position.Figure 11
Transmission of sensor data to the ANN network.


## 2.1.5. Step 5: Reading Slope Information from Tilt Sensor for ANN Network Slope Output Data

When Step1 plane is moved angularly, the actual angle values were read from the sensor, making the exact precise angle measurement that will make the same movement. These values will be used as the angled target while training the net [20]. In Figure 12, the actual angle, slope, and acceleration values for the target are shown from the sensor.Figure 12
Reading angle and slope values.


## 2.1.6. Step 6: Reading Acceleration Information from Real Acceleration Sensor for ANN Network Acceleration Output Data

When Step1 plane is moved angularly, the acceleration values were read from the sensor, making the actual precise acceleration measurement that will make the same movement. These values were used as the acceleration target while training the network. Figure 13 shows the real accelerometer sensor and data.Figure 13
Reading the acceleration values.


## 2.1.7. Step 7: Integration of ANN Network into Microcontroller Software and Development of Kalman Filter

The angle and acceleration values obtained at the net outlet are cleaned from vibration values using the Kalman filter, and more stable output values are obtained. Kalman filter structure can be seen in Figure14 [21]. The aim here is to prevent data corruption in vibrations by getting constant values in sudden changes between the previous and subsequent values of the data.Figure 14
Reading the acceleration values.At this stage, the Kalman filter was obtained software in Step4 process step.


## 2.1.8. Step 8: Sending Acceleration and Angle Values with Microcontroller USART

Finally, the stable angle and acceleration values are transmitted at 500 ms intervals to be sent to other units as USART. At this stage, the angle and acceleration values obtained as software after Step5 process were sent via USART communication. In USART communication, angle and acceleration values were instantly sent at 19200 bauds rate.


## 3. Experimental Results and Discussion

In this paper, we have designed a novel tilt and acceleration sensor based on the Hall-effect sensors. Figure15 shows the display of maximum displacement information perpendicular to the ground. According to the analysis in Figure 15, the maximum displacement while perpendicular to the ground was 5.26 mm. Thus, it fulfilled our requirement to be a minimum 5 mm.Figure 15
The display of maximum displacement information perpendicular to the ground in our paper.Figure16 shows the equivalent stress distribution in the springs while perpendicular to the ground. According to the Von-Mises equivalent stress distribution, the stress force must exceed 40 Mpascals for the springs to deform. According to the analysis, a maximum of 16 Mpascals was measured. In this case, it has been observed that the springs operate in the elastic region.Figure 16
Equivalent stress distribution in springs perpendicular to the ground.When the system is rotated 15 degrees relative to the ground, the direction of rotation indicates the magnet position and the stress state.Figure17 shows the analysis results performed by rotating the system by 15 degrees according to gravity. In Figure 17(a), total displacement, that is, X-Y plane resultant measurement, was made, and the maximum displacement at 15 degrees was 5.61 mm. In Figure 17(b), the maximum tensile strength in the springs when the system is rotated 15 degrees was measured as 18.34 Mpascals. This shows that the springs work in the elastic region. Finally, in Figure 17(c), displacement with respect to the Y-axis was measured as 5.32 mm.Figure 17
Analyzing the system with a rotation of 15 degrees according to gravity.When the system is rotated 30 degrees relative to the ground, the direction of rotation indicates the magnet position and the stress state.Figure18 shows the results of the analysis performed by rotating system 30 degrees according to gravity. In Figure 18(a), the total displacement, the resultant X-Y plane, and the maximum displacement at 30 degrees were 6 mm. In Figure 18(b), the maximum tensile strength of the springs was measured as 21.72 Mpascals when the system was rotated 30 degrees. This shows that the springs work in the elastic region. Finally, in Figure 18(c), the displacement relative to the Y-axis was measured as 5.03 mm.Figure 18
Analyzing the system with a rotation of 30 degrees according to gravity.When the system is rotated 45 degrees relative to the ground, the direction of rotation indicates the magnet position and the stress state.Figure19 shows the results of the analysis performed by rotating system 45 degrees according to gravity. In Figure 19(a), the total displacement, the X-Y plane resultant measurement, was made, and the maximum displacement at 45 degrees was 6.06 mm. In Figure 19(b), when the system is rotated 45 degrees, the maximum tensile strength in the springs is measured as 22.83 Mpascals. This shows that the springs work in the elastic region. Finally, in Figure 19(c), the displacement relative to the Y-axis was measured 6,06 mm.Figure 19
Analyzing the system with a rotation of 45 degrees according to gravity.When the system is rotated 60 degrees relative to the ground, the direction of rotation indicates the magnet position and the stress state.Figure20 shows the results of the analysis performed by rotating system 60 degrees according to gravity. In Figure 20(a), the total displacement, the X-Y plane resultant measurement, was made, and the maximum removal at 60 degrees was 5.84 mm. In Figure 20(b), the maximum tensile strength of the springs was measured as 21.91 Mpascals when the system was rotated 60 degrees. This shows that the springs work in the elastic region. In Figure 20(c), displacement relative to the Y-axis was measured as 4.91 mm.Figure 20
Analyzing the system with a rotation of 60 degrees according to gravity.When the system is rotated 75 degrees relative to the ground, the direction of rotation indicates the magnet position and the stress state.Figure21 shows the analysis results performed by rotating the system by 75 degrees according to gravity. In Figure 21(a), the total displacement, the X-Y plane resultant measurement, was made, and the maximum displacement at 75 degrees was 5.47 mm. In Figure 21(b), the maximum tensile force in the springs was measured at 19.53 Mpascals when the system was rotated 75 degrees. This shows that the springs work in the elastic region. Finally, in Figure 21(c), the displacement with respect to the Y-axis was measured as 5.46 mm.Figure 21
Analyzing the system with a rotation of 75 degrees according to gravity.The results of these analyzes are summarized in Table2 and show that the selected springs and magnet are suitable for the system.Table 2
Spring stresses and magnet displacement according to angles.
CaseTotal deformation (mm)Stress (Von-Mises) (MPa)Directional deformation (mm)05.266315.035.266315-degree rotation5.619618.345.321430-degree rotation6.00421.725.035445-degree rotation6.060622.846.060660-degree rotation5.845321.914.917675-degree rotation5.475719.535.4747


## 4. Conclusion

In this paper, Hall-effect’s practical tilt and acceleration sensor design, which makes a real-time measurement, have been realized. 6 Hall-effect sensors with analog output (UGN-3503) have been used in the sensor structure. These sensors are placed in a machine, and the hall sensor outputs are continuously read according to the movement speed and direction of the sphere magnet placed in the assembly. One of the advantages of the system is the cost. Industrial sensors that provide high accuracy acceleration and slope information are very expensive. The average price of this developed system is expected to be $ 8. It will be ensured that the system will provide high accuracy information on inclination and acceleration with the full provision of spring properties and correct hall sensor placements. If the number of Hall-effect sensors placed around the magnet to be used here is increased, it is clear that the measurement sensitivity will increase. Measurement accuracy will increase by expanding the magnet weight and increasing the number of springs by fixing the magnet corners with a spring. With the Kalman filter software structure to be used in the microcontroller, the system is prevented from giving noise data in instant vibrations. Increasing the microcontroller operating speed will also increase the measurement speed of the system.For future works, it is difficult for the springs to be attached to the magnet in the system, where it would be more correct to adhere the springs firmly to the magnet. The spring properties must be the same in every sensor structure, and the springs must work elastic within the specified strength range. This flexible feature should not deteriorate over time. Otherwise, there may be errors in the measurement values in long periods [24].



---

*Source: 7000486-2022-01-10.xml*