Design and Evaluation of Low-Cost Vibration-Based Machine Monitoring System for Hay Rotary Tedder

Vibration monitoring provides a good-quality source of information about the health condition of machines, and it is often based on the use of accelerometers. This article focuses on the use of accelerometer sensors in fabricating a low-cost system for monitoring vibrations in agricultural machines, such as rotary tedders. The aim of the study is to provide useful data on equipment health for improving the durability of such machinery. The electronic prototype, based on the low-cost AVR microcontroller ATmega128 with 10-bit ADC performing a 12-bit measurement, is able to acquire data from an accelerometer weighing up to 10 g. Three sensors were exposed to low accelerations with the use of an exciter, and their static characteristics were presented. Standard experimental tests were used to evaluate the constructed machine monitoring system. The self-contained prototype system was calibrated in a laboratory test rig, and sinusoidal and multisinusoidal excitations were used. Measurements in time and frequency domains were carried out. The amplitude characteristic of the preformed system differed by no more than 15% within a frequency range of 10 Hz–10 kHz, compared to the AVM4000 commercial product. Finally, the system was experimentally tested to measure acceleration at three characteristic points in a rotational tedder, i.e., the solid grease gearbox, the drive shaft bearing and the main frame. The RMS amplitude values of the shaft vibrations on the bearing in relation to the change in the drive shaft speed of two tedders of the same type were evaluated and compared. Additionally, the parameters of kurtosis and crest factor were compared to ascertain the bearing condition.


Introduction
Mechanical vibration transducers are used to receive a mechanical signal from a vibrating object and convert it into an electrical signal. This signal is properly processed. A measurement system includes a vibration transducer, for instance, a piezoelectric transducer, and an appropriate amplifier. Mechanical vibration measurement systems measure the vibrations produced by machines [1] as well as the vibrations of buildings or bridges [2]. Improving the performance of tool condition monitoring (TCM) systems is one of the challenges still facing manufacturers [3].
Nowadays, manufacturers of agriculture and farming equipment are interested in machine monitoring systems, which check if a machine is productive, or in condition monitoring systems, which have the ability to assess the health of a machine over a period of time. This helps in minimizing wear and tear in parts such as bearings and gearboxes, reducing unplanned machine downtime and enabling automation based on real-time machine condition data [4]. A rotary tedder that includes multiple rotor gearboxes is an example of a machine incorporating a condition monitoring system. In the publication [10], the authors compare the parameters of the accelerometric sensors commonly found in the literature. These sensors range from the most expensive on the market (380-2070 €) to the cheapest (5.4-12 €). They often have similar ranges of ±2 g (3713B112G-triaxial MEMS DC response accelerometer, PCB Piezotronics) or ±3.6 g (ADXL335-triaxial low-power accelerometer, Analog Devices) and similar low operating frequencies of 0-250 Hz (3713B112G), 0.5-550 Hz (ADXL335). In contrast, cheaper differential capacitive sensors, such as ADXL335, usually have a higher spectral noise density of 300 µg/ √ Hz compared to the more expensive 3713B112G (22.9 µg/ √ Hz). Piezoelectric single-axis sensors KS48C (0.6 µg/ √ Hz) or KB12VD (0.06 µg/ √ Hz) are characterized by the lowest values of spectral noise density.
Other important parameters are the resolution (sensitivity) of the acceleration measurement, and the signal-to-noise ratio. The authors of the publication [11] measured the vibrations of wind turbines with a wireless system based on ADXL355 sensors (sensitivity 3.9 µg/LSB, noise spectral density 22.5 µg/ √ Hz) and compared the measurement results with the 3713B112G sensors in the registered stationary system (0.25 mg rms, 22.9 µg/ √ Hz). They observed that the sensor resolution of 1 mg may not be sufficient for the analysis of vibrations of wind turbine poles, and that it prevents analysis of higher frequencies with a good signal-to-noise ratio. The noise of the ADXL355 sensor depends on the sampling frequency. The measured mean standard deviation of the noise is 0.44 mg (1000 Hz), 0.19 mg (100 Hz) and 0.056 mg (15 Hz) [12].
A low-cost data-acquisition system based on Raspberry-Pi with a high sampling frequency (50 kHz) and a recording capacity of up to three channels, is proposed in publication [13]. It is designed for monitoring bearings and determining bearing faults where signals are processed by frequency methods (FFT, STFT, wavelets) [14]. Generally, the cost of equipment for registering vibrations is very high. It is 4000 EUR for the basic version of the AVM4000 (AMC VIBRO, Kraków, Poland) which is a multichannel device (4-24 channels). However, there are cheaper vibration monitoring devices available (one or two channels). The challenge for low-cost solutions is to use cheaper devices with an internal ADC of 10-bit or 12-bit, such as the ATmega 1280, PIC18F4550, USB NI-6008 with a sampling rate of 10-100 kHz and with an internal memory up to 512 bytes for buffering data [15]. If more functionalities of the DAQ unit are needed-for example, for wireless IoT condition monitoring-the use of an ESP32-WROVER SoC microcontroller unit with an integrated 2.4 GHz radio module, which enables Wi-Fi and Bluetooth connectivity, appears to be a good solution [16].

