IMPLEMENTATION OF KALMAN FILTER ALGORITHM TO OPTIMIZE THE CALCULATION OF ULTRASONIC SENSOR DISTANCE VALUE IN HOOKE LAW PROPS SYSTEM

The Kalman filter algorithm is very important as a recursive algorithm method to optimize sensor output from physical parameter measurement systems, especially physics practicum demonstration systems. One of the distance parameter measurement demonstration systems used in Hooke’s law demonstration system is applied in physics practicum, the system has problems related to fluctuating or unstable sensor output. This research implements the Kalman filter algo-rithm on the Arduino IDE sketch to reduce noise that appears at the ultrasonic sensor output. The methodology used in this study includes the application of the Kalman filter algorithm to the Arduino IDE sketch with the variable value of the Kalman filter algorithm equation modified with a value of R = 10, H = 1, and Q = 1, and returns the filtered Kalman out value. The Arduino output results are exported to Ms. Excel for further analysis and generate a filtered ultrasonic sensor output signal graph compared without using the Kalman filter. The ultrasonic sensor output noise filtration effectively reduces noise by showing a decrease in the mean squared error (MSE) value and obtaining the best performance of up to 89.23 %. The accuracy of Kalman filter filtration results can be seen from the calculation that the spring constant of filtered metal materials is smaller than the conventional measurement spring constant. Accurate and effective results with the implementation of the Kalman filter algorithm can be developed for the variation values of distance parameters and Kalman filter algorithm variables (R, Q, and H) with other value variations, especially variables that produce filtering curves close to straight lines. It was concluded that the Kalman filter algorithm was able to improve the performance of Hooke’s


Introduction
Education is a fundamental problem for the progress of the nation and is a pillar of technological progress to improve people's standard of living.The use of information and communication technology has become very important in the framework of knowledge transfer.Information technology is applied in learning that is influenced by technological changes in the era of the Industrial Revolution 4.0.The application of technology in learning by applying digitalization changes learning to be dynamic.Digital learning activities become more effective and efficient with ease of information, faster learning processes that can be accessed by many users, and improved quality of learning.The application of information and communication technology helps us understand natural phenomena and physical concepts.
The ability to understand physics concepts in physics learning affects the success of physics learning.The success of physics learning requires infrastructure that supports the understanding of physics concepts, such as experimental activities in the laboratory.The availability of practicum tools in an area is influenced by the cultural progress of the area.The local culture of this area greatly influences educational facilities in rural areas.One school in the city of Purworejo, Indonesia, has limited physics laboratory facilities.This is because the use of school facilities and regional culture has not been maximized as a characteristic of the habits of smalltown people, especially the procurement of physics laboratory equipment and learning nuances.These limitations encourage schools to make solutions by developing laboratory equipment independently and changing conventional laboratory equipment to digital.The development of digital laboratory equipment started in 2020 during the Covid-19 pandemic.Development of practicum teaching aids to assist students in the implementation of science practicum.Digital practicum equipment using physical sensors has been widely used.Especially the use of ultrasonic sensors for mechanical concepts in distance variable measurements.Mechanical concepts such as measurement of speed, force, sound, and other physical concepts in basic physics.
Laboratory tests have been carried out with the implementation of science practicum in several experiments for mechanical equipment using ultrasonic sensors and found problems with accuracy in measurements by the sensors used.The results obtained show an error percentage of about 2 % with unstable results on many variations of distance parameters.The measurement results are caused by the influence of voltage on sensor sensitivity and response time in the sensor system so a measurement result correction system is needed.These inaccuracies are caused by noise that is not addressed during measurement and affect the measurement results of the physical variables being measured.Inaccurate results cause the measurement error value to be larger and not match the reference value.Efforts to minimize errors and improve measurement accuracy are needed to reduce sensor noise by applying certain algorithms such as the Kalman filter algorithm.The measurement results will affect the conclusions made by students, resulting in students' misconceptions about the physics concepts studied.
In the case of Hooke's law, props for understanding the constants of a material are used as digital props using ultrasonic sensors and loadcells.The measurement results of the two sensors (distance and mass variables) produce inaccurate measurements due to noise.In this case, a solution with noise reduction is needed to produce more accurate sensor readings.The concept of Hooke's law for determining material characteristics requires more precise digital measurements.Therefore, a digital Hooke's law demonstration system based on physical sensors and optimization algorithms is needed to produce precision measurements to understand more comprehensive physics concepts.Development research with new methods is needed to solve the noise reduction problem on Hooke's law teaching aids using the relevant and appropriate Kalman filter algorithm to solve the problem of inaccuracies of Hooke's law teaching aids in science practicum.

