SciELO - Scientific Electronic Library Online

vol.40 issue1The force of static friction is not conservativeFourier analysis of nonlinear pendulum oscillations author indexsubject indexarticles search
Home Pagealphabetic serial listing  

Services on Demand




Related links


Revista Brasileira de Ensino de Física

Print version ISSN 1806-1117On-line version ISSN 1806-9126

Rev. Bras. Ensino Fís. vol.40 no.1 São Paulo  2018  Epub July 20, 2017 


On mechanical vibration analysis of a multi degree of freedom system based on arduino and MEMS accelerometers

Marcus Varanis*  1 

Anderson Langone Silva1 

Arthur Guilherme Mereles1 

1Universidade Federal da Grande Dourados, Faculdade de Engenharia Rodovia Dourados, Rod. Dourados, Itahum, s/n, Cidade Universitária, Dourados, MS, Brazil


This paper is aimed at undergraduate students of physics, engineering and mathematics, where a methodology for mechanical vibration analysis of a multi degree of freedom (DOF) excited by an harmonic force in the time and frequency domain is presented. The Arduino microcontroller is used as an acquisition system and low-cost MEMS accelerometers for the instrumentation of the system. System of multi DOF are studied in a great number of problems in mechanical sciences, however its experimental study is not always present in the courses due to the high costs and complexity. These problems are overpassed with the study proposed in this work. Besides, the application presented has an interface with several disciplines in undergraduation and graduation level. The method proposed can be easy implemented and the results obtained had good precision and are in agreement with the literature.

Keywords: Arduino; MEMS accelerometers; multi degree of freedom systems; mechanical vibration analysis

1. Introduction

The vibration phenomenon is seen in many everyday situations and is present in speaking, vision, audition and other activities involving human relation due to mechanical waves as well as digital communication through electromagnetic waves [1, 2]. Also, this phenomenon is necessary in several engineering applications such as in vehicle suspension, where the vibration is used to improve the comfort of the driver.

A mechanical system can have infinite of degree of freedom (DOF), but for a more simple analysis they are modeled as systems with a finite number DOF. In this way, the system can be described completely and a qualitative as well as quantitative idea of the system can be obtained. For example, some engineering structures like bridges and buildings, despite having infinite degrees of freedom, are commonly discretized for a better analysis.

The resonance phenomenon is found in a great number of applications where there is vibration and it happens when the frequency of excitation is equal to the natural frequency of the mechanical system which can cause damage in machines or structures. Therefore, the knowledge of the natural frequency of the structure as well as the excitation frequency is vital to avoid faults in engineering structures. The characterization of the natural frequency of a structure can be done analytically and experimentally. In undergraduate courses the analytical methods are introduced to the students, but it's interesting for them to know how to measure the natural frequency of structures and identify when they are at resonance.

However, the experimental setup needed to measure the natural frequency can be expensive and the procedures technically difficult. To overcome these problems, in this paper the use of the Arduino microcontroller model Mega2560 Rev.3 together with low-cost MEMS sensors for measuring mechanical vibrations is presented, which is a cheap and simple alternative for an acquisition system. The sensors were used to measure the oscillations of a three story shear-building structure in its free vibration and when excited by an unbalance motor. The structure was excited near its natural frequency to characterize the resonance phenomenon.

A similar acquisition system was used in [3], were the kinematic quantities of a beam were obtained using accelerometer, gyroscope and ultrasound sensors. The results obtained were compared with analytical models and computer simulations. In [4] a gyroscopic sensor was used to measure the oscillations of a nonlinear pendulum which were compared with an analytical model; the Arduino was used as an acquisition system as well. Also, references [5]–[9] present the application of the Arduino for educational purposes.

Due to the low-cost and easy implementation of the Arduino microcontroller, its use it's motivated in wireless sensors networks (WSNs), which can be used from energy harvesting to monitoring processes. For some example in [10] a WSN is presented for Structural Health Monitoring (SHM) where the network is tested in a modal analysis in a cantilever beam, the results obtained are compared with the conventional wired vibration measurement system. In addition, references [11]–[15] present more applications of the Arduino in WSN.