Vibration Calibration of Accelerometers
The instrument used to measure vibrations is a mechanical vibration calibrator. It is a standard source of vibrations consisting of a portable vibration exciter used to check the metrological properties of the measuring system. With this device, one can check whether the system correctly measures vibration parameters, such as amplitude (displacement), velocity or acceleration.
The standard vibration transducer used to transmit vibrations must have appropriate metrological properties and be very stable. The tested sensor and its wiring must be properly mounted to avoid erroneous results [17]. When calibrating, the ISO 16063-21 standard is used, in which the comparative method is described [18]. It consists in subjecting two transducers (the model transducer and the transducer of unknown sensitivity) to vibrations of the same values. The output signals from both transducers are measured. Knowing the sensitivity of the reference sensor, one can determine the parameters of the calibrated sensor.
The sensitivity of a transducer is defined as the ratio of the output signal, e.g., the voltage, to the input signal, e.g., the vibration acceleration to which the transducer is subjected. It provides a moderate accuracy (uncertainty) of measurement. The most accurate method is the absolute method, i.e., with reference to the basic SI units, such as meter, second, kilogram and electric current. This is considered the national standard. According to the ISO 16063-11 Standard, the absolute method is used to calibrate working standards or laboratory standards [19]. The sensitivity of such vibration transducers is determined over the entire operating frequency range (from 1 Hz to 10 kHz). A calibrated vibration transducer (sensor) is subjected to controlled sinusoidal vibrations, the values of which (amplitude and phase) are measured by the interferometric method. The laser beam is directed to the mounting surface and the voltage from the calibrated accelerometer is measured at the same time. Laser interferometers are very precise devices for measuring distance (displacement) with an accuracy of ± 100 nm in the range of 250 mm [7]. The measurement uncertainty is influenced by the instability of the frequency of the light source, as well as changes in environmental parameters, e.g., the temperature in the vicinity of the laser beam source.

Static and Dynamic Performance
Optical methods with the use of a QPD (four-quadrant photodetector) are also used to measure vibrations of low frequencies and low amplitudes. The optical accelerometer is characterized by high sensitivity (1.74 V/(ms −2 ), a linear conversion function in the range of 0.4 to 12 Hz, the range of measured accelerations from 0.003 to 7.29 m/s 2 and a noise spectral density of 160 µms −2 / √ Hz [20]. The calibration of accelerometric sensors is divided into static and dynamic categories. The method of static and dynamic calibration of low-cost 3D accelerometric sensors in the frequency range of 0-10 Hz is presented in the publication [21]. The transducer can be calibrated with a single frequency signal or a frequency sweep, or a random noise function can be used. The publication [22] discusses the methods of dynamic calibration for various types of amplifiers with bridge, charge and voltage output. The method of calibration of charge amplifiers using multisinusoidal input is presented in article [23]. Seismic IEPE (Integrated Electronics Piezo-Electric) sensors with ultra-low noise operating in the frequency range from 0.003 Hz to 200 Hz cooperate with these types of amplifiers. The method of measuring sensor noise is presented in [24]. The publication [25] compares the parameters of the Meggitt model 731A, the PCB model 393B31, the Dytran model 3191A1 and the Colibrys model SF3000-all sensors used in earthquake prediction systems. The publication [26] presents three methods of calibration for piezoelectric sensors and MEMS, and [27] outlines a method for estimating the measurement uncertainty of accelerometer sensitivity.

Research Purpose
The literature review showed that few low-cost instruments are available to measure low accelerations with satisfactory accuracy by comparison with commercial hardware. This article is focused on designing and experimentally testing an electronic prototype for a machine monitoring system. The aim of this publication is to present the possibilities of using piezoelectric and MEMS sensors in the construction of a low-cost system for measuring vibrations in agricultural machines (tedders, rotary rakes). The machine with the implemented monitoring system is intended for harvesting large fields of crops as green feed, in accordance with the concept of the Agricultural Valley 4.0. The role of the system is to control the selected operating parameters and to assure self-diagnostic information on the wear of machine parts. The development was also focused on simplicity and user friendliness in configuring and operating the low-cost device, as well as in data collection and post-processing. The main proposals of our study are listed below:

•
Using a low-cost AVR microcontroller for such an application. The unit does not need any operating system, and this makes programming easier than Raspberry Pi, for example. This significantly reduces time consumption for creating software and the total cost of the system. The majority of low-cost solutions use high-level programming languages. Our tests confirmed that computation time for a program expressed in an AVR assembler is 2-3 times faster than its equivalent in the C language. • Blending self-created hardware and software for decision support. The software, which is based on statistical features, such as RMS, kurtosis and crest factors, enables the differentiation of the worn parts of a rotary tedder from fully-operational parts. Experimental tests showed that the electronic prototype ensures acceptable accuracy of acceleration measurement at low frequencies for low-acceleration amplitude when compared with the commercial system.

Materials and Methods
The simulation analysis of the proposed signal conditioning system, laboratory tests of three selected sensors (two piezoelectric and one MEMS) and the experimental verification of the electronic prototype on agricultural hay tedders in real conditions were the objects of this study. The FFT (fast Fourier transform) analysis was performed with the LTSpice simulator (Analog Devices, Wilmington, MA, USA).
To validate the performance in laboratory conditions, the constructed electronic prototype was compared with the commercial product (AVM4000, AMC VIBRO, Kraków, Poland) [28]. In this test, dynamic movements with low-range amplitudes and frequencies ranging from 10 Hz to 10 kHz were tested. The swept sine frequency response method was used (at a sample rate of 20 kHz and 400 spectral lines).
To validate the performance of the system in real conditions, the prototyping model was tested on agricultural machines (two rotary tedders P8-890, SaMASZ, Zabłudów, Poland) [29]. The first of these machines was produced in 2019 (a moderately used machine) and the second was produced in 2020 (a more frequently used machine that had worked over 600 hectares in the year 2021).
The tests relied on acquiring data from three general-purpose piezoelectric accelerometers for industrial applications, mounted at different characteristic points of the machine during hay tedding. These three points were: the first left gearbox of the tedder, the first left bearing of the PTO (power take-off) drive shaft and the central point of the main frame. The measuring positions were perpendicular to the shaft due to radial loads, and parallel to the gearbox due to axial loads.
Time-domain techniques were used to determine the wear rate of machine components. Using the time-domain signal, a defect can be detected and its magnitude assessed using statistics indicators, such as the energy content (Root Mean Square-RMS), crest factor (CF), kurtosis (KU) or energy index (EI) [30]. The sliding window method for framing a time-series dataset was used. The one-and ten-second-long subsets were analyzed and compared for both machines.

Simulation Analysis of the Signal Conditioner
Integrated Electronics Piezo-Electric (IEPE) sensors, i.e., the MTN/2200 series (Monitran Ltd., High Wycombe, UK), must be supplied by a constant current source. The signal from the accelerometer must be amplified. Figure 1 shows the summing amplifier U1.1 [31]. The voltage V ref = 2.5 V sets the signal level to which the voltage V a is added tran Ltd., High Wycombe, UK), must be supplied by a constant current source. The signal from the accelerometer must be amplified. Figure 1 shows the summing amplifier U1.1 [31]. The voltage Vref = 2.5 V sets the signal level to which the voltage Va is added The U1.2 amplifier inverts the signal-the output is 180° out of phase to the input (2) The amplifier U2.1 with the gain ku = 1, which is supplied with a single voltage of 5 V, acts as a buffer protecting the input of the ADC converter of the microcontroller against exceeding the supply voltage, and against the voltage dropping below the GND level. As a consequence of this, it is possible to detect acceleration within the range of ±25 g.  The U1.2 amplifier inverts the signal-the output is 180 • out of phase to the input The amplifier U2.1 with the gain k u = 1, which is supplied with a single voltage of 5 V, acts as a buffer protecting the input of the ADC converter of the microcontroller against exceeding the supply voltage, and against the voltage dropping below the GND level. As a consequence of this, it is possible to detect acceleration within the range of ±25 g.
In Figure 1b, the IEPE accelerometer is powered from the voltage source U4. The supply voltage recommended by the manufacturer should be within the range of 18-30 VDC [32]. In Figure 1c, the U5 unit is presented (ICL7660). It generates a symmetrical ±9 V power supply to the U1 (LM833) operational amplifiers. The LM317 stabilizer operates as a constant current source ( Figure 2). In this case, according to the application note, the current (I = 1.2/R7) is within the obligatory range of 0.5-8 mA for the accelerometers used. The V3 source reflects the accelerometer output during the tests on a vibration shaker, which was excited by a sinusoidal signal from an external signal generator. The amplitude at the level of 1.2 V at the sensitivity of 100 mV/g means the acceleration of 12 g. The capacitor C1 cuts the DC component. C2 is the required capacity for correct operation of U4. In Figure 1b, the IEPE accelerometer is powered from the voltage source U4. The supply voltage recommended by the manufacturer should be within the range of 18-30 VDC [32]. In Figure 1c, the U5 unit is presented (ICL7660). It generates a symmetrical ±9 V power supply to the U1 (LM833) operational amplifiers.
The LM317 stabilizer operates as a constant current source ( Figure 2). In this case, according to the application note, the current (I = 1.2/R7) is within the obligatory range of 0.5-8 mA for the accelerometers used. The V3 source reflects the accelerometer output during the tests on a vibration shaker, which was excited by a sinusoidal signal from an external signal generator. The amplitude at the level of 1.2 V at the sensitivity of 100 mV/g means the acceleration of 12 g. The capacitor C1 cuts the DC component. C2 is the required capacity for correct operation of U4.

