Back to micro:bit projects

Sleep Tracker

Have you ever wondered how many times you turn over while you sleep? In this project, you are going to make a sleep tracker that will display how rested you are. You can run the program on your micro:bit when it is placed under your pillow, so it can track your sleep movements.

Start project Download lesson plan PDF
Sleep tracker

What you will learn

  • Use variables to track your sleep movements
  • Display the number of movements on the micro:bit’s LEDs
  • Use buttons and logic to reset the tracker and control the brightness of the LED display
  • Use a loop to create an animation
  • Organise your code using a function

What you will need

Curriculum alignment for this project

Use this guide to see how Code Club delivers on the NDTC.