The objective of this paper is to present the use of the Arduino microcontrollers for mechanical vibration analysis as done in [3] and [4], but with a study on a multi-DOF mechanical system, more specifically a three story shear building. The mechanical system studied is widely used in dynamic of structures with several stories, where each story is represented for a one-DOF mass-spring system [1620].

2. Shear building model

The shear building structure is a mechanical system with infinite DOF, but it can be modeled as an equivalent spring-mass system, creating thus a lumped parameter or lumped mass system. This is commonly done to facilitate the analysis since in some engineering applications the interested parameters are the frequency of vibration and the vibration modes. The minimum number of coordinates necessary to describe the motion of the lumped masses and rigid bodies defines the number of degrees of freedom of the system. The system can be modeled as a unidimensional one due to its vibration characteristic, i.e, the horizontal vibration is more representative than the others.

In this paper a three story shear building is studied and modeled as a 3-DOF spring-mass system. The springs and dampers which connects the masses are the equivalent ones; this reduces the number of viscoelastic element by half [1], [2], [18], [21]. Figures 1.a and 1.b show a schematic of the shear building structure and the spring-mass system used to model it, respectively.

Figure 1 a) Three story shear building and b) Spring-mass model. 

The equivalent spring stiffness of the structure's columns which have rectangular cross-sectional area is obtained using (1) [1]; where E denotes the Young's modulus of the column's material, l is the the column's length and I is the polar moment of inertia of the cross-sectional area and is obtained using (2), being b and h the column's width and thickness, respectively

k=3EIl3 (1)
I=bh312 (2)

In order to obtain the system's equation of movement (EOM) the Newton's second law is applied in each mass of the system. The system of equations (3) shows the EOM for the system's masses, which are linear ordinary differential equations. These equations are coupled with each other. Equation (4) can be rearranged in a matrix form, which is presented in Equations (5) and (6). With the equations in this form, the application of analytic methods as well as the manipulation of them is simplified. In addition, the damping can be modeled as Rayleigh damping, which is defined as shown in equation (6), where α and β are given constants A wider approach can be found in [1], [2], [18], and [21]

m1x1¨+c1+c2x1-c2x2+k1+k2x1-k2x2=0m2x2¨+c2+c3x2-c2x1+k2+k3x2-k2x1=0m3x3¨+c3x3-c3x2+k3x3-k3x2=F(t) (3)
m1000m2000m3x1¨x2¨x3¨+c1+c2-c20-c2c2+c3-c30-c3c3x1x2x3+k1+k2-k20-k2k2+k3-k30-k3k3x1x2x3=00F(t) (4)
M+C+Kx=F (5)
c=αm+βk (6)

Alternatively, the system of equations (3) can be obtained using the Euler-Lagrange formulation [2]. For such, the kinetic and potential energy of the system has to be obtained. Equations (7) and (8) present the kinetic and potential energy. As the system has dampers, an equation for the dissipation energy has to be given, which is presented in equation (9), considering viscous damping

T=12m1x12+12m2x22+12m3x32 (7)
V=12k1x12+12k2x1-x22+12k3x2-x32 (8)
Ed=12c1x12+12c2x1-x22+12c3x2-x3 (9)

Given the kinetic, potential and dissipation energy equations, the Lagrangian of the system can be obtained using equation (10). Furthermore, the EOM for each mass can be obtained applying the Euler-Lagrange equation shown in equation (11) and (12).

L=T-V (10)
ddtTx1-Tx1+Vx1+Edx1=0ddtTx2-Tx2+Vx2+Edx2=0ddtTx3-Tx3+Vx3+Edx3=F(t) (11)
ddtTxi-Txi+Vxi+Edxi=Fi;i=1,2,3 (12)

The system of equations (11) gives the EOM for each mass shown in equation (3) when the equations (7), (8) and (9), for the kinetic, potential and dissipation energy, respectively, are used and the differentiations are done.

As we are interested only in the obtention of the structure's natural frequencies of vibration and to simplify the calculations, the damping of the system will not be considered in the model. Therefore, the system's EOM reduces to,

M(t)+Kx(t)=F (13)

The solution of the free vibration of the system is given by

xt=ϕejωnt (14)

where ωn is the natural frequency and ϕ the corresponding mode of vibration of the system. Substituting equation (13) in (12), the following eigenvalue and eigenvector problem is obtained,