Spectral Analysis
To reduce the spectral leakage caused by finite-length sampling during frequency analysis, N signal samples are multiplied in the time domain with a given time window. In the data windowing method, the original signal x(n), where ∈ 0.1. … − 1 is modified by multiplication with a windowing function that approaches zero near n = 0 and n = N − 1 and reaches a peak near N/2. There are a number of time windows; the Hamming windows is one of the most popular. If the window is not selected, the rectangular window is used as default. The Hamming window function w(n) is given below [33].
The signal is multiplied by a window function A decibel expression of spectral amplitude is given as where m ω is the frequency-determining component equal to 2 / , which is a normalized value.
In Figure 3a,b the spectral amplitudes for acceleration of 10 g (sine function with frequency of 200 Hz) are presented. In Figure 3a the spectral leakage is visible. Figure 3b shows the effect of the Hamming windowing function and the leakage is reduced.

Spectral Analysis
To reduce the spectral leakage caused by finite-length sampling during frequency analysis, N signal samples are multiplied in the time domain with a given time window. In the data windowing method, the original signal x(n), where n ∈ {0.1. . . . N − 1} is modified by multiplication with a windowing function that approaches zero near n = 0 and n = N − 1 and reaches a peak near N/2. There are a number of time windows; the Hamming windows is one of the most popular. If the window is not selected, the rectangular window is used as default. The Hamming window function w(n) is given below [33].
The signal is multiplied by a window function A decibel expression of spectral amplitude is given as where ω m is the frequency-determining component equal to 2πm/N, which is a normalized value.
In Figure 3a,b the spectral amplitudes for acceleration of 10 g (sine function with frequency of 200 Hz) are presented. In Figure 3a the spectral leakage is visible. Figure 3b shows the effect of the Hamming windowing function and the leakage is reduced.
The waveform of Gaussian white noise represents machine vibrations (Figure 4a). For a noise amplitude V a of 1.5 V (peak-to peak), signal-to-noise ratio equal to 5, the amplitude spectrum is depicted in Figure 4b. The waveform of Gaussian white noise represents machine vibrations (Figure 4a). For a noise amplitude Va of 1.5 V (peak-to peak), signal-to-noise ratio equal to 5, the amplitude spectrum is depicted in Figure 4b.

