I'm trying to use an Arduino and a MMA8452Q accelerometer to sense movement and detect oscillations. What would be the best way to analyze and process the info to detect oscillations at a specific frequency range and act accordingly?
Edit 1:
Aswering
Must you detect a single frequency (known in advance) or a band of frequencies.
I must detect if the oscillation is in the 4-8Hz range.
Is the sampling rate under direct contorl of the Arduino or is it set by the accelerometer.
It is mostly under control of the Arduino. The accelerometer is set to sample at a certain rate but I can "miss steps" simply by reading the I2C interface at a much lower rate.
What is the range of frequencies and amplitudes you must detect.
I must detect if the oscillation is in the 4-8Hz range. The amplitude will be handled by the accelerometer but I expect it to be between ±4G's
Are there other signals present at the same time which you must ignore.
No, but it would be nice to be able to log the results.
How quickly must you reach a decision when the signal appears.
I haven't decided that yet but the oscillation must persist for several seconds before action is taken. The exact number of seconds hasn't still been determined.
What accelerometer are you suing.
MMA8452Q I2C accelerometer