[K]-ωn2[M]ϕ=0 (15)

Since we are interested in the nontrivial solutions, the following characteristic equation is obtained

detK-ωn2M=0 (16)

Equation (16) is a three-order polynomial equation which solutions gives the natural frequencies of the system, ωn1 , ωn2 and ωn3 . The natural frequencies obtained solving (16) can be used to obtain the system's modes of vibration, {ϕ}1 , {ϕ}2 and {ϕ}3 using equation (15). The stiffness [K] , obtained using equation (1), and the mass [M] matrices for the studied structure are given by the following


Applying these matrices in equation (16), which is a characteristic equation for an eigenvalue and eigenvector problem; the first, second and third natural frequencies are obtained analytically, which are 4.09, 12.54 and 19.32 Hz, respectively.

3. Data Acquisition System

The experimental setup consists of an Arduino board model Mega 2560 Rev. 3 based on the ATmega2560 microcontroller which has 54 digital I/O pins, 16 analog pins and 4 serial pins [2223]; and two MEMS-based accelerometers, one model ADXL335 of Analog Devices, and other model MPU6050 of Invensense.

The Arduino is an open-source hardware- and software-based electronic prototyping platform of easy use that can be used as a signal acquisition, to control motors and a great number of other things, by means of written programs in an easy-to-use computer language The Arduino board has analog and digital pins as well as some digital communication interfaces, being the SPI e I2C the most used ones [4].

One of the MEMS-based sensor used consist in a chip containing an accelerometer and a gyroscopic sensor, produced by Invensense model MPU6050. The accelerometer sensor possesses a configurable range of measurement between ±2, ±4, ±8 and ±16 g with a 16 bits resolution, while the gyroscopic sensor has a range between ±250, ±500, ±1000, ±2000 /s, also configurable and with a 16 bits resolution. The linkage of the MPU-6050 chip with the Arduino is done by means of the serial pin via I2C protocol [3], [4], [24] and [25]. The linkage of the MPU-6050 with the Arduino can be seen in the appendix.

The second MEMS-based sensor is an accelerometer produced by Analog Devices model ADXL-335 which has a fixed range of measurement of ±3 g. The output signal from the accelerometer is analogical in the form of voltage proportional to the acceleration that the sensor was subjected. In this case, as the signal is digitalized by the Arduino, its resolution is 10 bits [2627]. Also, the linkage of the ADXL-335 with the Arduino can be seen in the appendix.

4. Experimental Procedures

The three story shear-building studied is made by four polypropylene plates with dimensions of 400 x 76.2 x 15 mm, and six ASTM A-36 steel plates with dimensions of 300 x 76.2 x 1.75 mm. The complete structure possesses dimensions of 900 x 400 mm. Figure 2.a show the shear-building studied.

Figure 2 a) Three story shear building studied and b) location of the sensor. 

The structure is excited by an unbalanced motor mounted in the center of the top story of the building. The motor was unbalanced placing a mass of 6.59 g distant 15 mm from the axis of rotation as shown in Figure 3. The voltage vs frequency graph was obtained experimentally and it's shown in Figure 4. To control the voltage given to the motor a power source model MPL-3303M of Minipa was used.

Figure 3 Motor used for excite the structure. 

Figure 4 Voltage vs frequency graph of the motor used. 

For the data acquisition of the shear-building, it was mounted in an inertial bench, which is an experimental bench mounted on top of springs with the purpose of isolate the system from others form of excitation. However, the structure can be mounted in classrooms or laboratories on desks using “C” clamps. The problem of not using an inertial bench to perform the measurements is that frequencies from unknown sources can appear.

The signal acquisition was performed with a sample rate of 1 kHz and 8192 points, which were configured in the sketch and uploaded to the Arduino. The measurements were done for the free-vibration of the structure and when it was excited by the unbalanced motor in the steady state with the frequencies of excitation near the natural frequencies of the structure. Also, measurements were performed considering the transient state of the motor, were the frequency of excitation was varied from 0 to 24 Hz. In this last measurement more points were used, 32768, but the sample rate was maintained. In addition, the accelerometers were mounted in the structure's walls over an aluminum support which was fixed on the structure using bee wax, as shown in Figure 2.b.