Laboratory Tests of Selected Sensors Exposed to Low Accelerations
The aim of the laboratory tests was to determine the static performance characteristics of the selected sensors by a process called static calibration. Three sensors were tested on a shaker. The screw mounting method is not always the most practical, but it is the preferred method for vibration sensors. This type of attachment is considered the most reliable and it is expected to produce the best repeatability of all methods. The ADXL356 accelerometer ( Figure 5) was soldered, and the PCB was screwed to the metal base with four M3 screws. The M6 screw was welded to the metal base, which enabled the system to be screwed to a shaker. The sensor was configured for the range of ±10 g, with a sensitivity of 80 mV/g, bandwidth-2.4 kHz and a resonant frequency of 5.5 kHz.
The source of sinusoidal vibrations was a generator connected with the TIRA TV51140 shaker ( Figure 6). The sensors (ADXL356, MEAS 810M1-0025X and TE 820M1-0025) were tested using the comparative method in the frequency range of  Hz. A precise FIBER PHILTEC RC62-T2 laser displacement sensor with a sensitivity of 2.9 mV/µm was used as the reference instrument. The reference sensor was factory calibrated.
The selected characteristics of the tested sensors are presented in Table 1.  The waveform of Gaussian white noise represents machine vibrations (Figure 4a). For a noise amplitude Va of 1.5 V (peak-to peak), signal-to-noise ratio equal to 5, the amplitude spectrum is depicted in Figure 4b.

Laboratory Tests of Selected Sensors Exposed to Low Accelerations
The aim of the laboratory tests was to determine the static performance characteristics of the selected sensors by a process called static calibration. Three sensors were tested on a shaker. The screw mounting method is not always the most practical, but it is the preferred method for vibration sensors. This type of attachment is considered the most reliable and it is expected to produce the best repeatability of all methods. The ADXL356 accelerometer ( Figure 5) was soldered, and the PCB was screwed to the metal base with four M3 screws. The M6 screw was welded to the metal base, which enabled the system to be screwed to a shaker. The sensor was configured for the range of ±10 g, with a sensitivity of 80 mV/g, bandwidth-2.4 kHz and a resonant frequency of 5.5 kHz.
The source of sinusoidal vibrations was a generator connected with the TIRA TV51140 shaker ( Figure 6). The sensors (ADXL356, MEAS 810M1-0025X and TE 820M1-0025) were tested using the comparative method in the frequency range of 30-200 Hz. A precise FIBER PHILTEC RC62-T2 laser displacement sensor with a sensitivity of 2.9 mV/µm was used as the reference instrument. The reference sensor was factory calibrated.
The selected characteristics of the tested sensors are presented in Table 1.

Laboratory Tests of Selected Sensors Exposed to Low Accelerations
The aim of the laboratory tests was to determine the static performance characteristics of the selected sensors by a process called static calibration. Three sensors were tested on a shaker. The screw mounting method is not always the most practical, but it is the preferred method for vibration sensors. This type of attachment is considered the most reliable and it is expected to produce the best repeatability of all methods. The ADXL356 accelerometer ( Figure 5) was soldered, and the PCB was screwed to the metal base with four M3 screws. The M6 screw was welded to the metal base, which enabled the system to be screwed to a shaker. The sensor was configured for the range of ±10 g, with a sensitivity of 80 mV/g, bandwidth-2.4 kHz and a resonant frequency of 5.5 kHz.
The source of sinusoidal vibrations was a generator connected with the TIRA TV51140 shaker ( Figure 6). The sensors (ADXL356, MEAS 810M1-0025X and TE 820M1-0025) were tested using the comparative method in the frequency range of  Hz. A precise FIBER PHILTEC RC62-T2 laser displacement sensor with a sensitivity of 2.9 mV/µm was used as the reference instrument. The reference sensor was factory calibrated. The selected characteristics of the tested sensors are presented in Table 1.       At the same time, the output voltages of the tested sensor and the reference sensor in the range from 0 to 4 g were recorded. The linear regression models were obtained for the vibration frequency of 159.2 Hz (Figure 7a-c). All sensors were supplied with the voltage of 3.3 V from the Tektronix PS2520G power supply. Experiments were conducted at a temperature of 25 • C.
At the same time, the output voltages of the tested sensor and the reference sensor in the range from 0 to 4 g were recorded. The linear regression models were obtained for the vibration frequency of 159.2 Hz (Figure 7a-c). All sensors were supplied with the voltage of 3.3 V from the Tektronix PS2520G power supply. Experiments were conducted at a temperature of 25 °C. Other parameters are given in Table 2. The slope of a linear function y = mx where xi is the acceleration determined on the basis of the FIBER PHILTEC sensor and yi is the acceleration measured by a tested sensor, L-number of observations (L = 16). The linear correlation coefficient is described by the equation The standard uncertainty of the coefficient m is Other parameters are given in Table 2. The slope of a linear function y = mx where x i is the acceleration determined on the basis of the FIBER PHILTEC sensor and y i is the acceleration measured by a tested sensor, L-number of observations (L = 16). The linear correlation coefficient is described by the equation The standard uncertainty of the coefficient m is The coefficient of determination which tells how well the data fit the model The residual standard deviation is where K-number of estimated parameters (K = 1). The coefficient of variation normalizes the volatility by dividing the residual standard deviation by the mean The smallest coefficient of variation and the best linearity were obtained for the ADXL356 sensor. Calculated values are v = 9.45% (TE820M1), 6.91% (MEAS810M1) and 5.02% (ADXL356).

