Real Time Measurement for Spring-Mass System: The Graphical and Mathematical Representations

Article Info Received : July 29th, 2020 Revised : December 21th, 2020 Accepted: January 7th, 2021 Abstract: Mathematics is the language of physics. The best way to describe a physical phenomenon is by describing its mathematical representations. In addition, viewing the graphical diagram of the corresponding mathematical expression is crucial to deeply understand the physical events. Therefore, setting simple experiment in real time to (1) observe the phenomena, (2) view the related diagrams, and (3) extract the mathematical representations is required. In this study, the real time and simple experimental set-up (consisting of ultrasonic sensor HC-SR04 connected to an Arduino Uno board) was designed to perceive the motion of a spring-mass system. The spring force, which is equal to the object’s weight, and displacement or spring elongation data were recorded for the object (with varying mass) attached to the spring. A small external downward force was given to stimulate simple harmonic motion of the vertical spring-mass system. The displacement as the function of time of the spring-mass motion was recorded. With those measurements, the sinusoidal patterns, representing the simple harmonic motion characteristics, were also observed. The spring constants were 6.35(2) N/m and 6.26(1) N/m for the displacements measured by sensor and ruler, respectively. The periods form the angular frequency of the displacement function and from the spring constant (acquired from sensor data fitting) showed consistent results with very high accuracy. This simple experimental set-up is believed to fulfil the technological-based learning demand.


Introduction
In dealing with realities, we often rely on the saying that seeing is believing. It also works for students to learn scientific facts, even though there will always be few exceptions. In general, we all agree that visualization is crucial to understand science phenomena. The discovery of laws of motions by Sir Isaac Newton or electromagnetic induction by Michael Faraday has proven that visualization plays an important role in generating scientific concepts, including physics. In addition, all physicists axiomatically formulate the physical phenomena in the language of mathematics. Proper understanding on the mathematical expressions will also dictates students' sense in physics (Gisin, 2020). As a matter of fact, students are difficult to connect their understanding of mathematics and physics altogether (Bagno et al., 2019). Therefore, for physics educators, making sure that students observe the phenomena and have a good sense of mathematical representation is a challenging task. This is a crucial issue in physics education.
To be more specific, mathematical equations and graphs are of the essence to understand physics. Many research papers have reported that students even face difficulties not only to interpret, but also to read the equations and graphs. For example, students feel tough to connect the electricity and magnetism evidences with the mathematical calculations (Pepper et al., 2012); although some of students have been trained in mathematics, but their ability to interpret the graphical representations of vector calculus to electrodynamics concepts are relatively weak (Bollen et al., 2016); the way students deal with vector field graphs are also pathetic (Klein et al., 2018); even many students have no idea on how the sine wave function relates to a harmonic oscillation (Horne & Kelly, 2020).
This study is designed to help teachers and students learn physics along with the mathematical understanding. For this purpose, the simple harmonic motion was chosen as the topic to study. Though many attempts have been developed to reach that goal, e.g. using hands-on solved problems with Matlab (Horne & Kelly, 2020), modelling the harmonic oscillation properties by means of Visual Basic (Kareth et al., 2018), using multi-media based learning (Andani et al., 2018); and providing an in-depth analysis on the simple harmonic motion equations (Tisdell, 2019). However, all those mentioned breakthroughs only relied on the theoretical basis. Students need to have their own scientific experience and direct observation to learn physics both phenomenally and mathematically. Therefore, the use of real-time graphs acquisition provides an effective way out to that concern. With that, a computerized sensor that is able to read the data in physics observation is required in such a way that students can directly observe the physical phenomenon while learning graph visualizations.
In order that the experimental-based learning can be broadly used by as many teachers or students as possible, the set-up must be easily constructed and cheap, and Arduino Uno meets these criteria. Arduino Uno offers great availability that are compatible with low-price sensors and transducers that are very convenient for physics learning and laboratory. It is a perfect learning tool for students to actively get involved during the learning process (Organtini, 2018). It is the biggest open-source software and hardware ecosystem. The Arduino Uno board can be bought from nearby electronic stores or from online-shopping platforms. The Arduino IDE software can be downloaded from its official website, www.arduino.cc/en/Main/Software. It is installable on Mac OS X, Linux, and Windows which is written in Java and based on high-level programming language. As depicted from the website, Arduino Uno is designed for the next generation of Science, Technology, Engineering, the Arts and Mathematics (STEAM) education. Since Arduino Uno is connectable to computer programs for calculating and graphing purposes, a real-time measurement is consequently possible by means of sensors that are connected to an Arduino Uno board and a computer.