Literature review and problem statement
Distance measurement is essential in understanding and analyzing scientific phenomena in a variety of physical contexts, especially in distance optimization systems.Paper [1] shows that measurements require accurate methods and special procedures to produce accurate data.Digital measurement requires automated tools that use sensors as innovative measuring instruments in measurement systems [2].Digital distance measurement using ultrasonic sensors has replaced manual measurement without touching the object to be measured and its advantage [3] is resistance to light intensity, object color, and climate change.Ultrasonic sensor in paper [4][5][6] that utilizes ultrasonic sound waves with two transducers as transmitter (pin Trigger) and receiver (pin Echo).The transmitter produces ultrasonic sound waves in the form of signals with a certain frequency and is sent to the destination object.One application of ultrasonic sensors is applied to rice planters such as paper [4] which is used as a rice seed counter, inside which consists of a crystal oscillator as well as a transmitter and receiver of ultrasonic waves.In paper [5] ultrasonic sensor applications are used to monitor the water level at sluice gates by utilizing the Trigger pin and Echo pin of the ultrasonic sensor.In addition, on paper [6] ultrasonic sensors are used as Obstacle Avoidance for Autonomous Vehicles due to their ability to measure the distance of obstacles in front of them.Therefore, the function of the Trigger pin and Echo pin is very important as a transmitter and receiver that captures ultrasonic sound waves that bounce back after interacting with the object they hit.Papers [4][5][6] show ultrasonic sensors have been applied in various fields of research, although they still cause noise in every measurement.Inaccuracies arise when the transmit and receive signals are disrupted by noise.This process is described in the paper [7] where the signal captured by the Echo pin is interpreted by the microcontroller as data for distance calculation [8].
In paper [9,10] digital distance measurement using ultrasonic sensors can be applied in Hooke's law measurement systems to produce more accurate measurements.Apply the paper concept of Hooke's Law [11][12][13][14][15] in digital measurements that can affect the calculation of the value of the spring constant, and the spring increases in length to some extent when subjected to force.The magnitude of the force applied is proportional to the increase in the length of the spring and the ratio is constant [11], as in paper [12] the longer the spring means the greater the force applied.The application of varying forces to a material will affect the effect of elasticity of objects [13].The character of the material in the paper [14] is determined by the stiffness properties of the material discussed in Young's Modulus principle.This principle addresses the interrelation of measures of material resistance to changes in their length.In the paper [15] the material can be improved in elasticity properties by special treatment both chemically and mechanically, although this study only used springs made of springs and has not applied material variations in spring constant trials for material variations.In [16,17] the elasticity properties of objects affect the characteristics and constants of materials.The spring constant indicates the force required or exerted to produce a change in length equal to one unit of length in meters.The papers 18,19] states that the maximum amount of force that can be exerted on an object depends on the nature of its elasticity.The elasticity of the object depends on the force exerted and affects the increase in the length of the spring.The elasticity of objects such as paper [18] occurs in flexible beams due to the loading given so that they experience deformation from their original position.Deformed material will exert a reversing force proportional to the magnitude of the deformation [19].
The equation of Hooke's law in the papers [19][20][21], states that the spring attraction force F (N), spring constant k (N/m), and the increase in length x are affected by the force applied (F).The spring force is in the opposite direction to the deviation indicated by the negative sign and the spring force because the restoring force causes the object to oscillate as long as there is no air friction [20].The variable measurement system in Hooke's law can be done digitally using the help of sensors and the results can be calibrated to be more accurate [19].Sensor measurement systems can be controlled with powerful performance to produce accurate sensor output [21].So, the papers [19][20][21] show that the accuracy of each measurement variable becomes very important because it affects the final purpose of measurement.The measurement variables in this study take the distance and mass variables of the load, but the focus of the study is on the distance variable to calculate the spring constant.
The application of Hooke's law to the system [22,23] as a result of digital distance measurement of ultrasonic sensors requires algorithms to produce the best results.In the papers [22,23] it is also mentioned that a good understanding of sensors needs to be supported by the application of appropriate algorithms to produce mathematical calculations that have high accuracy.This statement is reinforced by the statement in [24,25] in the use of optimization algorithms as the best solution in calculating the output results of ultrasonic sensors, especially those that have problems with the mismatch of expected values due to noise.Therefore, a way is needed to reduce the noise impact of the sensor output.The distance variable in Hooke's law prop system is very important for determining the value of the spring constant of a material.The use of the Kalman filter optimization algorithm integrated with the Arduino microcontroller in paper [25] provides a sensor measurement solution with a noise filtering process and facilitates a more accurate data acquisition process [26].The solution in these papers [22,23] is applied in noise reduction resulting from ultrasonic sensor output in Hooke's law demonstration system as a physics experiment prop.
Papers [27][28][29][30][31] define the Kalman filter algorithm as a recursive mathematical method used to generate an estimate or approximation of a variable based on a series of measurements that are imperfect or disturbed by noise.In various applications, sensors such as paper [27] applied in healthcare and engineering [28] are used to estimate parameter values (states) such as distance parameters as a result of ultrasonic sensor output.In addition, the paper [30] describes the use of portable sensor technology to monitor environmental factors and the effects of health problems affected by measurement system design.Distance parameters are discrete, from one point to a certain point and constants can affect the values of fluctuating and dynamic distance states listed in the paper, resulting in uncertainty in measurements [29].In the papers [27][28][29][30][31] the application of control systems using sensors has been applied in various fields, but in this study, it was only applied to a limited scope for the benefit of physics education.The Kalman filter method as in the paper [31] can reduce noise as an uncertainty factor by minimizing the expected value of the Mean Squared Mean (MSE).MSE is a method error function to measure the accuracy of the Kalman filter method as an estimation process using previously obtained sensor outputs.Application of the Kalman filter algorithm in the papers [27,28] estimates the distance measurement process of ultrasonic sensor modules such as the HC-SR04 model for more precise results.The Kalman filter algorithm application solution can be applied to Hooke's law demonstration system by involving the ultrasonic sensor output in its measurement.
Physical sensor measurements depend on specific environments, configurations, and applications.Environmental influences that impact the emergence of noise require algorithmic methods to overcome many disturbances such as noise.Variations in measurement indicators as listed in the paper [30] can improve accuracy and more complex and comprehensive information.Some of the multiparameters listed in the paper [29,31,32] can be measured with sensors such as measuring mechanical, dynamic, thermal, electrical, magnetic, optical, and acoustic variables.Multiparameter as a measurement state can be applied in various measurements of mechanical parameters of basic magnitude variables such as distance, time, speed of light, and other states according to the system created.
Measurement systems in dynamic states can be applied to dynamic fluid systems in measuring water discharge.In thermal state can be applied to heat systems and temperature changes.Electrical measurement systems and magnetic concepts can be applied in the measurement of electric power in the state of measuring voltage and electric current.Applications for optical and acoustic concepts can be applied to light refraction concept systems and optical applications in the industry.The use of ultrasonic sensors in Hooke's law demonstration systems is carried out in instrumentation laboratories with medium feasibility so that environmental factors still affect the sensor output which has an impact on noise.
Poor understanding of sensor characteristics such as on papers [33][34][35] affect the application of the system in the application of appropriate algorithms to produce better accuracy.In paper [35] the use of certain algorithmic methods in identifying sensor measurement data errors affects the performance of a system such as the use of Bayesian approaches to evaluate navigation sensors, in paper [33] the use of artificial intelligence neural network methods to improve the measurement accuracy of temperature sensors in thermocouple systems, and the use of software algorithms such as wavelet signal-based approaches used to detect errors Sensor measurements on an industrial scale [34].Based on the papers [33][34][35] it is possible to state that every use of sensors in the measurement of a particular system requires an algorithm to correct the readings by the sensor, to produce accurate output.The application of the Kalman filter algorithm is required in Hooke's law demonstration system to correct ultrasonic sensor readings to produce more accurate distance parameters.
Identifying the performance of sensors used can improve efficiency and troubleshoot system problems.Paper [36] describes a good understanding of sensor characteristics as essential for improving algorithm accuracy and system applicability.Techniques such as identifying fault models, using artificial intelligence methods, and considering environmental conditions can help address physics learning system problems such as Hooke's law demonstration system.
In a paper [37] describing measurements using ultrasonic sensors, remote control systems create problems such as those in Hooke's law prop system, namely the occurrence of sound interference, reflecting surfaces, sound absorption properties, temperature changes, electromagnetic interference, and frequency selection of the sensor's working range.Control systems using microcontrollers and physical sensors can improve performance efficiency by up to 20 % compared to other input devices.Papers [24,38,39] provide descriptions of the use of physical sensors in remote control systems that can improve measurement accuracy and improve the performance functionality of systems such as Hooke's law demonstration system.In addition, in the paper [39] functional improvements in system performance can be made by improving system control and operation, feedback and coordination, and streamlining process monitoring [38].Hooke's law system in measuring distance parameters (ultrasonic sensor output) with high noise will be detrimental in calculating the value of the spring constant.This is reinforced by the opinion in the paper [24] which requires a special algorithm so that the performance of Hooke's law's display system can work optimally.
Hooke's law digital display system is very important as an educational prop for students who understand the concept of the spring constant of a material.Students more easily understand the concept of Hooke's law from digital distance measurement because this system has data stability, measurement efficiency, and precision.The pilot system of Hooke's law is particularly effective for students with a low understanding of Hooke's law, as applied to rural schools adapted to local wisdom with limited means of education.Therefore, the feasibility and validity of Hooke's law props are needed to improve the quality of learning applied in physics learning.In addition, quality teaching aids can improve the quality of the output of science experiments according to the concepts studied.The Distance parameter obtained from the ultrasonic sensor measurement affects the stability of the constant magnitude of the spring.This requires a structured algorithm to obtain the magnitude of the spring constant according to the reference or theoretical value.
Using physical sensors adapted to the right environment, minimizing emerging risk factors, and noise reduction with sensor output optimization algorithm mechanisms can result in more accurate measurement values.The variable distance as ultrasonic sensor output on Hooke's law demonstration system can produce accurate output with a digital filtration process using the Kalman filter algorithm.The Kalman filter algorithm is a recursive method used to produce approximate output results based on a series of imperfect or noise-contaminated measurements.The use of the Kalman filter algorithm as the output of the filtering distance of the ultrasonic sensor of Hooke's law demonstration system results in a spring constant value that is close to the reference value or theory value.The measurement of the spring constant of a material in this study is very dependent on the results of distance variable measurements using ultrasonic sensors, therefore the Kalman filter algorithm is needed to reduce noise.A noise filtering process is required to produce a more accurate sensor output.Accurate results are shown by comparing the output of ultrasonic sensors using the Kalman filter without the Kalman filter.Then it will show the difference in more effective results.

The aim and objectives of the study
This study aims to implement the Kalman filter algorithm to improve the accuracy of measuring distance parameters of ultrasonic sensor output results in Hooke's law demonstration system.Accurate measurement results can provide opportunities for the implementation of the Kalman filter algorithm in reducing measurement noise.Distance parameters are used to obtain spring constants according to material characteristics and optimize ultrasonic sensor output results by noise reduction.Accurate measurement results according to reference values make it easier for students to make correct conclusions about the concept of Hooke's law.
To achieve this aim, the following process must be done.
-to test the feasibility and validity of Hooke's law display system by media experts in the field of electronic instrumentation; -to apply the Kalman filter algorithm in reducing ultrasonic sensor output noise; -to compare the output of ultrasonic sensors using the Kalman filter algorithm without the Kalman filter algorithm.

1. Object and hypothesis of the study
The object of the study is to noise from distance parameter measurements by ultrasonic sensors in Hooke's law demonstration system.The research hypothesis is as follows.The Kalman filter algorithm can be used [40] to improve the measurement accuracy of distance parameter variations resulting from ultrasonic sensor output.The distance parameter is used for the calculation of the spring constant of a material.The calculation of distance parameters is carried out using Arduino IDE software and data analysis using Microsoft Excel and Matlab.In Arduino programming, the variable output distance of ultrasonic sensors containing noise is reduced using the Kalman filter algorithm.The results of calculating distance parameters that have undergone filtering are used to calculate the value of the spring constant of ferrous metal materials and the results obtained are close to the value of the conventional calculation spring constant.

2. Real-time acquiring process 2. 1. Measurement of distance parameters by ultrasonic sensors
The ultrasonic sensor consists of two transducers namely Trig (signal transmitter) and Echo (signal reflection receiver).These two components play an important role in measuring distance parameters.The measurement of distance parameters referred to in this study is the distance between the sensor and the object hung on the spring with a certain mass.When the ultrasonic sensor is working, the object will reflect the calculated sound waves using the equation [41]: in this case, T is the travel time from the moment the ultrasonic signal is emitted until it returns to the sensor.The speed of sound c is 343 m/s.Trig in HIGH conditions for at least 10 microseconds and the ultrasonic module will send a signal in the form of a box wave with a frequency of 40 KHz.The signal will be detected by the ultrasonic module automatically (transmit signal and receive signal).After that, the Echo pin is in the HIGH state and obtains the T value with the equation: Thus, the distance value can be calculated by equation (1).The number 2 divisor is necessary because the value of T represents the time it takes to travel from sensor to object and from object to sensor.The calculation of distance in cm follows the equation: Using equation ( 3), the value of the distance parameter is obtained as the output of the ultrasonic sensor containing noise.After that, the value of the parameter x is substituted in the equation of Hooke's law [19].
where the F value is obtained from the calculation of the loadcell sensor to calculate the mass (m) and acceleration of gravity (g).Thus, the calculation of the value of the material spring constant is obtained.