The Design of a Vibration-Based Monitoring System for Hay-Handling Equipment
An inductive sensor of the E2B series (OMRON Corporation, Japan) was used for measuring rotational speed [34]. The sensor is supplied by 10 to 30 VDC. It is a sensor with voltage output PNP and operates in NO (normally open) mode.
While detecting a metal object within a distance of 10 mm from the sensor's face, the output is set at 24 DC Volts. Therefore, for measuring pulses coming from the sensor, it is necessary to reduce the voltage by means of a resistive divider to the level acceptable to the microcontroller pin PD0 (Figure 8).
The coefficient of determination which tells how well the data fit the model The residual standard deviation is where K-number of estimated parameters (K = 1). The coefficient of variation normalizes the volatility by dividing the residual standard deviation by the mean The smallest coefficient of variation and the best linearity were obtained for the ADXL356 sensor. Calculated values are v = 9.45% (TE820M1), 6.91% (MEAS810M1) and 5.02% (ADXL356).

The Design of a Vibration-Based Monitoring System for Hay-Handling Equipment
An inductive sensor of the E2B series (OMRON Corporation, Japan) was used for measuring rotational speed [34]. The sensor is supplied by 10 to 30 VDC. It is a sensor with voltage output PNP and operates in NO (normally open) mode.
While detecting a metal object within a distance of 10 mm from the sensor's face, the output is set at 24 DC Volts. Therefore, for measuring pulses coming from the sensor, it is necessary to reduce the voltage by means of a resistive divider to the level acceptable to the microcontroller pin PD0 (Figure 8). The electronic prototype of the system for recording and analyzing measurement signals was built based on an ATmega128 microcontroller. The software support for on-chip multi-channel ADC (responsible for averaging, decimation, noise reduction) was implemented. A program for calculating selected statistical parameters (such as RMS value, standard deviation and crest factor) of recorded signals was created. Electronic components were reviewed for further development of the hardware layer. The influence of passive-component tolerances on the accuracy of the measured signal was investigated.
A block diagram of the 4-channel system for processing data from accelerometers and the rotation sensor is presented in Figure 9. The electronic prototype of the system for recording and analyzing measurement signals was built based on an ATmega128 microcontroller. The software support for onchip multi-channel ADC (responsible for averaging, decimation, noise reduction) was implemented. A program for calculating selected statistical parameters (such as RMS value, standard deviation and crest factor) of recorded signals was created. Electronic components were reviewed for further development of the hardware layer. The influence of passive-component tolerances on the accuracy of the measured signal was investigated.
A block diagram of the 4-channel system for processing data from accelerometers and the rotation sensor is presented in Figure 9. The on-chip ADC operates with a resolution of 10-bits. For precise measurements, the voltage on the AVCC pin was filtered by the LC filter (L = 10 uH, C = 100 nF). The unused ADC pins were blocked. The noise reduction mode was used, which requires the following steps to be performed during a measurement: 1. configuring the ADC in the single conversion mode; 2. disabling the ADC interrupt; 3. executing the sleep () function.
The code that uses ADC Noise Reduction mode consists of three parts. An interrupt service routine (ISR) is necessary because the ADC interrupts must be enabled to prevent the processor from waking up from sleep mode. If they were enabled without this routine, a default routine would be executed, which would reset the microcontroller. Decimation and interpolation were also used in the application to perform measurements via the ADC in the microcontroller.
Contrary to the averaging of the measurement result, the aim of the above-mentioned procedures was to increase the resolution of the sampled signal over the offered 10-bit The on-chip ADC operates with a resolution of 10-bits. For precise measurements, the voltage on the AVCC pin was filtered by the LC filter (L = 10 uH, C = 100 nF). The unused ADC pins were blocked. The noise reduction mode was used, which requires the following steps to be performed during a measurement: 1.
configuring the ADC in the single conversion mode; 2.
executing the sleep () function.
The code that uses ADC Noise Reduction mode consists of three parts. An interrupt service routine (ISR) is necessary because the ADC interrupts must be enabled to prevent the processor from waking up from sleep mode. If they were enabled without this routine, a default routine would be executed, which would reset the microcontroller. Decimation and interpolation were also used in the application to perform measurements via the ADC in the microcontroller.
Contrary to the averaging of the measurement result, the aim of the above-mentioned procedures was to increase the resolution of the sampled signal over the offered 10-bit value. It is known that four signal samples are needed to obtain one extra bit of information. As a result, in order to obtain a 12-bit resolution the values of 16 samples had to be summed and divided by 4. As a result of adding 16 values (10-bit), a 14-bit result is obtained, in which the two youngest bits do not contain any useful information. Doubling the sampling rate will increase the signal-to-noise ratio by 3 dB, while increasing the resolution by 0.5 bit. In general, to increase the resolution by n bits, a signal should be sampled at frequency f OVS [35] f OVS = 4 n f s , where f s is the sampling rate. At the same time, oversampling reduces the maximum frequency of the sampled signal, which is related to a maximum sampling frequency of the ADC and to a number of additional bits. The frequency limitation can be determined from the formula where f ADC_max is the maximum sampling rate of the converter. Based on the tests carried out with the ATmega128 microcontroller, the obtained f max = 62.5 kHz was achieved with an additional 2-bit increase in the ADC resolution.
In the electronic prototype of the signal converter ( Figure 10), a full analog front end for the IEPE sensors (3 channels) and one channel for recording the rotational speed of the machine drive shaft was considered. value. It is known that four signal samples are needed to obtain one extra bit of information. As a result, in order to obtain a 12-bit resolution the values of 16 samples had to be summed and divided by 4. As a result of adding 16 values (10-bit), a 14-bit result is obtained, in which the two youngest bits do not contain any useful information. Doubling the sampling rate will increase the signal-to-noise ratio by 3 dB, while increasing the resolution by 0.5 bit. In general, to increase the resolution by n bits, a signal should be sampled at frequency fOVS [35] 4 OVS s f nf = , (12) where fs is the sampling rate. At the same time, oversampling reduces the maximum frequency of the sampled signal, which is related to a maximum sampling frequency of the ADC and to a number of additional bits. The frequency limitation can be determined from the formula where fADC_max is the maximum sampling rate of the converter. Based on the tests carried out with the ATmega128 microcontroller, the obtained fmax = 62.5 kHz was achieved with an additional 2-bit increase in the ADC resolution.
In the electronic prototype of the signal converter ( Figure 10), a full analog front end for the IEPE sensors (3 channels) and one channel for recording the rotational speed of the machine drive shaft was considered. The FFT algorithm was implemented in the ATmega128 microcontroller using the C language and assembler. The use of a low-level programming language enabled optimizing calculations in terms of execution time. To this aim, the C language compiler for AVR microcontrollers was not sufficient. Operating directly on internal resources, i.e., working registers, is the most effective way to obtain the smallest code size possible. The calculations were divided into four stages carried out in separate subroutines: 1. creating an array of raw data values to prepare butterfly operations; 2. preparing the Hamming window; The FFT algorithm was implemented in the ATmega128 microcontroller using the C language and assembler. The use of a low-level programming language enabled optimizing calculations in terms of execution time. To this aim, the C language compiler for AVR microcontrollers was not sufficient. Operating directly on internal resources, i.e., working registers, is the most effective way to obtain the smallest code size possible. The calculations were divided into four stages carried out in separate subroutines: creating an array of raw data values to prepare butterfly operations; 2.
arranging the results at the output of a butterfly. Table 3 presents the most important comparative parameters of the FFT implementation in the microcontroller. The data were obtained as a result of applying a function written in C language in Atmel Studio IDE environment and in AVR assembler. The computation time of a program written in the AVR assembler is 2-3 times shorter. The FFT computational complexity is defined as a number of multiplication operations.

