# Help with microbit sensitivity

**URL:** <https://forum.makecode.com/t/help-with-microbit-sensitivity/28497>\
**Category:** micro:bit\
**Created:** [April 30, 2024, 4:05am UTC](https://forum.makecode.com/t/help-with-microbit-sensitivity/28497 "2024-04-30T04:05:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Whatsuphi](https://avatars.discourse-cdn.com/v4/letter/w/f05b48/32.png) [@Whatsuphi](https://forum.makecode.com/u/Whatsuphi)\
**Post date:** [April 30, 2024, 4:05am UTC](https://forum.makecode.com/t/help-with-microbit-sensitivity/28497/1 "2024-04-30T04:05:43Z")

</div>

I am working on a school project where I need it to do something on shake. However, it will activate with the slightest movement. Is there a way to change the shake sensitivity?

---

<div class="post-metadata">

**Author:** ![bsiever](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bsiever/32/1032_2.png) [@bsiever](https://forum.makecode.com/u/bsiever)\
**Post date:** [May 1, 2024, 3:43am UTC](https://forum.makecode.com/t/help-with-microbit-sensitivity/28497/2 "2024-05-01T03:43:53Z")

</div>

Hi @Whatsuphi — welcome to the forum!

I don’t think there’s an easy way to update the sensitivity.

Here’s a kind of complicated way that would require some variables. The basic logic used for shake detection (for microbit v2) can be found [here](https://github.com/lancaster-university/codal-core/blob/df05db9e15499bd8906618192a4d482e3836c62f/source/driver-models/Accelerometer.cpp#L121). You could create your own logic that uses the same basic approach, but uses higher thresholds. I think there are a few different concepts being used:

1. Detecting the back-and-forth between high accelerations (zero crossing or threshold crossing) in each direction.
2. Counting the number of zero crossings to see if they are enough to consider it a valid “shake”.
3. Checking if enough time has passed to either: start detecting another shake (if there was one in the past) or to start “forgetting” peaks if it’s been too long since the last one.
