Skip to content

First steps

Sensors

Learn how to program your micro:bit to measure your environment using its built-in sensors

Building on your learning in the LEDs and buttons sets, these projects and videos will show you how to program your micro:bit to sense movement, light, temperature and magnetic fields.

Each set of projects is designed to build your understanding and confidence progressively. You can pick one or work through them all to develop your understanding of using the micro:bit’s sensors.

Set 1: Accelerometer games

In this sequence of projects, you’ll learn how to use the accelerometer and create dice and a game with your micro:bit.

Shake your micro:bit to make random numbers

Set 2: Accelerometer step counters

Learn how to use the accelerometer to program increasingly sophisticated step counters.

Make your own step counter with a micro:bit

Set 3: Temperature

Learn how to transform your micro:bit into a thermometer.

Make a simple thermometer with your micro:bit

Learn more about the micro:bit's temperature sensor

Set 4: Light

Discover how to use the micro:bit's built-in light sensor, starting with the 'Sunlight sensor' project we met in the LEDs and buttons set.

Create a light that turns on when it’s dark

Make an alarm that goes off when lights go on

Learn more about the micro:bit's light sensor

Set 5: Compass

Transform your micro:bit into a compass and learn how to use it to sense if magnets are near

Create a simple compass to show which way is North

Learn more about the compass on the micro:bit

Set 6: Touch logo - new

The new micro:bit with sound has a gold logo on the front that works as a touch sensor. These projects show you how you can use it as an extra input.

Touch your micro:bit to light up the heart

Simple timer for the new touch logo

Learn more about the touch logo on the new micro:bit