Sinusioidal Excitation
Considering that the system is stable, and its input is sinusoidal u(t) = A u ·cos(ωt), at a steady state the response is asymptotically sinusoidal y ss (t) = A y ·cos(ωt + ϕ) with the same frequency as the input. The frequency response is Then |H(jω)| gives the amplification factor, i.e., |H(jω)| = RMS(y ss ) RMS(u) (15) and the phase is a shift between u and y ss . The circuit of the designed and commercial AVM4000 converter (together with the MTN2200SM6 sensor) was stimulated with a sinusoidal signal with selected frequencies of 20 Hz (Figure 11a), 5 kHz ( Figure 11b) and 10 kHz ( Figure 11c) and with an amplitude of 100 mV. An Agilent signal generator was used. Relative differences RMS (y ss ) relating to the input signal amplitude u, presented in Figure 11d, were obtained.
Absolute relative difference related to input amplitude A u is The lowest error was observed at 1 kHz. One of the reasons was a phase shift between sine signals up to 100 Hz (Figure 11a). Another reason was the presence of periodic noise in signals at 5 kHz (Figure 11b).

Swept-Sine Frequency Response
In order to obtain information about the phase and amplitude differences in the frequency range 10 Hz-10 kHz, a laboratory stand was built, as shown in the diagram (Figure 12a). An Agilent Dynamic Signal Analyzer 35670A was used as the controller. The swept-sine signal excited the TIRA BAA1000 power amplifier and the TIRA TV51140 shaker (Figure 12b). In this way, vibrations of the shaker were induced by a sinusoidal signal with an amplitude of 100 mV. Absolute relative difference related to input amplitude Au is The lowest error was observed at 1 kHz. One of the reasons was a phase shift between sine signals up to 100 Hz (Figure 11a). Another reason was the presence of periodic noise in signals at 5 kHz (Figure 11b).

Swept-Sine Frequency Response
In order to obtain information about the phase and amplitude differences in the frequency range 10 Hz-10 kHz, a laboratory stand was built, as shown in the diagram ( Figure  12a). An Agilent Dynamic Signal Analyzer 35670A was used as the controller. The sweptsine signal excited the TIRA BAA1000 power amplifier and the TIRA TV51140 shaker (Figure 12b). In this way, vibrations of the shaker were induced by a sinusoidal signal with an amplitude of 100 mV. The normalized input function (Ch1) is a linear sine sweep where: t is test duration and f0 and f1 are starting and ending frequencies, respectively. The measuring system with sensor is a linear, time-variant system with transfer function H(jω). Bode plots of magnitude and phase of transfer function as frequency varied for both (performed and AMV4000) converters are presented in Figure 13a,b The normalized input function (Ch1) is a linear sine sweep where: t is test duration and f 0 and f 1 are starting and ending frequencies, respectively. The measuring system with sensor is a linear, time-variant system with transfer function H(jω). Bode plots of magnitude and phase of transfer function as frequency varied for both (performed and AMV4000) converters are presented in Figure 13a,b MTN2200SM6 sensors.
The normalized input function (Ch1) is a linear sine sweep where: t is test duration and f0 and f1 are starting and ending frequencies, respectively. The measuring system with sensor is a linear, time-variant system with transfer function H(jω). Bode plots of magnitude and phase of transfer function as frequency varied for both (performed and AMV4000) converters are presented in Figure 13a,b (a) (b) Figure 13. Bode characteristics-amplitude and phase; (a)comparison of the designed low-cost system with Sensor 1 and the commercial AVM4000 system with Sensor 2; (b) the verification of sensors' equality by replacing Sensors 1 and 2. Figure 13a shows the resonance peak, which occurred at a frequency of 180 Hz. The Bode amplitude characteristics of the tested measurement system and the AMV4000 Figure 13. Bode characteristics-amplitude and phase; (a)comparison of the designed low-cost system with Sensor 1 and the commercial AVM4000 system with Sensor 2; (b) the verification of sensors' equality by replacing Sensors 1 and 2. Figure 13a shows the resonance peak, which occurred at a frequency of 180 Hz. The Bode amplitude characteristics of the tested measurement system and the AMV4000 system differed by no more than 15%. The differences in the sign of the phase for both systems were observed up to 30 Hz. The sensors' equality was verified by replacing Sensors 1 and 2 and connecting to the performed converter. No significant differences were noticed (Figure 13b).

