Microbit Robotics & Engineering Teacher Training
Beginner
15 mins
Teacher/Student led
+105 XP
What you need:
Chromebook/Laptop/PC

Accelerometer

In this lesson, you will learn about accelerometers and their applications in detecting and measuring motion. You will also explore how a micro:bit senses movement.
Learning Goals Learning Outcomes Teacher Notes

Live Class Feed

This is a live feed of the latest activity by your students on this lesson. It will update in real-time as they work on the lesson.
Load previous activity

    1 - Introduction to Accelerometers

    Accelerometers are sensors that measure acceleration, which is the rate of change in velocity. They are commonly used in robotics, smartphones, and other devices to detect movement, orientation, and even vibrations. Accelerometers are essential for detecting and measuring motion in various applications.


    2 - Types of Accelerometers

    There are several types of accelerometers, including capacitive, piezoresistive, and piezoelectric accelerometers. Each type works differently, but they all measure acceleration by detecting changes in force or displacement. Capacitive accelerometers are the most common type used in consumer electronics, including smartphones and tablets.

    3 - Accelerometer Applications

    Accelerometers have a wide range of applications, such as:

    • Measuring tilt and orientation in robotics
    • Detecting free fall in smartphones and tablets
    • Monitoring vibrations in machinery
    • Measuring motion in sports and fitness devices
    • Tracking movement in virtual reality systems

    4 - Micro:bit Accelerometer

    The micro:bit is a small, programmable computer that includes a built-in accelerometer. The accelerometer on the micro:bit can detect movement in three axes: x, y, and z. You can use the accelerometer to create projects that react to movement, such as a tilt-controlled game or a step counter.

    5 - Accelerometer Code Example

    Here is an example of how to use the accelerometer on a micro:bit to detect different gestures using the accelerometer.

    input.onGesture(Gesture.LogoUp, function () {
        basic.showArrow(ArrowNames.North)
    })
    input.onGesture(Gesture.TiltLeft, function () {
        basic.showArrow(ArrowNames.West)
    })
    input.onGesture(Gesture.Shake, function () {
        basic.showIcon(IconNames.No)
    })
    input.onGesture(Gesture.TiltRight, function () {
        basic.showArrow(ArrowNames.East)
    })
    input.onGesture(Gesture.LogoDown, function () {
        basic.showArrow(ArrowNames.South)
    })

    Unlock the Full Learning Experience

    Get ready to embark on an incredible learning journey! Get access to this lesson and hundreds more in our Digital Skills Curriculum.

    Copyright Notice
    This lesson is copyright of Coding Ireland. Unauthorised use, copying or distribution is not allowed.
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more