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 [^{16}–^{20}].

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.

The equivalent spring stiffness of the structure's columns which have rectangular cross-sectional area is obtained using (1) [^{1}]; where

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
^{1}], [^{2}], [^{18}], and [^{21}]

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

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).

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,

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

where

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

Equation (16) is a three-order polynomial equation which solutions gives the natural frequencies of the system,

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 [^{22}–^{23}]; 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
^{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 [^{26}–^{27}]. 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.

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.

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 [^{28}–^{32}]. 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 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 9–12 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.

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 [^{37}–^{45}], 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.