Machine Vibration Measurements Using the Constructed Measuring System
Hay handling equipment, such as disk mowers, tedders with a suspension system and trailed rotary tedders, are used in agriculture. Agricultural machinery, such as the rotary tedder P8-890 (SaMASZ, Poland), which supports the process of drying hay by tedding the freshly cut, short-stemmed green plants must be monitored. The deployment of vibration sensors MTN2200SM6 (A0, A1 and A2) is visualized in Figures 14 and 15.
The influence of changes in the tedder's drive rotational speed on the root-mean square (RMS) accelerations at three characteristic points in the machine was examined. Two tedders P8-890 were tested, the first produced in 2019 (a moderately used machine) and the second produced in 2020 (a more frequently used machine). The aim of this study was to diagnose the condition of the drive shaft bearing, which could provide useful information for improving the durability of such agricultural machinery.

Machine Vibration Measurements Using the Constructed Measuring System
Hay handling equipment, such as disk mowers, tedders with a suspension system and trailed rotary tedders, are used in agriculture. Agricultural machinery, such as the rotary tedder P8-890 (SaMASZ, Poland), which supports the process of drying hay by tedding the freshly cut, short-stemmed green plants must be monitored. The deployment of vibration sensors MTN2200SM6 (A0, A1 and A2) is visualized in Figures 14 and 15.

Machine Vibration Measurements Using the Constructed Measuring System
Hay handling equipment, such as disk mowers, tedders with a suspension system and trailed rotary tedders, are used in agriculture. Agricultural machinery, such as the rotary tedder P8-890 (SaMASZ, Poland), which supports the process of drying hay by tedding the freshly cut, short-stemmed green plants must be monitored. The deployment of vibration sensors MTN2200SM6 (A0, A1 and A2) is visualized in Figures 14 and 15.

Time-Domain Measurements
The root-mean square (RMS) amplitude values and error bars (standard deviation), which are graphical representations of the variability of data, are presented in Figure 16a-d. The highest RMS amplitudes were observed for the A1 accelerometer. The bar on the graph represents an averaged value of 1-second or 10-second subsets of the full dataset for a selected sensor.

Time-Domain Measurements
The root-mean square (RMS) amplitude values and error bars (standard deviation), which are graphical representations of the variability of data, are presented in Figure 16ad. The highest RMS amplitudes were observed for the A1 accelerometer. The bar on the graph represents an averaged value of 1-second or 10-second subsets of the full dataset for a selected sensor. The obtained RMS values were converted into new values, to a small extent dependent on the rotational speed of the machine drive, a relationship termed the RMS-to-speed ratio. These values were almost constant within a range of 300-600 rpm. In Figure 17a,b The obtained RMS values were converted into new values, to a small extent dependent on the rotational speed of the machine drive, a relationship termed the RMS-to-speed ratio. These values were almost constant within a range of 300-600 rpm. In Figure 17a,b the significant difference between A1 sensor (shaft bearing) and A2 sensor (main frame) is visible. The relative difference in the ratio is about 25% (on average). In statistics, kurtosis describes the shape of a probability distribution [36]. The datasets with high kurtosis exhibited tail data exceeding the tails of the normal distribution (e.g., five or more standard deviations from the mean). Distributions with low kurtosis exhibited tail data that were generally less extreme than the tails of the normal distribu- In statistics, kurtosis describes the shape of a probability distribution [36]. The datasets with high kurtosis exhibited tail data exceeding the tails of the normal distribution (e.g., five or more standard deviations from the mean). Distributions with low kurtosis exhibited tail data that were generally less extreme than the tails of the normal distribution. The values of the RMS, the RMS-to-speed ratio and kurtosis are presented in Table 4. The RMS value rose with rotational speed; however, kurtosis was almost constant for sensors A0 (gearbox) and A2 (frame). For Sensor A1 (bearing), kurtosis was more variable, being highest at 400 rpm. The values of kurtosis of the shaft bearing vibrations in a function of changes in the rotational speed of the drive shaft at two different points (Sensors A1 and A2) of the machine were evaluated and are presented in Figure 18. The bars on the graph correspond to the averaged values of 1-second or 10-second subsets of the full dataset for Sensors A1 and A2 as shown in Table 5. As can be observed, the length of subset has almost no influence on the kurtosis value.   The normal distribution was found to have a kurtosis of three. A kurtosis higher than three is known as a leptokurtic distribution. Kurtosis values higher than 3 indicate that the distribution has more outliers falling relatively far from the mean. As shown in Figure  18, the mean kurtosis values of the machines differed significantly at both points in the machine. Values closer to 3 were observed for Machine 1. Figure 18a shows that the bearing in Machine 2 could be classified as more worn out than that in Machine 1. This is also confirmed by an analysis of the crest factor ( Table 6). The crest factor is the peak amplitude of the vibration waveform divided by the RMS value of the waveform. Table 6. The values of the crest factor (CF): averaged values for 1-second and 10-second signal subsets in the whole dataset from sensors installed in two machines.

