Login

Please fill in your details to login.





micro:bit - free-fall sensor

This page is mainly about micro:bit - free-fall sensor
Free-fall sensor

The accelerometer can also be used to detect if the micro:bit has been dropped - the gesture is called 'freefall'. Accelerometers are built into mechanical hard drives to detect if the drive (or device containing the drive) has been dropped and park the drive head to prevent damage. The accelerometer monitors the strength of the acceleration due to gravity on the device and if it fall quickly below a threshold (about 500mg), freefall is triggered.

TAKE CARE : To trigger 'freefall', you will have to drop your micro:bit. Make sure that you have a long USB cable and that there is something to catch the device like a cushion or a coat. Don't just drop your micro:bit!

BL / JS / PY : Develop a simple script which allows you to detect whether the micro:bit has entered freefall. Because it's difficult to see the display, you are better outputting a message to the serial port and monitor this with Mu or Putty.
BL / JS / PY : Use the join text block to add the accelerometer strength reading to the message which displays to the terminal when freefall is detected. You should see that the accelerometer strength is below 500mg when freefall is detected.

(microbit-accelerometer-freefall)
(microbit-accelerometer-freefall-strength)
Last modified: October 5th, 2021
The Computing Café works best in landscape mode.
Rotate your device.
Dismiss Warning