+ Post New Thread
Results 1 to 13 of 13
  1. #1
    Junior Member level 3
    Points: 406, Level: 4

    Join Date
    May 2017
    Posts
    26
    Helped
    0 / 0
    Points
    406
    Level
    4

    Accelerator click detection and movement detection

    Hello guys I am not sure about this, I set the accelerometer for click detection. I expect the accelerometer will generate interrupt when I tap on it, but it seems the accelerometer will generate interrupt when I shake it. Is it normal?

  2. #2
    Super Moderator
    Points: 81,321, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,331
    Helped
    4453 / 4453
    Points
    81,321
    Level
    69

    Re: Accelerator click detection and movement detection

    It depends on which accelerometer it is but in general they are motion sensors so any movement, whether a click or shake will register. When you say you set it for 'click detection' what exactly does that imply? Does it just filter out slower movements and if so, there there must be some threshold beyond which it can't tell a fast movement from the vibration of a click.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



    •   AltAdvertisement

        
       

  3. #3
    Member level 4
    Points: 1,080, Level: 7
    Altaero's Avatar
    Join Date
    Dec 2013
    Location
    St-Petersburg, Russia
    Posts
    78
    Helped
    24 / 24
    Points
    1,080
    Level
    7

    Re: Accelerator click detection and movement detection

    I expected to see at least accelerometer model.

    In general, that is not normal. For 'click' (or 'tap') detection usually 2-3 parameters are used:
    - threshold value for acceleration slope (not the acceleration itself);
    - shock time (clicking is very fast motion, so the acceleration change must cease before the shock time ends);
    - quiet time (for double-click recognition).

    In your case I presume your shock time is too big, so shaking causes the accelerometer to see it as 'click'. But that is only my assumption. It depends on the accelerometer model, settings and your mechanic part.



  4. #4
    Junior Member level 3
    Points: 406, Level: 4

    Join Date
    May 2017
    Posts
    26
    Helped
    0 / 0
    Points
    406
    Level
    4

    Re: Accelerator click detection and movement detection

    Click detection is when I tap on the accelerometer,it will generate a interrupt. I am using LIS3DH to do this thing.



  5. #5
    Junior Member level 3
    Points: 406, Level: 4

    Join Date
    May 2017
    Posts
    26
    Helped
    0 / 0
    Points
    406
    Level
    4

    Re: Accelerator click detection and movement detection

    I am using LIS3DH to do this thing. When I tap on the accelerometer, it will generate an interrupt. When I tap on it, it will generate interrupt but when I shake it, the accelerometer also will generate interrupt. I am not sure whether this is normal or not.



  6. #6
    Member level 4
    Points: 1,080, Level: 7
    Altaero's Avatar
    Join Date
    Dec 2013
    Location
    St-Petersburg, Russia
    Posts
    78
    Helped
    24 / 24
    Points
    1,080
    Level
    7

    Re: Accelerator click detection and movement detection

    See p. 29 in the appnote below:
    LIS3DH AppNote

    One thing I forgot to ask. When you tap the acc, does it generate interrupt? I.e. it generates interrupt both from click and from shake?
    I expect your TIME_LIMIT value is too big for your application, you should try to decrease it. Another trap is that TIME_LIMIT depends on ODR, so if your ODR is too low, then time limit window will be too big.
    From my experience, 'click' event lasts from ones ms to 10 ms.


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  7. #7
    Junior Member level 3
    Points: 406, Level: 4

    Join Date
    May 2017
    Posts
    26
    Helped
    0 / 0
    Points
    406
    Level
    4

    Re: Accelerator click detection and movement detection

    Yup, it generate interrupt. =) One more thing, can single click and double click activate at the same time?



  8. #8
    Member level 4
    Points: 1,080, Level: 7
    Altaero's Avatar
    Join Date
    Dec 2013
    Location
    St-Petersburg, Russia
    Posts
    78
    Helped
    24 / 24
    Points
    1,080
    Level
    7

    Re: Accelerator click detection and movement detection

    I didn't try that, so I'm not sure. But according to the appnote, if you configure the acc to detect both and single click (in CLICK_CFG), and route them to the same INT pin, then you will have single click interrupt followed by combined single and double click interrupt.



  9. #9
    Junior Member level 3
    Points: 406, Level: 4

    Join Date
    May 2017
    Posts
    26
    Helped
    0 / 0
    Points
    406
    Level
    4

    Re: Accelerator click detection and movement detection

    That so weird, when I set to double click detection, it will only detect double click and single click is not function. It won't generate any interrupt.



  10. #10
    Member level 4
    Points: 1,080, Level: 7
    Altaero's Avatar
    Join Date
    Dec 2013
    Location
    St-Petersburg, Russia
    Posts
    78
    Helped
    24 / 24
    Points
    1,080
    Level
    7

    Re: Accelerator click detection and movement detection

    What did you write to CLICK_CFG register? Do you have both single and double click turned on? Try to play with it.



  11. #11
    Junior Member level 3
    Points: 406, Level: 4

    Join Date
    May 2017
    Posts
    26
    Helped
    0 / 0
    Points
    406
    Level
    4

    Re: Accelerator click detection and movement detection

    I enabled both but still no luck... Hmmm....



  12. #12
    Member level 4
    Points: 1,080, Level: 7
    Altaero's Avatar
    Join Date
    Dec 2013
    Location
    St-Petersburg, Russia
    Posts
    78
    Helped
    24 / 24
    Points
    1,080
    Level
    7

    Re: Accelerator click detection and movement detection

    Unfortunately appnote doesn't explicitly states both single and double click detection. Besides CLICK_CFG there is CLICK_SRC register that also setups single/double click. Interrupt registers CTRL_REG3 and CTRL_REG6 doesn't distinguish between single and double clicks.
    Show your initialization code. And what behavior you expect? I.e. you need both single and double click detection? Maybe it would be easier to setup only single click in the accelerometer and implement double click in software?



    •   AltAdvertisement

        
       

  13. #13
    Junior Member level 3
    Points: 406, Level: 4

    Join Date
    May 2017
    Posts
    26
    Helped
    0 / 0
    Points
    406
    Level
    4

    Re: Accelerator click detection and movement detection

    Never mind, I just play around with the accelerometer. I think when we set to both single and double tap, it will only generate interrupt when double tap detected and single tap may not generate any interrupt. I think oscilloscope can read the single tap signal.



--[[ ]]--