2. 2. Implementation of Kalman filter algorithm to reduce noise
The Kalman filter (KFA) algorithm is a predictor algorithm in the form of mathematical equations to estimate a process by minimizing the value of SME (Square Mean Error), and a feedback process occurs from the sensor as an output [40,[42][43][44].The sensor output still contains noise that interferes with the expected output results.This algorithm works in two stages: the prediction stage and the update stage.
At the prediction stage, two algorithm equations are used as follows: (5) While at the update stage, equations are used: 1 ( 8) where x is a priori state estimation, F is the state transition matrix, u is the control variable, B is the control matrix, P is the state matrix variant, Q is the process matrix variant, y is the sensor measurement variable, H and R each is a measurement matrix, and K is the Kalman Gain.t|t represents the current period, t-1|t-1 is the previous period [45,46].The next stage modifies the Kalman filter equation into two stages, namely predicting the state and predicting the error [47,48].
Modifications to predicting the state are made to equation ( 5) by giving the value Ft = 1.The value of B is omitted because there is no transition state resulting in no u input, thus yielding the equation: in programming, using the command: SensorData = distance_m.Equation ( 6) with Ft = 1 becomes: in programming, using the command: pt_update = pt_prev+Q.At the Update State Value stage, equation ( 7) is given the value Ht = 1 to be the equation: in programming, using the command: The calculation of Kalman Gain by giving the value of Ht = 1 gives the equation (8) to be: in programming, using the command: Kt = Pt_update/(Pt_up-date+R).
In general, all equations that have been modified can be stated for the prediction stage shown in equations (10), and equations (11), and the correction (update) stage is shown in equations (12), equations (13), and equations (14).
In programming, use the commands shown in Fig. 1 [44].Fig. 1, a shows a sketch of distance measurement without the Kalman filter, while Fig. 1 Equations ( 5) to equations ( 14) will be applied in script form on Arduino microcontroller devices as Kalman filter algorithms.The equation is to reduce the output of ultrasonic sensors in noise filtering when modifying the state transition matrix Ft = 1.The noiseless filtering output of the Kalman filter is obtained from the calculations of equation ( 12), equation (13), and equation ( 14).

3. Flowchart
The block diagram for Hooke's Law prop system using the Kalman filter algorithm is shown in Fig. 2. The working process of Hooke's Law demonstration system begins with the initiation of a distance variable when the spring is loaded with a mass m the spring increases in length [49].
The calculation of the variation in the distance parameter x using an ultrasonic sensor and the sensor output was estimated using the Kalman filter algorithm.The F value is obtained from the calculation of the mass multiplication of the load m by the acceleration of gravity g.The Kalman filter estimation result is used for the calculation of the value of the spring constant k.
This research method uses the Kalman filter predictor algorithm to process data to produce reading outputs of two sensors, an ultrasonic sensor, and a loadcell sensor.The purpose of using the Kalman filter algorithm is to reduce the noise produced by both sensors so that the results are more accurate.This noise can interfere with the working performance of the sensor in data calculations.
The focus of this study is on the output of ultrasonic sensors in distance measurement.The distance measured is the distance of the load on the spring that has undergone a change in length with the distance of the ultrasonic sensor.Variable load changes will provide different distance measurements depending on the accuracy of the measurement and the influence of the environment on the sensor measurement.
The flowchart Fig. 2 shows the measurement results that are very crucial at the stage of measuring the value of the spring constant k, this right is because it is influenced by the x value of the ultrasonic sensor measurement results.While the F value is influenced by the value of the load mass and the fixed value of the speed of gravity, in this case, the load value is generated by the load cell.

Design system
Hooke's law demonstration system with steel springs using ultrasonic sensors and load cells controlled by Arduino microcontrollers is shown in Fig. 3. Measurement of distance parameters with five distance variations using the Kalman filter algorithm to improve the accuracy of the sensor working system [16].
The electronic devices used are ultrasonic sensors and load cells as data acquisition devices, Arduino Uno ATMega328p microcontrollers as distance and mass data processors, and carrying out the Kalman filter algorithm process.An 8-bit MCU is sufficient to handle reading data in this research process because the microcontroller can read 8-bit data per instruction cycle.In the use of MCU, it only processes data from two sensors, namely ultrasonic sensors and loadcells.The 8-bit MCU has the advantage of data reading stability over the MCU above.
In Hooke's law demonstration system, the ultrasonic sensor is located at the bottom of the system, facing up and straight with the loadcell, while the loadcell is located at the top of the system, facing down parallel to the ultrasonic sensor.The electronic circuit is set with the ultrasonic sensor Trigger pin connected to the Arduino pin 9, the Echo pin connected to the Arduino 10 pin, the Vcc inlet voltage pin connected to the 5-volt voltage pin, and the ground pin connected to the Arduino ground pin.Of the four loadcell sensor pins, each TX pin is connected to the Arduino's TX pin, the RX pin is connected to the Arduino's TX pin, the VCC inlet voltage pin is connected to the 5-volt voltage pin, and the Ground pin is connected to the Arduino's Ground pin.All systems are connected to a 12-volt voltage source to supply all voltage sources to run correctly.The sensor reading measurement results are estimated using KFA and processed in Arduino, then used to calculate the material spring constant.

1. Feasibility test and validity of Hooke's law teaching prop
The results of the trial of Hooke's law teaching system, which is applied to physics learning for students in rural schools, require valid and proper educational props.Existing problems such as the learning atmosphere influenced by local wisdom, conventional learning methods, and limited experimental infrastructure require problem solutions.School facilities need the availability of digital tools to conduct more precise experiments.This is an obstacle to learning activities in areas with limited educational facilities.Therefore, digital props are needed that help students understand comprehensive physics concepts, especially Hooke's law and the concept of the magnitude of the spring constant of a material.The following is a feasibility test and validity of Hooke's law demonstration system by media experts in the field of physical instrumentation with several assessment parameters.The following data are supported by paper [50] and shown in Fig. 4. Fig. 4 shows six indicators of assessment by physics instrumentation media experts.The six assessment indicators are educational value, props kit, aesthetics tools feather, props efficiency, presentation of props, and durability of props.The score obtained produces an average score above 70 out of a score of 100 and produces teaching aids that are worthy of being applied in physics learning.

2. Results of measuring distance parameters using the Kalman filter algorithm
Measurement of distance parameters using ultrasonic sensors in Hooke's law demonstration system produces noise that can interfere with the accuracy of the resulting data.Using the value of R, H, and Q variations when measuring using the Kalman filter, the best-estimated value for noise reduction is obtained.
The Kalman filter calculation begins when estimating proximity sensor data with values of R = 10, H = 1, and Q = 1 in the Kalman filter equation modified by the Kalman Gain equation (8).The calculation result of yt sensor output without the Kalman filter containing noise and after using the Kalman filter is shown in Fig. 5.
Fig. 5 shows the distance variation at 0.4 m i.e. the distance of the ultrasonic sensor to the m-mass load.Fig. 5, b shows the process of data analysis for graphing to make differences in filtering noise.The yt parameter indicates the output of the ultrasonic sensor with noise and xt indicates the output of the ultrasonic sensor with Kalman filter.Fig. 6, 7 show fluctuating readings from ultrasonic sensor sensors (blue line) in 3 variations of reference distance experiments.Variation of the reference distance from 0.2-0.5 m with thirty experiments.The reference distance used is 0.2 m respectively; 0.3 m; 0.4 m; and 0.5 m.Ultrasonic sensor testing uses Kalman filter filtration to filter noise, resulting in a fairly stable output (red color line).
The four ultrasonic sensor output graphs in Fig. 6, 7 were obtained from the first 30 experimental data.The data is generated based on the reference distance value to the ultrasonic output.Correction of the ultrasonic sensor output distance value using Kalman filter with without Kalman filter successively as follows: 0.2 m reference distance of 0.62 %; reference distance of 0.3 m of 0.22 %, reference distance of 0.4 m of 0.04 %; and a reference distance of 0.5 m of 0.03 %.
The data shown in Fig. 6, 7 are obtained by taking the data thirty times and obtaining stable values when the parameter values R = 10, Q = 1, and H = 1.These three parameters are substituted in the prediction equation and the update equation in the Kalman filter filtering process.The filtering process shows the difference in noise filtering results using the Kalman filter shown by the red line and the blue line.
The trial was carried out repeatedly from the first process by taking the smallest value until a flatter filtering curve was obtained.The better the value of the R, Q, and H parameters, the better the filtering results obtained.This will affect the calculation of the spring constant k.
The results of the graph can be illustrated in general in Table 1 which shows the calculation of Standard Deviation (SD) and the calculation of Mean squared Error (MSE).Table 1 shows the difference in output values before and after the Kalman filter filtering process.Table 1 shows the Mean square error (MSE) obtained from ultrasonic sensor readings at a distance of 0.2-0.5 meters, resulting in an average standard deviation before Kalman filter of 0.0187367133 and after Kalman filter usage of 0.002017928, this shows a significant reduction of 89.23 % when applying Kalman filter to ultrasonic sensor readings.This shows that the application of the Kalman filter algorithm is quite effective in reducing noise from interference from internal and external environmental factors.

3. Comparison of ultrasonic sensor output using Kalman filter with Without Kalman filter
In testing the prop system, Hooke's law used spring material made of steel metal.The test was performed with five load mass variations and five reference distance variations.The spring constant is calculated by performing 5 mass variations of the load m placed on the spring and 5 variations of the reference distance (distance of the load to the sensor).The results of the comparison of spring constant values from digital calculations using ultrasonic and conventional sensors are shown in Table 2.The calculation of the spring constant is determined by measuring the distance derived from the output of the ultrasonic sensor.The ultrasonic sensor output distance measurement from the Hooke's law demonstration system experiment still contains noise that affects the calculation of the spring constant value.
The spring constant k is obtained by calculating the equation of Hooke's law in Equation (1) and equation ( 2).The constant value was obtained from two experimental values, namely static experiments without digital aids (conventional) k′ and experiments using Hooke's law's teaching system using microcontrollers k.K-value measurement experiment of Arduino microcontroller using load cell sensor and ultrasonic sensor with Kalman filter using Equation (2).

Discussion of the results of the implementation of the Kalman filter algorithm in the Hooke's law prop system
Hooke's law props as educational props are appropriate for physics experiments as shown in Fig. 4. The validation and feasibility tests give an assessment score above 70 out of a score of 100, indicating that Hooke's law props can be used as educational props.The highest assessment score is obtained by the educational value indicator and the lowest score on the props appearance indicator.The results of this assessment show that Hooke's law props are feasible to be applied in physics learning.However, an obstacle arises when the Hooke's law demonstration system is used in physics practicum for the calculation of distance parameters using ultrasonic sensors.The ultrasonic sensor output is subjected to fluctuating output values or subjected to unstable values on many variations in distance parameters.This causes inaccuracies in the measurement results due to noise and affects the conclusions students make about the concept of Hooke's law.
The solution is to implement the Kalman filter algorithm to reduce the noise produced in measurements.The output of the ultrasonic sensor that has been filtered using the Kalman filter algorithm is shown in Fig. 5.The Kalman filter equation consisting of the prediction stage and the update stage is modified with the best R, Q, and H variables.The best values of the variables R, Q, and H are obtained when R = 10, Q = 1, and H = 1.The three variables determine the Kalman Gain value as the reinforcement component and the Kalman Out value as the result of filtering.Furthermore, the sensor output results displayed in the Arduino IDE series monitor are exported to the Microsoft Excel table for noise filtering analysis in graphic form.Fig. 6 and Fig. 7 show a graph of distance reference variation from 0.2 m; 0.3 m; 0.4 m; and 0.5 m which shows the difference in ultrasonic sensor output before and after the use of the Kalman filter.Strengthening the difference in graphs before and after using the Kalman filter is carried out in the calculation of mean squared error (MSE).It is shown in Table 1 that there is a decrease in MSE value before and after the use of the Kalman filter, this shows that the use of the Kalman filter algorithm is effective for reducing sensor output noise.A significant decrease of 89.23 % means that the measurement results are more accurate before using the Kalman filter.So, this study shows that Kalman filters can reduce or eliminate noise that causes errors or suboptimal system output.It is proven that the Kalman filter can mini-mize mean squared error (MSE).Thus, the smaller the MSE value, the smaller the prediction error or the more accurate the result.
The output results of measuring distance parameters that have undergone filtering are used for the calculation of spring constant values.Table 2 shows the value of the spring constant obtained conventionally and digitally.Conventionally done by manual measurement using a ruler and stopwatch produces a value of k′.The results obtained show the difference in constant values with various variations in reference distances and reference loads.The measurement results show that the measurement of the value of the spring constant digitally in Hooke's law demonstration system using the Kalman filter algorithm is more effective and accurate.This greatly helps the students in making the conclusions of the physics experiment regarding the correct concept of Hooke's law.
Hooke's law demonstration system has the advantages that measurements are carried out digitally with the help of sensors, have good accuracy with the application of Kalman filter to reduce noise, and saves electrical energy because it only requires an electric voltage of 9 volts.In addition, Hooke's law demonstration system is more effective and efficient in retrieving distance parameter data because it is carried out by sensors compared to conventional [16].
However, Hooke's law display system has limitations such as there is no LCD as an output display screen, so it must be connected to a PC.Without LCD, the output is displayed via the Arduino IDE feature monitor series.In addition, the use in the field of physics practicum is used offline indoors, it is necessary to add special features for distance learning such as remote laboratories.
This research provides new experiences that can be used for future improvements such as: the use of variations in metal materials, noise correction for load-bearing loadcell sensors, equipped with a result viewer monitor, and variations in certain distance parameters.

Conclusion
1. Feasibility and validity tests are carried out by assessment by physical instrument experts with six assessment indicators.The score results of six assessment indicators produce a score above 70 out of a score of 100, indicating that Hooke's law display system is suitable for use in physics practicum.The predictor with the highest score on the educational value indicator with a score of 78 indicating the educator's value as a teaching aid can be considered.
2. The noise content in the sensor output that interferes with the performance of the Hooke's law demonstration system is carried out by noise reduction using the Kalman filter algorithm.The calculation of mean squared error (MSE) shows a significant decrease after using the Kalman filter algorithm by 89.23 %.This shows the use of the Kalman filter algorithm effectively to reduce noise from the output of ultrasonic sensors.Noise filtering can improve the performance of the Hooke's law display system and make conclusions for the students about the concept of Hooke's law correctly.
3. The results of measuring the value of the constant digitally and conventionally show a difference of 0.02 from the conventional calculation of the spring constant.The value of the spring constant from digital calculations is smaller than

Fig. 1 .
Fig. 1.Programming commands on Arduino IDE ultrasonic sensor output: a -sketch distance measurement without Kalman filter; b -sketch command showing prediction stage and correction stage of modified Kalman filter equation and sketch command with parameter input R = 10, Q = 1, and H = 1

Fig. 2 .
Fig. 3. Hooke's law demonstration system design uses ultrasonic sensors for distance parameter measurement

a b Fig. 6 .Fig. 7 .
Fig. 7. Graph of Kalman's filtering results against reference distance: a -reference distance 4.0 cm; b -reference distance 5.0 cm a b

Table 2
Calculation of spring constant K result of the reference valueand the filtering result of Kalman filter K'