element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Detect oscillations
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 33 replies
  • Answers 1 answer
  • Subscribers 396 subscribers
  • Views 2647 views
  • Users 0 members are here
  • oscillations
  • processing
  • accelerometer
  • movement
  • algorithm
  • arduino
Related

Detect oscillations

kosme
kosme over 11 years ago

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 Michael Kellett questions

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

  • Sign in to reply
  • Cancel

Top Replies

  • michaelkellett
    michaelkellett over 11 years ago +1 suggested
    Hello Enrique, It makes it easier for people to follow the thread if you just add a new message rather than editing the original question. It seems that you want to detect energy in the band 4 - 8Hz, not…
  • D_Hersey
    D_Hersey over 11 years ago +1
    SO has just come down with Parky's, so I know of the characteristics of the tremors, they do seem to have a characteristic wave form, narrow fq, fairly constant amplitude between ramp-up and ramp-down…
Parents
  • michaelkellett
    0 michaelkellett over 11 years ago

    Hello Enrique,

     

    It makes it easier for people to follow the thread if you just add a new message rather than editing the original question.

     

    It seems that you want to detect energy in the band 4 - 8Hz, not too big an issue with external noise, using an MMA8452Q I2C accelerometer.

     

    The accelerometer can be set to sample at 50 or 100Hz and the data must be bandpass filtered to accept frequencies between 4 and 8 Hz. The simplest (good) way to measure the amplitude of the incoming signal is to compute the square root of the continuous average of the square of the input samples.

    If you know how to do the filtering and averaging then you can start coding - if not then come back here and I'll try to give some pointers. (Do you have access to the student edition of MATLAB ?)

     

    MK

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • kosme
    0 kosme over 11 years ago in reply to michaelkellett

    Sorry about the editing issue, it`s the first time I post here. I don't have access to the student edition of MATLAB but I do have access to Mathematica.

     

    Part of the filtering can be done at the accelerometer, but I am not quite sure how to do the low pass part on the Arduino. Same with the RMS of the input samples.I would do it like this: √1/n(∑x²)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • kosme
    0 kosme over 11 years ago in reply to michaelkellett

    Sorry about the editing issue, it`s the first time I post here. I don't have access to the student edition of MATLAB but I do have access to Mathematica.

     

    Part of the filtering can be done at the accelerometer, but I am not quite sure how to do the low pass part on the Arduino. Same with the RMS of the input samples.I would do it like this: √1/n(∑x²)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • michaelkellett
    0 michaelkellett over 11 years ago in reply to kosme

    Since you don't have filter design tools it might be easier for you to do everything in the accelerometer. It has high and low pass digital filters which you can select. It also has event detection (transient detection) which may be good enough for your application. Study the accelerometer data sheet carefully and see if it will do what you need.

     

    Do you have  a good definition of the acceleration events you want to detect ?

     

    Can you explain the purpose of your project ?

     

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • kosme
    0 kosme over 11 years ago in reply to michaelkellett

    I am trying to log shaking episodes in neurodegenerative diseases patients using a portable device. For that is that i would like to filter the frequencies and detect if they fall in the frequency range I am studying. If the detection remains constant for a certain amount of time, say 3 seconds, then the logging process would begin.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • michaelkellett
    0 michaelkellett over 11 years ago in reply to kosme

    Is this a commercial or university or private project ?

     

    How much time do you have available to work on it.

     

    Any advice I might give you would be different according to these constraints.

     

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • kosme
    0 kosme over 11 years ago in reply to michaelkellett

    Currently this is a private project but it has the change of turning into a commercial project in the future. I have plenty of time to work on it since this is currently my main concern.

     

    Ps. I finally understood your question about Matlab, the filter design tools. I will work on getting a copy of it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 11 years ago in reply to kosme

    Bit late for this but Hi there and welcome

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube