We get every now than then questions if RuuviTag could be used to monitor vibrations from rotating machines. RuuviTag Pro can be as a Bluetooth vibration sensor and we have created a custom firmware version to measure vibrations. Some of our customers have already started proof on concept projects with the RuuviTag Pro sensors. Collecting the vibration sensor data needs a custom setup which can be for example a RaspberryPi or data can be collected using the Ruuvi Gateway and send data to a private server.
Scroll down for downloading the custom firmware for vibration measurement. Please note that firmware is a beta version and it’s not comprehensively tested. Note also that might not be possible to flash standard firmware again without Ruuvi Development Kit.
RuuviTag Bluetooth Vibration Sensor Data Formats
Simple Vibration Data Format AC for Bluetooth Vibration Sensors
RuuviTag can run both simple and complex measurements on acceleration. At its easiest, the acceleration measurement can be just a peak-to-peak value.
The peak to peak tells essentially how hard acceleration Bluetooth vibration sensor has seen. Another simple measurement is root mean square value and it tells how much power acceleration has. Since RuuviTag Pro has a 3-axis accelerometer, a separate value is reported along each axis.
RuuviTag Special Vibration firmware Simple Data Format
|2||P2P_X_MSB||0 … 32767||Signed, mG.|
|3||P2P_X_LSB||Limited by accelerometer amplitude, 4 – 32 G|
|4||P2P_Y_MSB||0 … 32767||Signed, mG.|
|5||P2P_Y_LSB||Limited by accelerometer amplitude, 4 – 32 G|
|6||P2P_Z_MSB||0 … 32767||Signed, mG.|
|7||P2P_Z_LSB||Limited by accelerometer amplitude, 4 – 32 G|
|8||RMS_X_MSB||0 … 32767||Signed, mG.|
|9||RMS_X_LSB||Limited by accelerometer amplitude, 2 – 16 G|
|10||RMS_Y_MSB||0 … 32767||Signed, mG.|
|11||RMS_Y_LSB||Limited by accelerometer amplitude, 2 – 16 G|
|12||RMS_Z_MSB||0 … 32767||Signed, mG.|
|13||RMS_Z_LSB||Limited by accelerometer amplitude, 2 – 16 G|
|14||RESERVED0||N/A||Reserved for future|
|15||RESERVED1||N/A||Reserved for future|
|16||RESERVED2||N/A||Reserved for future|
|17||RESERVED3||N/A||Reserved for future|
|18||RESERVED4||N/A||Reserved for future|
|19||RESERVED5||N/A||Reserved for future|
|20||VOLTAGE_MSB||0 … 254||Calculate as: 1600 mV + 8 * VOLTAGE mV|
|21||TEMPERATURE_MSB||-125 … 125||In celcius, 1C resolution|
|22||SEQUENCE_COUNTER_MSB||0 … 65534||Incremented for each measurement, rolls over to zero|
Dataformat 0xAC version 2 specification. For signed values lowest possible value means error, for signed values highest possible value means error.
Complex Vibration Data Format AF for Bluetooth Vibration Sensors
The brains of RuuviTag Pro is a quite capable nRF52832 from Nordic Semiconductor. It comes with an ability to run a Fast Fourier Transform to calculate frequency components of acceleration.
The Fourier transform can differentiate between frequencies of acceleration RuuviTag Pro is measuring. By default, the FFT is calculated out of 1024 samples taken at 1344 Hz at 12 bits and 2 G amplitude.
This gives 512 frequency bins where one bin is 1344 / 2 / 512 = 1.3 Hz wide. However, broadcasting every bin is not feasible, so bins are summed together into 16 frequency
buckets and the power of the bucket is calculated for broadcasting. This gives output with 16 buckets of power per frequency.
Since the scale between buckets can vary a lot, it is not meaningful to use a fixed scale for frequency data. Instead, acceleration is normalized to the highest value and the rest of the values are scaled accordingly. Scaling information is sent in the broadcast.
Learn more about the FFT from Wikipedia https://en.wikipedia.org/wiki/Fast_Fourier_transform
RuuviTag Special Vibration Firmware Complex Data Format
An example on how to decode the vibration sensor data, please see https://github.com/ojousima/ojousima.ruuvi_endpoints.ts/blob/master/src/ojousima_endpoint_af.ts
|2||TYPE||0 … 2||0 – X-axis, 1 – Y-axis, 2 – Z-axis|
|3||SCALE_MSB||0 … 255||8.8 Fixed-point value|
|4||SCALE_LSB||Divide value by 256 to get a scaling float|
|5||FREQ_MSB||0 … 65534||Highest frequency bucket.|
|6||FREQ_LSB||Limited to ~5 kHz by accelerometer. In Hz.|
|7||BUCKET_1||0 … 255||Divide by scale to get original value in G(rms)^2/Hz|
|8||BUCKET_2||0 … 255||Divide by scale to get original value in G(rms)^2/Hz|
|9||BUCKET_3||0 … 255||Divide by scale to get original value in G(rms)^2/Hz|
|10||BUCKET_4||0 … 255||Divide by scale to get original value in G(rms)^2/Hz|
|11||BUCKET_5||0 … 255||Divide by scale to get original value in G(rms)^2/Hz|
|12||BUCKET_6||0 … 255||Divide by scale to get original value in G(rms)^2/Hz|
|13||BUCKET_7||0 … 255||Divide by scale to get original value in G(rms)^2/Hz|
|14||BUCKET_8||0 … 255||Divide by scale to get original value in G(rms)^2/Hz|
|15||BUCKET_9||0 … 255||Divide by scale to get original value in G(rms)^2/Hz|
|16||BUCKET_10||0 … 255||Divide by scale to get original value in G(rms)^2/Hz|
|17||BUCKET_11||0 … 255||Divide by scale to get original value in G(rms)^2/Hz|
|18||BUCKET_12||0 … 255||Divide by scale to get original value in G(rms)^2/Hz|
|19||BUCKET_13||0 … 255||Divide by scale to get original value in G(rms)^2/Hz|
|20||BUCKET_14||0 … 255||Divide by scale to get original value in G(rms)^2/Hz|
|21||BUCKET_15||0 … 255||Divide by scale to get original value in G(rms)^2/Hz|
|22||BUCKET_16||0 … 255||Divide by scale to get original value in G(rms)^2/Hz|
|23||SEQUENCE||0.254||Rolls over to 0, increments by one for each measurement|
RuuviTag Pro Bluetooth Vibration Sensor Firmware
We have made a proof-of-concept firmware which broadcasts in above formats and original Ruuvi RAWv2 (0x05) format. You can download and run it on any RuuviTag or Ruuvitag Pro up to hardware version B8. Special firmware can be downloaded here https://github.com/ojousima/ojousima.acceleration_bcast.c/releases/tag/v1.0.3. Flashing can be done using Nordic Semiconductor nRF Connect and instructions can be found here.
The firmware broadcasts in one-minute cycle, with each cycle having 5 distinct broadcasts:
- Original RAWv2
- “Simple” Vibration Data Format AC
- “Complex” Vibration Data Format AF, once per each axis
Each broadcast is repeated 5 times at 1285 ms interval, so the one-minute cycle has about 32 seconds of broadcasting and another half minute of quiet time. All measurements are taken from same acceleration sample.
Can RuuviTag Pro used as Vibration Sensor?
Yes, it’s possible to use RuuviTag Pro Bluetooth Sensor as a vibration sensor with special proof-of-concept firmware.
What are the Typical Use Cases for Bluetooth Vibration Sensors?
- Determine if machine is on or off
- Make analysis from vibration sensor data for predictive maintenance