5. Results

The acceleration of the structure was measured in five different scenarios: a free-vibration; a 4.2 Hz, a 13.12 Hz and a 20.4 Hz of excitation which correspond to the structure's natural frequencies of vibration; and an excitation varying the frequency from 0 to 24 Hz. The excitation frequency was controlled using a variable-voltage power source and defined using the voltage vs frequency graph shown in Figure 4. It was performed ten measurements for each case described. For analysis of the signals in the frequency domain the Power Spectrum Density (PSD) was used. The implementation of the PSD was done using the Python 3.0 computer language by means of the SciPy library [2832]. Also, others computers languages and computers programs can be used such as Matlab [33], Octave [34], Labview [35] and Fortran [36].

Figures 5 to 8 present the measurements done using the ADXL-335 accelerometer, while Figures 9 to 12 show the ones done with the MPU-6050 sensor. Figure 5.a presents the signal given for a free-vibration of the structure when subjected to an initial displacement, and Figure 5.b show the PSD applied in the free-vibration, where the natural frequencies of the structure can be seen in the graph's peaks.

Figure 5 Signal measured in the free-vibration of the structure using the ADXL-335 accelerometer: a) Time history and b) Power Spectrum Density. 

Figure 6 Signal measured when the structure is excited by a frequency of 4.2 Hz using the ADXL-335 accelerometer: a) Time history and b) Power Spectrum Density. 

Figure 7 Signal measured when the structure is excited by a frequency of 13.12 Hz using the ADXL-335 accelerometer: a) Time history and b) Power Spectrum Density. 

Figure 8 Signal measured when the structure is excited by a frequency of 20.4 Hz using the ADXL-335 accelerometer: a) Time history and b) Power Spectrum Density. 

Figure 9 Signal measured in the free-vibration of the structure using the MPU6050 accelerometer: a) Time history and b) Power Spectrum Density. 

Figure 10 Signal measured when the structure is excited by a frequency of 4.2 Hz using the MPU6050 accelerometer: a) Time history and b) Power Spectrum Density. 

Figure 11 Signal measured when the structure is excited by a frequency of 13.12 Hz using the MPU6050 accelerometer: a) Time history and b) Power Spectrum Density. 

Figure 12 Signal measured when the structure is excited by a frequency of 20.4 Hz using the MPU6050 accelerometer: a) Time history and b) Power Spectrum Density. 

Figure 6.a presents the acceleration signal for the case of steady state excitation with a 4.2 Hz frequency. In Figure 6.b, the PSD was applied in the signal where the peak corresponding to the frequency of excitation can be seen. This result is expected since the system is in its steady state. Furthermore, Figures 7.a, 7.b, 8.a and 8.b present the acceleration signal for a 13.12 Hz of excitation, the look of it in the frequency domain, the acceleration signal for a 20.4 Hz of excitation and its look on the frequency domain, respectively. It's worth noting that the higher peak appeared in the frequency domain graphs, just like Figure 6.b, present the frequency of excitation. Figures 912 show the signals obtained using the MPU-6050 which are presented in the same order and has similar features as the signals obtained with the ADXL-335.

Figure 13 show the signals obtained by measuring the acceleration of the structure when it was subjected to a variable frequency of excitation, where Figure 13.a was obtained using the ADXL-335 and Figure 13.b using the MPU-6050. The frequency was varied from 0 to 24 Hz. From the figures one can identify the resonance peaks, which are the instants were the frequency of excitation got near the natural frequencies of the structure. In addition, Table 1 presents the comparison between the values of the natural frequency given by the two accelerometers used and the analytical value.

Figure 13 Measurements of the structure's acceleration when subjected to a variable frequency from 0 a 24 Hz using a) ADXL335 and b) MPU6050 accelerometer. 

Table 1 Comparison between the values of the natural frequencies obtained experimentally and the analytically 

Vibration mode Analytic ADXL335 MPU6050
1 4.09 Hz 4.08 ± 0.00 Hz 4.10 ± 0.00 Hz
2 12.54 Hz 12.94 ± 0.05 Hz 12.84 ± 0.00 Hz
3 19.32 Hz 20.26 ± 0.00 Hz 20.25 ± 0.05 Hz