Machine 1
Machine 2 Sensor A1, z-Axis Sensor A2, z-Axis Sensor A1, z-Axis Sensor A2, z-Axis Rotational The normal distribution was found to have a kurtosis of three. A kurtosis higher than three is known as a leptokurtic distribution. Kurtosis values higher than 3 indicate that the distribution has more outliers falling relatively far from the mean. As shown in Figure 18, the mean kurtosis values of the machines differed significantly at both points in the machine. Values closer to 3 were observed for Machine 1. Figure 18a shows that the bearing in Machine 2 could be classified as more worn out than that in Machine 1. This is also confirmed by an analysis of the crest factor ( Table 6). The crest factor is the peak amplitude of the vibration waveform divided by the RMS value of the waveform.

Spectral Analysis
The FFT and techniques in the frequency domain can be used for more detailed information about health condition. When performing rotating machinery diagnostics, certain frequency components relate to specific mechanical parts within the machine. In the RMS amplitude spectrum, the components from shafts and gears are in a much lower frequency band, i.e., typically from a few hertz to 3 kHz. They have much more energy than pulses from bearings. The RMS amplitude spectra of the solid grease gearbox (sensor A0) in two rotary tedders are presented in Figure 19 (sampling frequency 10 kHz). frequency band, i.e., typically from a few hertz to 3 kHz. They have much more energy than pulses from bearings. The RMS amplitude spectra of the solid grease gearbox (sensor A0) in two rotary tedders are presented in Figure 19 (sampling frequency 10 kHz). In order to detect changes that occurred in the faulty gearbox (Machine 2) in relation to the intact gearbox, it was possible to determine RMS or energy values within the selected bands of 130-150 Hz and of 400-420 Hz, provided that the above-mentioned parameters at the frequencies 694 Hz and 970 Hz dropped significantly. Computations of  In order to detect changes that occurred in the faulty gearbox (Machine 2) in relation to the intact gearbox, it was possible to determine RMS or energy values within the selected bands of 130-150 Hz and of 400-420 Hz, provided that the above-mentioned parameters at the frequencies 694 Hz and 970 Hz dropped significantly. Computations of the RMS values in the selected bands were enabled to save processing time.

Conclusions
This article focuses on the design of an electronic prototype for a low-cost vibrationbased machine monitoring system. So far, simulation studies have been carried out on adjusting the sensor to the measurement system (Figures 1 and 2). A 4-channel signal converter based on AVR microcontroller ATmega128 with a 10-bit ADC was designed. The ADC in our instrument operated on a maximal sampling frequency f max = 62.5 kHz, and an additional 2-bit increase in ADC resolution was achieved. The most important comparative parameters of the FFT implementation showed that ATmega128 with implemented software written in the assembler was more efficient than in the C language. The computation times were 2-3 times shorter. However, due to hardware limitations, the frequency resolution was low. It is about 10 Hz for a bandwidth of 10 kHz.
The system operated with piezoelectric sensors. During Phase 3 of the prototyping, several low-cost sensors were tested in the laboratory. The most reliable experimental results and the best linearity were obtained with the ADXL356 sensor. Better metrological parameters ( Table 2) of static characteristics were obtained in the range of small acceleration amplitudes (up to 4 g) with this sensor as compared to the TE820M1 and MEAS810M1 sensors. However, its frequency bandwidth was smaller, which limited its use for bearing testing.
The results of measurements on a real hay-handling machine confirmed the capability of the online monitoring system for a simple diagnostic. The linear dependence of RMS values of acceleration on rotational speed is observable in Figure 16. The research proved that one-second subsets are sufficient for processing signals in a time domain (Figure 18). The RMS-to-speed ratio had a different value at each analyzed point in the machine (Table 4). For a more advanced diagnostic of machine components, the use of frequency techniques is needed. Due to the long computation time and low frequency resolution, in this study, it was necessary to calculate RMS values only in the selected bands ( Figure 19). The proposed measuring system can be used for improving the durability of agricultural machinery, and it is under development. Currently, it is used for monitoring two elements in a tedder (gearbox, shaft bearing). However, more advanced methods in the frequency domain than those performed in this paper must be implemented in the microcontroller. One such method is spectral kurtosis (SK), which enables the graphing of a kurtogram and a frequency spectrum [37]. For bearing fault diagnosis, the sampling rate must be higher, as well as the spectral resolution of the constructed device (Table 3). However, the time-domain statistics used in this study allowed assessment of the significant differences in vibrations of the shaft bearing and the gearbox of the two machines (Tables 5 and 6). The key benefit of such a system is that it is possible to predict potential problems and plan maintenance in advance.
In the framework of a project, the plan is to construct a condition monitoring system for early fault detection in agricultural machinery. This can provide deeper machine analytics of condition monitoring in order to diagnose problems. It is important in the context of avoiding unplanned downtime as well as reducing high costs through excessive planned maintenance. A remote machine monitoring system that works via smartphones is currently under development. This system will send warnings to farmers in the form of short messages, and will help improve the overall efficiency and effectiveness of agricultural operations.