Currently for my project I'm using ADXL345 sensor, connected to Arduino Nano Board, powered by a 9V battery, communicating with pc trought Bluetooth connection at 115200 baud/s.
Setting the sampling frequency on high values (1600/3200, but espetially 1600) I get some very regular disturbances with same amplitude at 64 Hz and its precise multiples (128, 192... until available bandwidth).
In the annexes there is the spectrum of a signal (peaks not at the previously mentioned frequences are supposed to be there), sampling freq 1600Hz, 10s of acquisition
Have you ever experienced something similar? do you have any idea what it could be?
Hello Andrea.devi, thank you for your question and for choosing our ADXL345 for you project.
The noise level you experience is high. You can find the noise density specification for various sampling rates on page 33 of the device datasheet Rev.E.
I would like to ask you for more information about your set up, as that would help us to analyze your problem with more detail and identify the noise source.
To communicate with the Arduino, are you using SPI or I2C? Notice that there are special considerations to have into account for high output data rates (3200 and 1600 Hz). You can find detailed information in the datasheet serial communications section, pages 15 to 19. For 3200 and 1600Hz output data rates, SPI communication rates greater than or equal to 2MHz are recommended; whereas for I2C in fast data transfer mode (400kHz), the advised maximum output data rate is 800Hz.
thanks for replaying, the communication protocol is SPI. I checked and the default SPI clock from Arduino is 4MHz (16MHz from processor / 4), which greater than the required.
More details on the setup:
Thank you in advance
Hi Andrea.bevi, thank you for providing more details.
I would advise you to simplify the system to try to identify the issue. Did you try measuring the acceleration directly on your PC using the Arduino Serial Monitor instead of the Bluetooth module? Please also make sure to have SPI configured for multiple-byte read and that the data is then properly transferred to the PC (Serial.Write(buf, len), with buf = the multi-byte data array and len = 2).
From the plots you provided it seems that the problem comes from 60Hz power line interference, but since you power the Arduino and the sensor with the 9V battery you should not have this issue.
In the time domain plot I see that your average acceleration is -2g. Was this data collected having the device in rest? (measuring static acceleration of gravity). If yes, the acceleration measured should be +/- 1g depending on the orientation of the device.
Hello, thanks for replaying! I'm going to try cable connection ASAP and let you know. I'm going to try also to substitute all the components one by one and check
- Each byte sent uses a separate command ( Serial.write(byte) ) so that should be fine.
- 9V battery is the only power source, yes, it is completely detached from grid
- in the plot reported I was testing the sensor placed on the motor of my fridge (lol), so I'm preatty sure sensitivity-wise it is fine
The aspect that struck me most was the accuracy of 64Hz and its multilpes. Not even one is missing and the amplitude is almost the same. Could it be that there's something related with transmission clock? just to mention, the baud rate I'm using is 115200baud/s, if I divide 115200/64=1800 precisely. Attached to the message there's a list of where the peaks occour and a list of the multiples of 64.
If you need any other detail or info or whatever I'll be glad to provide it.
Thanks in advance
Oh, okay.It seems then that the 64Hz signal and its harmonics are produced by the vibration of your refrigerator motor. I suggest you investigate about vibration diagnostics for electrical motors/compressors to compared with the results you obtained.