6. Remarks

In this paper presents an expansion of previous works initiated in [3], which aims at measuring mechanical vibrations using the Arduino microcontroller and low-cost sensors for educational purposes. This work treated in the evaluation of the Arduino and low-cost MEMS-based accelerometers for analysis and characterization of mechanical systems with multi degrees of freedom.

The sensors used showed suitable for the vibration analysis in mechanical systems with multi-DOF in the time and frequency domain. Also, the results obtained, which are shown in Table 1, showed that the measurements are in agreement with the analytical values and almost no variation is seen comparing the values given by the two accelerometers, as one can also note from the table.

The methodology proposed is adequate to undergraduate and graduate courses of physics and engineering, especially in disciplines such as dynamic of rigid bodies, mechanical vibrations, instrumentation, signal processing, dynamic of structures and so on. It's worth repeating the low-cost and simplicity characteristic of the experimental setup presented in this paper, which makes the mechanical vibration analysis more accessible for students. It is important to note that both sensors are suitable for the proposed application.

In the literature one may found that the level of precision of MEMS-based sensors has raised significantly [3745], which allows its use in teaching, research and industrial applications, which require a higher precision in their results. The same can be spoken about the Arduino microcontrollers present in the market, which are being used in a wide range of applications from teaching and research to industrial.

7. Future Works

For the extension of the present work the authors propose:

  • Modal analysis of the three story shear building;

  • Use of piezoelectric sensors;

  • Remote monitoring of structures;

  • Evaluate the acquisition system proposed in this work on rotative systems.


The authors acknowledge the Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq) for the support.

Supplementary material

The following online material is available for this article:



[1] S.S. Rao and F.F. Yap, Mechanical Vibrations (Addison-Wesley, Boston, 1995), 3rd ed. [ Links ]

[2] B. Balachandran and E. Magrab, Vibrations (Cengage Learning, Toronto, 2008), 2nd ed. [ Links ]

[3] M. Varanis, A. Silva, P. Brunetto e R. Gregolin, Revista Brasileira de Ensino de Física 38, 1301 (2016). [ Links ]

[4] M. Varanis A. Silva, A. Mereles, C. Oliveira e J. Balthazar Revista Interdisciplinar de Pesquisa em Engenharia-RIPE 2 44 (2017). [ Links ]

[5] V. Boonsawat, J. Ekchamanonta, K. Bumrungkhet and S. Kittipiyakul, in: The Second Conference on Application Research and Development, Chon Buri, Thailand, 2010, [ Links ]

[6] D. Gillet F. Geoffroy, K. Zeramdini, A. Nguyen, Y. Rekik and Y. Piguet International Journal of Engineering Education 19, 389 (2003). [ Links ]

[7] R. Balogh, in: Proceedings of the 1st International Conference on Robotics in Education, edited by R. Stelzer (Slovak University of Technology, Bratislava, 2010), p. 119. [ Links ]

[8] J. Sarik and I. Kymissis, in: Frontiers in Education Conference, edited by Y. Wang (IEEE, New York, 2010), p. T3C-1. [ Links ]

[9] R. Xu, S. Zhou and W.J. Li, IEEE Sensors Journal 12, 1166 (2012). [ Links ]

[10] S. Sohn, S. Rim and I. Lee Advanced Science and Technology Letters 98 18 (2015). [ Links ]

[11] J. Son, B Ahn, J. Ha and B Choi Measurement 94 680 (2016). [ Links ]

[12] A. Jaber and R. Bicker International Journal of Materials Science and Engineering 3, 66 (2015). [ Links ]

[13] A. Mane and J. Rana, International Journal of Current Engineering and Technology 4, 2224-2228 (2014). [ Links ]

[14] S. Ferdoush and X. Li Procedia Computer Science 34, 103 (2014). [ Links ]

[15] R. Naveenkumar and P. Krishna, International Journal of Science and Research 2 366 (2013). [ Links ]

[16] A.A. Shabana, Theory of Vibration: An Introduction (Springer Science & Business Media, Berlin, 2012). [ Links ]

[17] F. Arnold, R. Arthur, L.G. Roger e M. Oliveira, Revista Brasileira de Ensino de Física, 33, 4311 (2011). [ Links ]