Methods
In this study, the simple harmonic motion experiment consisted of brass weights, a stand, a ruler, an Arduino UNO board, an HC-SR04 sensor, cables, and a laptop. The metallic bar, with varying mass, was connected to a hanging spring. When the mass was attached to the spring, the spring reached a new equilibrium position. The spring force, which is equal to the weight of the metallic bar, and the change in equilibrium position were recorded to obtain the spring constant. The displacements were measured by means of the ultrasonic sensor and ruler. Prior to the measurement, the ultrasonic sensor was initially calibrated by comparing its reading with a ruler.
Oscillation was generated by pulling down the metallic bar connected to the vertical spring. The simple harmonic motion of the spring-mass system was the oscillation with nearly unchanging amplitude with sinusoidal pattern. The displacement, as the function of time, was automatically detected using the HC-SR04 sensor. Five series of the spring-mass system with different masses were designed for in-depth analyses. The spring-mass system with masses of 50 g, 100 g, 150 g, 200 g, and 250 g, were respectively denoted as SMS-1, SMS-2, SMS-3, SMS-4, and SMS-5.
The real-time displacement data collected by the HC-SR04 were read by the Arduino and viewed in Microsoft Excel program using Parallax Data Acquisition tool (PLX-DAQ). Tis way, the oscillation patterns of the spring-mass motion could be directly displayed. Principally, when an Arduino Uno is connected via USB cable to a computer, a 5-V voltage is generated in the HC-SR04 by connecting the Vcc pin of the sensor to the 5 V pin of the Arduino board and the GND sensor pin to the GND pin of the Arduino. The Trig and Echo pins of the HC-SR04 were respectively joined to the Arduino digital pins 3 and 2. The hardware sketch can be seen in the inset of Figure 1. A correct programing code was written to the Arduino IDE (integrated development environment) for precise and accurate displacement measurement. The Arduino software provides a text editor to write the codes, a text console, a button-integrated toolbar, and a message area. The sketch written in the IDE was then compiled and uploaded to the Arduino Uno board via USB port to communicate with the HC-SR04 for displacement sensing purpose. Once the codes have been uploaded to the Arduino Uno board, the Arduino boot is automatically activated and save the codes in the microcontroller.

