Development of Vibration Spectrum Analyzer Using The Raspberry Pi Microcomputer and 3 Axis Digital MEMS Accelerometer ADXL345
Development of Vibration Spectrum Analyzer Using The Raspberry Pi Microcomputer and 3 Axis Digital MEMS Accelerometer ADXL345
net/publication/317293600
CITATIONS READS
25 12,873
6 authors, including:
All content following this page was uploaded by Vasyl Teslyuk on 29 August 2018.
52
Contact methods are the simplest methods for measuring motors and transmitted to a computer through a data acqui-
vibration using piezoelectric sensors [4]. Such methods make sition board. A virtual tool that enables real-time monitoring
it possible to measure with a high accuracy in the range of and Fourier analysis of the signals received from the vibra-
low frequencies and relatively large amplitudes of vibration tion sensor was implemented in the LabVIEW system [10].
but due to their high inertia, signal waveform is distorted A built-in system for monitoring pump unit vibrations
which makes unfeasible measurement of high-frequency, based on the Microchip Co. microcontroller has been devel-
small-amplitude vibrations. Besides, if weight of the object oped in [9]. Its data acquisition and analysis software were
under study and therefore its detention lag is small, then optimized for testing pumps with turbo-supercharging at
such a sensor can significantly affect the vibration character rotational speeds of up to 2000 rpm.
introducing extra measurement errors. The software task was limited by auto-diagnostics but
These drawbacks are eliminated by the method of open it can be configured for individual and manual vibration
resonator [5]. The essence of this method consists in mea- diagnostics. The only limitation of the system is the acceler-
suring parameters of the high-frequency resonator which ometer characteristics. The authors have carried out a large
vary according to vibration of the object under study. The number of measurements on various turbines to determine
resonator has two mirrors of which one is fixed and the operating conditions of pumping units using the developed
other is mechanically connected with the object. Offsets system [9].
at small vibration amplitudes are recorded by an amplitude A method for determining offset and speed from accel-
method proceeding from variation of the output power. This eration signals taken from accelerometers was described in
measurement method requires a steady power supply to the [10], and a method for monitoring reliability of bridge struc-
resonator and a high stability of the excitation frequency. tures using MEMS accelerometers was developed in [11].
All non-contact methods for measuring vibration are A system for monitoring machine tools and machining
based on probing the object with acoustic and electromag- processes was developed in [12]. The vibration signal ac-
netic waves. One of the latest solutions is the ultrasonic quisition system is based on the Arduino microcontroller
phaseometry method [6]. The basic idea is to measure the connected to a computer via an USB port. A specially de-
current value of the phase difference between the reference veloped software under LabVIEW reads and processes data
signal of ultrasonic frequency and the signal reflected from in real time.
the object being studied. This method advantages include Suitability of micro-electromechanical (MEMS) ac-
low cost and compactness of the apparatus, small measure- celerometers for monitoring state of CNC machines was
ment time, absence of restrictions to the frequency range and studied in [13].
a high accuracy when measuring low-frequency vibrations. Tests were conducted on an actual CNC machine work-
High ultrasound attenuation in the air, dependence on the ing in a typical industrial workshop. It was shown that
atmospheric conditions, worsening measurement accuracy MEMS sensors can be a good alternative to standard vibra-
with the growth of vibration frequency constitute its disad- tion sensors because they do not require heavy electrometric
vantages. amplifiers. Such sensor must be chosen in accordance with
Methods of object probing with visible light are widely the requirements of application and the suitability test re-
spread at present [7]. All optical methods are divided into sult. MEMS sensors with special packaging can be used in
two groups. The first group includes the methods based on tough operation conditions.
recording of the Doppler effect [7]. The easiest of them is A number of authors use Arduino microcontrollers in
the homodyne method that enables measurement of ampli- a hardware-software system for measuring mechanical vi-
tudes and phases of harmonic vibrations but it is impossible brations [14]. The ADXL335 accelerometers were used as
to investigate non-harmonic and large vibration amplitudes vibration sensors. The developed system was used in study-
with this method. These disadvantages can be eliminated ing and monitoring vibration of a vacuum pump. The studies
using heterodyne methods. But they require calibration have shown feasibility and expediency of developing built-in
and complex measuring tools. Strict requirement to surface real-time vibration monitoring systems using non-expensive
quality of the object under study is a material disadvantage hardware and software.
of the above methods. But this disadvantage disappears Application of another type of microcontroller is de-
when using holographic methods that form the second group. scribed in [15]. In particular, a system for monitoring vibra-
Holographic methods have high resolution but require com- tions in rotary equipment and machine tools based on the
plex and expensive equipment. In addition, measurement PIC-18F6520 microcontroller and the ADXL322 acceler-
is rather long-lasting. The general disadvantages of optical ometer was proposed. The study was carried out to test the
vibration measurement methods are their complexity, bulk- possibility of recording frequency peaks occurring in various
iness and high cost of equipment, high energy consumption, malfunction cases of failure.
strict requirements to surface quality of the object under The best approaches and technical solutions among the
study and to atmosphere (level of humidity, dustiness, etc.). above-described solutions for the range of tasks involved
In addition, laser radiation has a detrimental effect on the include the methods described in [8], [12] and [13‒15]. The
eyesight of the staff and requires additional precautions and study methods were based on conducting experiments with
protection. various technical objects including measurement of vibra-
Various scientific and technical papers are devoted to the tion parameters, their processing and analysis with the help
development of vibration monitoring and analysis systems. of the self-developed hardware and software systems. The
In particular, a system for monitoring and analysis of vibra- developed systems are closed and expensive which does not
tions occurring in electric motors was developed [8]. The let them to extend their functionality or modify to respec-
system uses a piezoelectric accelerometer (ICP 603C11) and tive operational needs.
the National Instruments’ NI 6009 data acquisition board. Thus, the analysis of existing approaches and technical
Vibration signals are taken from various parts of electric solutions has led to the development of a qualitatively new,
53
Eastern-European Journal of Enterprise Technologies ISSN 1729-3774 6/9 ( 90 ) 2017
inexpensive, open hardware and software system for mon- The developed system operation algorithm includes the
itoring vibrations in real time. Such a system was built of following steps (Fig. 2):
available and inexpensive components, free software with an Step 1. Initialize the ADXL345 accelerometer on the
ability to modify or extend its functionality in accordance I2C bus [20].
with requirements of the application field. Step 2. Read the value from the ADXL345_DEVID
register at 0x00 address and check the accelerometer number
which should be equal to ADXL345_ID 0xE5.
3. The aim and objectives of the study Step 3. Adjust the ADXL345 accelerometer.
Step 4. Switch the sensor to the operating mode (0x00
The study objective was to develop and study a system byte record), set the passband of 100 Hz (0x0A byte record)
for monitoring and analysis of the vibration acceleration using the ADXL345_SetRegisterValue(ADXL345_BW_
spectrum (MAVAS) which is characterized by its low cost RATE, (0x00|ADXL345_RATE (0x0A)))) function.
and ability of rapid device modification according to the Step 5. Set the data format, measurement range 16, in-
technological conditions of the measurement environment. terruption, equalization of the measured values using the
To achieve this objective, the following tasks had to be ADXL345_SetRegisterValue(ADXL345_DATA_FOR-
solved: MAT, (0x00|ADXL345_RANGE(ADXL345_RANGE_
– develop structure and operation algorithm of the MA- PM_16G)|ADXL345_FULL_RES)) function.
VAS system based on a modular principle; Step 6. Conduct ADXL_NO_SAMPLES measurements
– develop a physical model of the MAVAS system built (samples) of acceleration on all three axes x, y, z at a step of
with the use of general-purpose hardware components and ts = 1e6/FS (where Fs is the sampling rate) and record their
characterized by low-cost technical solutions; values in two-byte integer 1024 size arrays.
– develop specialized software for the MAVAS system Step 7. Calculate real acceleration values ax, ay, az in the
which enables realization of a manifold functionality. time interval from 0 to 1e6/FS by the formula axx[i]×g/
LSB×9.80665, xx is measurement axis x, y or z. The g/LSB
ratio at the set bit FULL_RES = 1 in the maximum resolu-
4. Development of the MAVAS system structure tion mode is 0.0039. Record the obtained values in arrays.
Step 8. Record the calculated acceleration values in
The developed MAVAS system structure shown in Fig. 1 fp_samples_ax, fp_samples_ay, fp_samples_az, fp_sam-
includes the following main components: ples_a files.
– the Raspberry Pi 3, Model B single-board microcom- Step 9. Call the adxl345_spectrum_analysis(ADXL_
puter (MC) [16, 17] intended for acquisition and processing NO_SAMPLES, FS); function to calculate the DFT [21, 22].
of the data taken from a vibration sensor (accelerometer); Step 10. Record the obtained spectrum data into files
– the Analog Devices’ triaxial digital ADXL345 acceler- and plot the functions of acceleration dependence on time
ometer used as a vibration acceleration sensor [18, 19]; and spectra.
– a flash memory for installation of OS, drivers, software The developed structure of the MAVAS system is based
and data storage; on the modular principle which makes it possible to quickly
– a 7” color graphics TFT display for viewing informa- and efficiently modify the MAVAS system in the process of
tion arriving from the Raspberry Pi 3 MC; its improvement. Besides, the low cost of the design solution
– wireless communication interfaces for a remote infor- is ensured by the use of cheap general-purpose hardware
mation exchange with the PC. components and free software.
7" color
7" color graphics
graphics
TFT display
TFT display
Triaxial digital
Triaxial digital SCL
SCL Flash memory
Flash memory
ADXL345
ADXL345 Raspberry Pi
Raspberry Pi 33
accelerometer
accelerometer Model B
Model B
single-board
single-board
SDA
SDA Keyboard
Keyboard
microcomputer
microcomputer
Wireless
Wireless
I2C bus
I2C bus communication
communication
interfaces for
interfaces for remote
remote
information exchange
information exchange
а
b
Fig. 1. Designed structure of the MAVAS system and the circuit for connecting the ADXL345 accelerometer to
the Raspberry Pi MC: a – the MAVAS block diagram; b – the MAVAS physical model
54
Information and controlling systems
55
Eastern-European Journal of Enterprise Technologies ISSN 1729-3774 6/9 ( 90 ) 2017
issues warning messages or stops the machine in a case of in- high transmission rate of 400 kHz are supported for the I2C
admissible vibrations, thus preventing possible breakdowns interface. The ALT_ADDRESS line is responsible for the
and accidents. The system also provides the user with suffi- accelerometer address on the I2C bus. At a high logic level
cient information so that he can identify possible problems in the line, the accelerometer is assigned a 7-bit address with
and take preventive measures based on the analysis of the a 0011101 (0x1D) value and at a low level, the address value
vibration spectrum for a concrete machine. is 1010011 (0x53). For a proper operation of the interface,
The main advantages of such system at the level of pro- the SDA and SCL lines should be connected to the supply
duction management are as follows: prevention of failures of voltage through the Rp (4.7 kOhms) resistors. Because of
the spindle and the machine tool as a whole and protection limitation of the data transfer rate to 100 kHz, the maximum
of the cutting tool and the workpiece. The system prevents acceleration measurement frequency at the I2C interface
damage to the especially important machine assemblies due should not exceed 800 Hz.
to the use of the rapid impact response
function. Such monitoring system can
be integrated into a CNC system. It can
warn in a timely manner on a potential
malfunction which enables the user to
take timely preventive measures.
Monitoring of total vibration
should be carried out both in time and
in frequency bands. In the time range,
the system continuously monitors the
machine status in real time based on
a broadband measurement of vibration
velocities, vibration accelerations and
vibration offsets. Fig. 4. Circuit for connecting the ADXL345 accelerometer to the I2C interface
In the frequency range, a number of (address 0x53)
resettable margins for warning and alarm
signals in various frequency ranges can be set. These ranges The information exchange with the accelerometer is
cover the entire spectrum of vibration and allow the user to carried out according to the following algorithm. First, the
make analysis of the vibration level in the controlled area to Raspberry Pi MC sends (via the I2C bus) the address of the
know whether there is an override of the entire frequency device register from which data will be read or written to it.
spectrum. Then, data are sent for recording to this register or a speci-
The system allows users to perform vibration analysis in fied number of bytes are read from the device.
the time range in three separate resettable frequency ranges. Initialization of the ADXL345 accelerometer includes
The first of them is a low-frequency range with an adjustable three steps:
bandwidth to determine the boundary of vibrational offsets 1. Activation of the measurement mode by setting 3 bits
within the specified range. The second one is the frequency in the POWER_CTL register (address 0x2D). The value
band with adjustable bandwidths to determine boundary of 0x08 is recorded to it.
the vibration velocity within the specified range. The third 2. Definition of the data format in the DATA_FORMAT
high-frequency range with an adjustable bandwidth is in- register (address 0x31).
tended for determining the vibration acceleration boundary 3. Recording offsets OFSX, OFSY, OFSZ in the OFF-
within the specified range. SET registers. The OFFSET register addresses are 0x1E
The bands can be selected based on the machine tool (OFSX), 0x1F (OFSY), 0x20 (OFSZ).
configuration, the operating conditions and the characteris- With the help of the DATA_FORMAT register, format
tics of expected failures. of the output data for the DATAX, DATAY, DATAZ reg-
isters and a number of other functions are adjusted. Using
5. 2. Analysis of vibrations in the frequency range the FULL_RES bit of the DATA_FORMAT register, res-
The system applies the formulation with the use of fast olution of the acceleration measurement is adjusted. When
Fourier transform (FFT) for recording of the vibration spec- setting the bit, the extended resolution mode is switched
trum and real-time analysis of the frequency range [21‒23]. on which depends on the boundaries set by the Range bits
The following functions are provided in the system: the and the result of the measurement is calculated based on
saving function, the averaging function and the function of the factor of 3.9 mg/LSB. The zero-bit value sets the fixed
comparative analysis. The saving function is used for record- resolution of 10 bits, and the measurement result along with
ing and storing characteristic vibration spectra. The averag- the calculation factor will depend on the selected bound-
ing function is used to find the average value of the measured ary. The Justify bit of the DATA_FORMAT register sets
spectra in order to construct a total spectrum of character- the method for aligning the measurement result inside the
istic vibrations. The function of comparative analysis is used DATAX, DATAY, DATAZ registers: the bit value equal to
to detect changes in the machine working conditions. 1 sets the left alignment while the bit value equal to 0 sets
the right alignment.
5. 3. Adjusting the accelerometer The output data frequency is adjusted in the BW_RATE
To adjust the ADXL345 accelerometer, it should be register. The adjustment parameters are shown in Table 2
connected to the Raspberry Pi MC via the I2C interface and Table 3. The Rate bits of the register in Table 2 are re-
(Fig. 4). A standard transmission rate of 100 kHz and a sponsible for the output data frequency.
56
Information and controlling systems
57
Eastern-European Journal of Enterprise Technologies ISSN 1729-3774 6/9 ( 90 ) 2017
*y = ADXL 345_GetRegisterValue(ADXL 345_ values from the accelerometer output data values to get a
DATAY1) << 8; // read the high-order byte of the Y axis real acceleration:
data
*y += ADXL345_GetRegisterValue(ADXL345_ X ACTUAL=XMEAS−X0g, (1)
DATAY0); // read the low-order byte of the Y axis data
*z = ADXL 345_GetRegisterValue(ADXL 345_ YACTUAL=YMEAS−Y0g, (2)
DATAZ1) << 8; // read the high-order byte of the Z axis
data where X ACTUAL , YACTUAL are the real values of acceleration;
*z += ADXL 345_GetRegisterValue(ADXL 345_ XMEAS , YMEAS are the measured acceleration values; X0g,
DATAZ0); // read the low-order byte of the Z axis data Y0g are offsets (the values in the absence of rotation around
} any axis).
Since the Z-axis measurements are carried out in a grav-
At the next stage, data in a 16-bit format must be con- itational field at +1 g and the calibration scheme assumes
verted to g values. To do this, the data should be multiplied an ideal sensitivity SZ for the Z axis, this value is subtracted
by a defined constant coefficient which varies depending on from Z+1g to obtain offset along the Z axis which is then sub-
the range of measurement and the accelerometer resolution. tracted from the following measured values to obtain real
In this work, a mode with a maximum resolution of 13 bits acceleration values:
was used which has a coefficient equal to 3.9 mg/LSB.
Consequently, this means that the data must be multiplied Z 0g =Z+1g –SZ , (3)
by 0.0039 to convert them into acceleration values in g units
(1 g=9.80665 m/s2). An example of software implementation ZACTUAL=ZMEAS−Z 0g. (4)
of this operation is given below.
The ADXL345 accelerometer can automatically com-
void ADXL345_GetAccXYZ(double* acc_x, double* pensate the output using the values recorded in the special
acc_y, double* acc_z) OFFSET registers. The registers OFSX (address: 0x1E),
{ OFSY (address: 0x1F), OFSZ (address: 0x20) are intended
int16_t x, y, z; to represent offsets along the X, Y and Z axes, respectively.
ADXL345_GetXyz(&x, &y, &z); The contents of each register are added to the measured
// +/-16g 13 bit mode 3.9 mg/LSB acceleration value for the corresponding axis and the result
*acc_x = (double) x * ADXL345_MG_LSB_ is placed in the DATA registers. The register has a scale
FULL_RES / 1000 * 9.80665; factor of 15.6 mg/LSB and is independent of the select-
*acc_y = (double) y * ADXL345_MG_LSB_ ed acceleration measurement range. The acceleration of
FULL_RES / 1000 * 9.80665; 15.6 mg (calculation factor of 15.6 mg/LSB) corresponds
*acc_z = (double) z * ADXL345_MG_LSB_ to the low-order significant bit taking into account the
FULL_RES / 1000 * 9.80665; sign. For the value 0x7F, approximately +2g is obtained and
} –2 g for 0x80, respectively. Since the value placed in the
registers is added it is necessary to place a negative value in
5. 4. The features of accelerometer calibration and them in order to discard the value of positive offset and vice
setting of OFFSET values versa for a negative offset. For example, let us assume that
Accelerometers are mechanical structures with freely the ADXL345 accelerometer is adjusted with a maximum
moving elements. These moving elements can be very sen- resolution of 13 bits and a sensitivity of 256 LSB/g (±2 g).
sitive to mechanical influences (shocks, shakes), much more The system is oriented so that the Z axis is located in the
sensitive than the electronics itself. Offset at 0 g is an im- gravitational field and the measured initial values of accel-
portant metrics of an accelerometer since it defines a thresh- eration on the X, Y, and Z axes are +10 LSB, ‒13 LSB and
old for measuring real acceleration. Additional measurement +9 LSB, respectively. Using the previous equations, X0g is
errors occur when mounting the system with an accelerom- +10 LSB, Y0g is ‒13 LSB, and Z0g is +9 LSB. Each low-order
eter. These errors can be caused by stresses in the printed significant bit (LSB) of the output at a maximum resolution
circuit board appearing during mounting, usage of various is 3.9 mg or one fourth of the low-order bit of the offset reg-
compounds to the components. Therefore, calibration is rec- ister. Since the value in the register is added, the values are
ommended following the system assembly to compensate for taken with an opposite sign and rounded to the nearest value
the impact of above factors. of the low-order meaningful bit of the offset register.
The easiest way to calibrate the accelerometer consists
in averaging the values of measurements (samples) using XOFFSET=−Round(10/4)=−3 LSB, (5)
the so-called scheme with a single point of calibration. In
the scheme with a single point of calibration, the system YOFFSET=−Round(−13/4)=3 LSB, (6)
with an accelerometer is oriented so that one axis, as a rule,
the Z axis, is located in the 1g gravitation field and the X ZOFFSET=−Round(9/4)=−2 LSB. (7)
and Y axes is located in the 0g field. It is recommended that
at least 10 samples be taken at intervals of 0.1 s at a fre- These values are programmed into OFSX, OFSY and
quency of 100 Hz. These values are stored as X0g , Y0g, and OFXZ registers, respectively, as 0xFD, 0x03 and 0xFE. Like
Z+1g for 0 g measurements in X, Y axes and 1 g measurement all registers in the accelerometer, the ADXL345, OFFSET
in the Z axis. registers do not store the values recorded to them when
The values measured for X0g and Y0g are offsets along the power is turned off. Turn off and repeated turn on of the
X and Y axes. Compensation is done by subtraction of these accelerometer feed return the OFFEST registers to 0x00
58
Information and controlling systems
default values. Since the method of absence of rotation, or /*! Initializing the I2C accelerometer and checking pres-
the single-point method, assumes the perfect sensitivity ence of the device */
along the Z axis, there are no errors caused by sensitivity in unsigned char ADXL345_Init(char commProtocol);
presence of the offset error. For example, if the actual sensi- /*! Transferrring the device to a standby/measure mode) */
tivity is 250 LSB/g, then the offset will be 15 LSB but not void ADXL345_SetPowerMode(unsigned char pwr-
9 LSB. To reduce this error, additional measurement points Mode);
with an axis Z located in the 0 g field can be used and the 0 g /*! Reading the output data for each axis */
measurement can be used in the ZACTUAL equation. void ADXL345_GetXyz (int16_t * x, int16_t * y, in-
Thus, the designed hardware is based on the use of a t16_t * z);
single-board Raspberry Pi MC, digital triaxial ADXL345 /*! Reading of the output data for each axis of the accel-
accelerometers, a flash memory and a liquid-crystal graph- erometer * /
ic display. All this ensures execution of all functions at a void ADXL345_GetAccXYZ(double* acc_x, double*
low cost. acc_y, double* acc_z);
/*! Enabling/disabling activity detection */
void ADXL345_SetActivityDetection(unsigned char
6. Development of software for acquisition and actOnOff, unsigned char actAxes, unsigned char actAcDc,
processing of data from the ADXL345 accelerometer unsigned char actThresh, unsigned char actInt);
*! Setting offset for each axis (Offset calibration) */
To work with the ADXL345 acceleration sensor (acceler- void ADXL345_SetOffset (unsigned char xOffset, un-
ometer), a driver and special software have been elaborated. signed char yOffset, unsigned char zOffset);
The driver reads data from the accelerometer, processes /* Calculating thef DFT of vibration acceleration */
them and performs adjustment of the sensor in accordance void adxl345_spectrum_analysis(unsigned int no_sam-
with the user’s needs. The acceleration values obtained for ples, unsigned int fs);
each axis are written to the ax.dat, ay.dat, and az.dat files, void delay_microseconds(int delay_us).
respectively. The accelerometer driver was developed in the
C language with the use of the wiringPiI2C library and the The developed software is based on the use of a free
gcc compiler [25]. software, namely: the Raspbian Jessie operating system; the
To convert the vibration acceleration signal obtained gcc compiler; the program module driver for working with
from the sensor from the time domain to the frequency the ADXL345accelerometer via the I2C interface and the
domain, a special software was developed that uses the FFTW software library (for calculating the DFT). More-
discrete Fourier transform (DFT) algorithm [21, 22]. The over, the built-in software enables real-time study of the
software for calculating the DFT uses the FFTW software vibration effects on an object, determination of amplitudes
library [24]. The spectral data obtained from the DFT and frequencies, plotting graphs of variation of vibration
signals of vibration acceleration for each axis are record- acceleration over time, calculation of the DFT and obtaining
ed in the spectrum_ax.dat, spectrum_ay.dat and spec- spectra. From the spectra obtained, it is possible to deter-
trum_az.dat files, respectively. Shell scripts accel_plot.sh, mine at which frequencies the amplitudes of vibrations are
spectrum_plot.sh, spectrum_plot_all.sh were worked out maximal which will make it possible to identify vibration
to execute graph plotting. The software was developed for sources and take measures for their attenuation or reduction.
the Raspbian Jessie operating system. Raspbian is a free OS
built on a Unix-like Debian operating system optimized for
the hardware of the single-board Raspberry Pi MC. The 7. Discussion of the results obtained in the study of the
developed software provides the user with system interface, physical model of the vibration acceleration monitoring
data acquisition and analysis, data storage in files of Micro system
SD memory card and visual representation of data as well
as communication with the PC in the net. The developed The results of the study are graphically presented in
software makes it possible to directly compare relative Fig. 5, 6. Fig. 5 shows the change in vibration accelerations
intensities of each frequency component. The software can obtained from the accelerometer along the X, Y, Z axes and
handle incoming information from multiple accelerome- the total value of vibration acceleration along all three axes,
ters connected to the Raspberry Pi MC which enables a respectively. The graphs in Fig. 6 show vibration accelera-
multi-channel measurement and analysis of their results. tion spectra for each axis (X, Y and Z) and the total spectrum
The software records and stores vibration information from for all three axes.
each channel for its further analysis and comparison. This Analysis of the obtained results makes it possible to state
feature allows the user to display intensity of vibrations that the largest peak of the vibration acceleration ampli-
in real time as well as viewing contents of the previously tude falls on the Y axis in a range of frequencies from 10 to
recorded files. 40 Hz. Since the experiment was performed with vibrations
Some features of the developed ADXL345 accelerometer at a frequency of 20 Hz, the result of the spectral analysis
driver and special software are given below: is quite reliable. In the future, it is necessary to calibrate
the accelerometer and carry out experiments with several
/*! Reading the value (byte) from the register */ acceleration sensors by mounting them on the CNC milling
unsigned char ADXL345_GetRegisterValue(unsigned machine head.
char registerAddress); The results obtained in the test study make it possible
/*! Writing the data (byte) to the register */ to state correctness of the developed software and fea-
void ADXL345_SetRegisterValue(unsigned char regis- sibility of the designed system for monitoring vibration
terAddress, unsigned char registerValue); accelerations.
59
Eastern-European Journal of Enterprise Technologies ISSN 1729-3774 6/9 ( 90 ) 2017
а а
b
b
c c
d d
Fig. 5. Change of the output signal of vibration acceleration: Fig. 6. Spectrum of the vibration acceleration signal:
a – along the X axis; b – along the Y axis; a – along the X axis; b – along the Y axis;
c – along the Z axis; d – total value of vibration acceleration c – along the Z axis; d – total spectrum of the vibration
for all three axes acceleration signal
60
Information and controlling systems
Thanks to the use of a digital acceleration sensor with I2C The use of sampling frequencies of 3200 Hz and
and SPI interfaces, it is possible to connect several sensors 1600 Hz is recommended with an SPI bus at a communica-
with various passbands to the bus and monitor vibrations tion frequency greater than or equal to 2 MHz. The input
in various locations of the object under study in real time. signal sampling rate of 800 Hz is only recommended for
Measurements from several accelerometers on the I2C bus communication speeds greater than or equal to 400 kHz.
are possible when connecting their Alt Address outputs to the For example, the minimum recommended exchange rate at a
corresponding Raspberry Pi connections with a programmed sampling frequency of 200 Hz is 100 kHz. Operation at the
control. The Alt Address pin of the addressed accelerometer output data frequencies above the recommended maximum
should be set to a high level (the Alt Address pins of other ac- can result in undesirable effects associated with acceleration
celerometers should be set to a low level) and only this accel- data including data loss or excess noise. The ADXL345
erometer will respond to the 7-bit address 0x1D of the device. sensor passband is from 0.5 Hz to 1.6 kHz (with sampling
In future, the software developed for acquisition and pro- frequencies from 0.10 to 3200 Hz, respectively).
cessing of vibration acceleration data can be easily adapted
using an appropriate driver for working with other vibration
sensors having different frequency ranges of vibration re- 8. Conclusions
cording.
The advantages of this study compared with its coun- 1. What has been elaborated in this study is the structure
terparts consist in the use of inexpensive digital sensors and the algorithm of functioning of the system for moni-
to measure vibration accelerations and the single-board toring and analysis of the vibration acceleration spectrum
Raspberry Pi MC with a small power consumption and the which operates in a real-time mode and is based on a modular
ability of autonomous and remote data exchange via wireless principle that enables fast improvement and modification of
communication means. the device. The designed system makes it possible to analyze
In this system, the accelerometer is connected to the vibration parameters in order to predict and prevent possible
Raspberry Pi MC on the I2C bus. The ADXL345 acceler- accidents, thereby reducing the costs associated with the
ometer supports two modes of data exchange via the I2C bus: failure of cutting tools, expensive components and assem-
the standard mode at 100 kHz and the fast mode at 400 kHz. blies of CNC machines.
In the mode of 100 kHz, the sampling rate of the vibration 2. The MAVAS system physical model which includes
acceleration signal should not exceed 200 Hz, that is, the pass- the Raspberry Pi 3, Model B single-board MC, the triaxial
band of the input signal of vibration acceleration is from 0 to digital ADXL345 accelerometer and the liquid-crystal dis-
100 Hz. In the mode of fast exchange (400 kHz), via the I2C play and is characterized by a low-cost technical solution has
bus, the maximum sampling rate is 800 Hz and the passband been designed and implemented.
is up to 400 Hz, respectively. Disadvantage of this study is 3. Specialized software for the system has been devel-
that when connecting the sensor to the I2C bus, it is possible oped and implemented. It includes the driver for adjusting,
to measure vibrations only in the frequency band from 0 to acquisition and processing of accelerometer data and the
400 Hz. Therefore, to measure vibration accelerations in the appropriate software for plotting the vibration acceleration
band above 400 Hz and up to 1.6 kHz, the accelerometer signals in time and frequency domains. The developed soft-
should be connected to a high-speed SPI bus that will enable ware allows the user to realize wide functionality and is free
data exchange at a maximum frequency of 5 MHz. of charge.
References
1. Marne, N. S. Vibration Measurement System with Accelerometer Sensor Based on ARM [Text] / N. S. Marne, M. S. Nag-
mode, R. D. Komati // International Journal of Emerging Technology and Advanced Engineering. – 2014. – Vol. 4, Issue 4. –
P. 760–764.
2. Iwaniec, J. Output-Only Identification of Vibratory Machine Suspension Parameters under Exploitational Conditions [Text] /
J. Iwaniec, M. Iwaniec // Solid State Phenomena. – 2016. – Vol. 248. – P. 175–185. doi: 10.4028/www.scientific.net/
ssp.248.175
3. Kharchenko, L. Fluctuation of multi-section aboveground pipeline region under the influence of moving diagnostic piston
[Text] / L. Kharchenko, Ye. Kharchenko // Vibration in Physical Systems. – 2014. – Vol. 26. – P. 105–112.
4. Tykhan, M. New type of piezoresistive pressure sensors for environments with rapidly changing temperature [Text] / M. Ty-
khan, O. Ivakhiv, V. Teslyuk // Metrology and Measurement Systems. – 2017. – Vol. 24, Issue 1. – P. 185–192. doi: 10.1515/
mms-2017-0010
5. Du, W. Y. Resistive, capacitive, inductive, and magnetic sensor technologies [Text] / W. Y. Du. – Boca Raton: CRC Press,
2014. – 408 p. doi: 10.1201/b17685
6. Kazys, R. Ultrasonic technique for Vibration Measurements [Text] / R. Kazys, R. Sliteris, L. Mazeika // 15th World Confer-
ence on Non-Destructive Testing. – Rome, 2000.
7. Li, T. Study on the non-contact FBG vibration sensor and its application [Text] / T. Li, Y. Tan, Z. Zhou, L. Cai, S. Liu, Z. He,
K. Zheng // Photonic Sensors. – 2015. – Vol. 5, Issue 2. – P. 128–136. doi: 10.1007/s13320-015-0220-9
8. Rață, G. System for Monitoring and Analysis of Vibrations at Electric Motors [Text] / G. Rață, M. Rață // Intern. Journal of
Emerging Technology and Advanced Engineering. – 2014. – Vol. XXI, Issue 3. – P. 97–104.
61
Eastern-European Journal of Enterprise Technologies ISSN 1729-3774 6/9 ( 90 ) 2017
9. Milovančević, M. Embedded Systems for Vibration Monitoring [Text] / M. Milovančević, A. Veg, A. Makedonski, J. Stefanović
Marinović // Facta Universitatis. Series: Mechanical Engineering. – 2014. – Vol. 12, Issue 2. – P. 171–181.
10. Rocha, S. M. S. Method to Measure Displacement and Velocity from Acceleration Signals [Text] / S. M. S. Rocha,
J. F. S. Feiteira, P. S. N. Mendes, U. P. B. Da Silva, R. F. Pereira // Intern. Journal of Engineering Research and Applications. –
2016. – Vol. 6, Issue 6. – P. 52–59.
11. Sekiya, H. Technique for Determining Bridge Displacement Response Using MEMS Accelerometers [Text] / H. Sekiya,
K. Kimura, C. Miki // Sensors. – 2016. – Vol. 16, Issue 2. – P. 257. doi: 10.3390/s16020257
12. Goyal, D. Development of non-contact structural health monitoring system for machine tools [Text] / D. Goyal, B. S. Pabla //
Journal of Applied Research and Technology. – 2016. – Vol. 14, Issue 4. – P. 245–258. doi: 10.1016/j.jart.2016.06.003
13. Albarbar, A. Suitability of MEMS Accelerometers for Condition Monitoring: An experimental study [Text] / A. Albarbar,
S. Mekid, A. Starr, R. Pietruszkiewicz // Sensors. – 2008. – Vol. 8, Issue 2. – P. 784–799. doi: 10.3390/s8020784
14. Hjort, A. Measuring mechanical vibrations using an Arduino as a slave I/O to an EPICS control system [Text] / A. Hjort,
M. Holmberg. – Uppsala University, 2015. – 25 p.
15. Chaudary, S. B. Vibration Monitoring of Rotating Machines Using MEMS Accelerometer [Text] / S. B. Chaudary, M. Sengup-
ta, K. Mukherjee // Intern. Journal of Sceintific Engineering and Research. – 2014. – Vol. 2, Issue 9.
16. Karvinen, Т. Make sensors projects touch-based devices Arduino and Raspberry Pi [Text] / Т. Karvinen, K. Karvinen, В. Val-
takari. – Мoscow: ООО “I. D. Williams”, 2015. – 432 p.
17. Boreiko, O. Developing a controller for registering passenger flow of public transport for the «smart» city system [Text] /
O. Boreiko, V. Teslyuk // Eastern-European Journal of Enterprise Technologies. – 2016. – Vol. 6, Issue 3 (84). – P. 40–46.
doi: 10.15587/1729-4061.2016.84143
18. 3-Axis, ±2 g/±4 g/±8 g/±16 g Digital Accelerometer. Data Sheet ADXL345 [Electronic resource]. – Available at: http://
www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf
19. ADXL345 Quick Start Guide. AN-1077 [Electronic resource]. – Available at: http://www.analog.com/media/en/techni-
cal-documentation/application-notes/AN-1077.pdf
20. AN10658. Sending I2C-bus signals via long communications cables [Electronic resource]. – Available at: http://www.nxp.
com/documents/application_note/AN10658.pdf
21. Prots’ko, I. Algorithm of efficient computation DSTI-IV using cyclic convolutions [Text] / I. Prots’ko, V. Teslyuk // WSEAS
Transactions on Signal Processing. – 2014. – Vol. 10. – P. 278–288.
22. Blahut, R. E. Fast algorithms for signal processing [Text] / R. E. Blahut. – Cambridge University Press, 2010. doi: 10.1017/
cbo9780511760921
23. Prots’ko, I. Analysis algebraic system of arguments for prime size DHT [Text] / I. Prots’ko // Modern Problems of Radio
Engineering. Telecommunications and Computer Science – Proceedings of the 11th International Conference, TCSET’2012. –
2012. – P. 428.
24. Library DTF FFTW [Electronic resource]. – Available at: http://www.fftw.org/
25. Library wiringPi for Raspberry Pi [Electronic resource]. – Available at: http://wiringpi.com/reference/i2c-library/
62