[18] H. Soriano, Introdução a Dinâmica de Estruturas (Elsevier, Rio de Janeiro, 2014). [ Links ]

[19] A.K. Chopra, Dynamics of Structures (Prentice Hall, New Jersey, 1995). [ Links ]

[20] M. Paz, Structural Dynamics: Theory and Computation (Springer Science & Business Media, Berlin, 2012). [ Links ]

[21] R. Haberman, Mathematical Models: Mechanical Vibrations, Population Dynamics, and Traffic Flow (Siam, Philadelphia, 1998). [ Links ]

[22], accessed 20/03/2017. [ Links ]

[23] S. Monk, Programação com Arduino (Bookman, Porto Alegre, 2013). [ Links ]

[24], accessed 20/03/2017. [ Links ]

[25], accessed 20/03/2017. [ Links ]

[26] A, DEVICES. ADXL335: Small, Low Power, 3-Axis±3 g Accelerometer, Jan, 2010. [ Links ]

[27] A. Hjorand and M. Holmberg, Measuring Mechanical Vibrations Using Arduino as a Slave I/O to an EPICS Control System (Uppsala University, Uppsala, 2015), available at [ Links ]

[28] J. Unpingco, Python for Signal Processing (Springer, Berlin, 2013). [ Links ]

[29] F.J. Blanco-Silva, Learning SciPy for Numerical and Scientific Computing (Packt Publishing Ltd, Birmingham, 2013). [ Links ]

[30] A. Devert, Matplotlib Plotting Cookbook (Packt Publishing Ltd, Birmingham, 2014). [ Links ]

[31] T. Oliphant, Computing in Science & Engineering 9, 10 (2007). [ Links ]

[32] F. Perez, B. Granger and J. Hunter, Computing in Science & Engineering 13, 13 (2011). [ Links ]

[33] M. Charbit, Digital Signal and Image Processing Using MATLAB (John Wiley & Sons, New York, 2010). [ Links ]

[34] J. Eaton, D. Bateman and S. Hauberg, Gnu Octave (Network Theory, London, 1997). [ Links ]

[35] N. Kehtarnavaz and K. Namjin, Digital Signal Processing System-Level Design Using LabVIEW (Newnes, Boston, 2011). [ Links ]

[36] W. Press, S. Teukolsky, W. Vetterling and B. Flannery, Numerical Recipes in FORTRAN (W.H. Press, Cambridge, 1992). [ Links ]

[37] C. Acar and A. Shkel, Journal of Micromechanics and Microengineering 13, 634 (2003). [ Links ]

[38] S. Thanagasundramand and F.S. Schlindwein, Journal of Mechanical Engineering Science 220, 220 (2006). [ Links ]

[39] G.S. Maruthi and V. Panduranga, Power Electronics and Drives Systems IEEE 2, 838 (2005). [ Links ]

[40] S. Korkua, H. Jain, W. Lee and C. Kwan, in: Industrial and Commercial Power Systems Technical Conference (I&CPS) (IEEE, New York, 2010), p. 1-6. [ Links ]

[41] C. Ratcliffe, D. Heider, R. Crane, C. Krauthauser, M. Yoon and J. Gillespie, Composite Structures 82, 61 (2008). [ Links ]

[42] G. Pang and H. Liu, Journal of Intelligent and Robotic Systems 30, 249 (2001). [ Links ]

[43] S. Korkua, H. Jain and W. Lee, in: 2010 IEEE Industrial and Commercial Power Systems Technical Conference-Conference Record (IEEE, New York, 2010), p. 1-6. [ Links ]

[44] A. Albarbar, S. Mekid, A. Starr and R. Pietruszkiewicz, Sensors 8, 784 (2008). [ Links ]

[45] S. Bhattacharya, A. Krishna and D. Lombard, Soil Dynamics and Earthquake Engineering 36, 111 (2012). [ Links ]

Received: March 27, 2017; Revised: May 15, 2017; Accepted: June 05, 2017

*Correspondence email address:

Creative Commons License License information: This is an open-access article distributed under the terms of the Creative Commons Attribution License (type CC-BY), which permits unrestricted use, distribution and reproduction in any medium, provided the original article is properly cited.