Results and Discussion
The force-displacement graphs are given in Figure 2. The upper and lower graphs respectively show the trends for the displacements measured by the sensor and ruler. Both graphs depict well-defined linear functions with general equation y = a + bx, where y is the force (N), a is the y-intercept (N), b is the slope (N/cm) and x is the displacement (cm). The slope, b, is equal to the spring constant with a unit of N/cm. The linear equation is equivalent to F = F0 + kx. The linear fitting functions for the upper and lower plots are given in Equations (1) and (2), respectively. The linearities of both fittings are excellent with both Pearson's r and adjusted R-square values of nearly unity. F = 0.2878 + 0.0635x (1) F = 0.2995 + 0.0626x (2) From Figure 1, we are informed that the displacement measurement, which reflects the change in equilibrium positions of the spring-mass system before and after being attached by a metallic bar, captured by the HC-SR04 sensor and a ruler (with 0.1 cm divisions) provide very similar results. It indicates that the Arduino-Uno-based sensor has been accurately calibrated with a reference standard, i.e., the ruler. A calibrated displacement sensors are essential for all dimensional metrology spectra (Haitjema, 2020). This well-calibrated HC-SR04 sensor can be further used for other displacement measuring purposes, not limited to the spring-mass motion only, with excellent noncontact range detection from 2 cm to 400 cm.
Taking the average value, the spring constant is close to 6.3 N/m. It means that a 6.3-newton force is required to displace the spring with elongation of 1 meter. That force is equivalent to 0.63-kg mass, assuming the gravitational acceleration is 10 m/s 2 , attached to the spring for 1-m displacement. This part of the experiment is crucial to further examine the characteristics of the simple harmonic motion, with angular frequency (measured in radian per second)and period T (in second), by the spring-mass system. Inferred from the Equation (3) and (4), the small period, and thus a large angular frequency, is produced by a light mass and a stiff spring, and vice versa (Serway & Jewett, 2018). (1) and (2), the last two equations reflect the oscillatory motion with sinusoidal nature, or the so-called simple harmonic motion. In the succeeding paragraphs, we will note that the displacement at time t has to come back to its initial value for every period T, in which for all time t, Equation (5) is satisfied.
x(t) = x(t + T) (5) For the sinusoidal nature, the periodicity is 2hence the angular frequency follows Equation (6). Figure 2. Force-displacement dependency for the spring-mass system.   Figure 3 shows the sinusoidal patterns (which can be represented as sine or cosine functions) of the simple harmonic motion by the spring-mass systems for the displacement with an arbitrary unit. It is clearly seen that the amplitude of the oscillation increases as the addition of mass. On the other side, the oscillation takes longer time to return to its initial value. Mathematically speaking, the period of the simple harmonic motion increases due to the mass addition. On top of that, smoother shapes of sinusoidal patterns are observed for the spring-mass systems with masses of above 100 g.
The observed data were then fitted by appropriate mathematical function, i.e., sinusoidal fitting. The general equation is y = y0 + A sin (t + ), where y is the displacement (cm), y0 is the initial vertical position (cm), and is the phase angle (rad).
The fitting sample plot is shown in Figure 4. The black and the green lines respectively refer to the measured data and the sine fitting. It is visible that the model function fits the data points. The explicit expressions of the sinusoidal nature of the spring-mass systems are tabulated in Table 1. The initial vertical position decreases, from 42.66 cm to 11.17 cm, as the mass is added from 50 g to 250 g. The amplitude of the simple harmonic motion elevates due to the mass addition, ranging from 2.09 cm to 4.56 cm. in contrast, the angular frequency declines from 3.26 rad/s to 1.57 rad/s. Meanwhile, the phase angle fluctuates with average value of -0.564 rad.
From those displacement functions, the period of oscillation can be calculated using the mathematical fact that  or T The period obtained from this relationship is denoted as TA. Taking into consideration the spring constant from Equation (1), the period can also be calculated from Equation (4). The periods TA and TB are given in Table 2, including the percent-difference of the absolute value of TA -TB. It is noted that the period of the simple harmonic motion escalates from 0.61 s to 1.27 s. The differences between the period calculation from T and Equation (4) are ranging from 2-5%. In statistical viewpoint, these deviations are acceptable (Yi, 2017). Another point to be inferred from Table 2 is that the periods of the springmass simple harmonic motion can be precisely obtained with or without incorporating the spring constant.
This easy set-up that enables learners to observe the spring-mass system oscillation and to directly visualize its mathematical representations is proposed to provide a lot of benefits in physics learning. Many teachers have realized that the use of such simple experimental set-ups can help them to be more effective in physics experiments, physics teaching and learning (Çoban & Çoban, 2020;Galeriu, 2018;Kinchin, 2018;Yulianti et al., 2020). This experiential learning provides excitement in doing science experiment. Finally, this hands-on experiential learning that incorporates the use of computer programming, integrated electronics, mathematics, and physics offers proper teaching and learning content for future educational reform, for example arts-integration on science, technology, engineering, and mathematics education (STEM/STEAM). To the best of our knowledge, even teachers can involve the students to develop their own programming code on Arduino for other simple physics experiments. Using Arduino for learning is supposed to be one of the best way to apply technology in STEM/STEAM activities in education (Hsu et al., 2018;Manosuttirit, 2019;Sun & Wang, 2019). This recent paper can be further used as a guideline for physics teachers to create another easyto-use experimental set-up in the classroom setting, in particular to demonstrate the connection beauty of graphical and mathematical representations in teaching physics.

Conclusion
A real-time and simple experimental set-up to observe the simple harmonic motion of the springmass system has been designed using low-cost Arduino-based sensor. The collected data from the HC-SR04 sensor were automatically read on Microsoft Excel as well as its real-time graphical display. Our experiment revealed that the sinusoidal nature of the simple harmonic motion can be visually observed on the Microsoft Excel graph as the sensor reads displacement of the spring-mass motion. The displacement reading from sensor is very close to the result from the standard ruler. The sensor provides real-time data acquisition, i.e. displacement as the function of time, which cannot be recorded by the traditional measurement using ruler. Further mathematical relationships between spring force and displacement or between mass and period can be comprehensively studied from this experimental setup. At the end, the set-up is proposed as the applicable simple experiment for the future STEM/STEAM-based education.