10 projects

micro:bit Projects

The micro:bit is a pocket-sized board with a 5x5 LED display, two buttons, an accelerometer and a compass; the V2 adds a speaker, a microphone and a touch logo. You can build dozens of projects without buying extra parts, which makes it a great way to start coding.

These micro:bit projects are written in MicroPython for the micro:bit V2. Most of them, such as a beating heart, a scrolling name badge, dice you roll by shaking, a spirit level, a clap-controlled lamp and a pocket thermometer, need only the board. Every project has commented code and a step-by-step walkthrough.

The first 10 projects for beginners

Follow them in this order and each project adds one new skill on top of the last.

  1. 1First Program with micro:bit: Beating HeartFirst Program with micro:bit: Beating HeartUpload your first code to the micro:bit: a big and a small heart take turns on the LED display and beat with a double thump like a real heart. No wires or extra parts; just connect the board to a computer over USB. display.show shows an image and sleep makes the program wait.Beginner
  2. 2micro:bit Name Badge: Scrolling Text on the LED Displaymicro:bit Name Badge: Scrolling Text on the LED DisplayYour name scrolls across the micro:bit's LED display from right to left, then a happy face shows and it all starts again. Clip the board on with a battery pack and it becomes a digital name badge. display.scroll moves the text; no extra parts are needed.Beginner
  3. 3micro:bit Mood Badge: Faces with Buttons A and Bmicro:bit Mood Badge: Faces with Buttons A and BButton A shows a happy face, button B a sad one and both together a surprised one; after five seconds without a press the micro:bit falls asleep. is_pressed reads a button and if / elif makes the choice. No extra parts are needed.Beginner
  4. 4Ticklish micro:bit: A Board That Giggles When You Touch the LogoTicklish micro:bit: A Board That Giggles When You Touch the LogoTouch the gold logo above the display: the micro:bit giggles and its face wiggles left and right, then calms down when you take your finger away. pin_logo.is_touched senses the touch and audio.play plays the sound. No extra parts are needed.Beginner
  5. 5micro:bit Digital Dice: Shake to Rollmicro:bit Digital Dice: Shake to RollShake the board: the dice rolls for a moment, then stops on a random face from 1 to 6. The accelerometer feels the shake (was_gesture) and random.choice picks the face. No extra parts are needed.Beginner
  6. 6micro:bit Pocket Doorbell: Ding Dongmicro:bit Pocket Doorbell: Ding DongPress button A and the onboard speaker plays a two-note doorbell. Button B plays a built-in tune; a note shows while it plays and a house while it waits. music.play plays the notes. No extra parts are needed.Beginner
  7. 7micro:bit Spirit Level: A Dot That Slides as You Tiltmicro:bit Spirit Level: A Dot That Slides as You TiltTilt the board and the lit dot slides toward the lower edge like a marble; when the dot is in the middle the surface is level. The accelerometer measures the tilt (get_x, get_y) and set_pixel lights the dot. No extra parts are needed.Beginner
  8. 8micro:bit Clap Lampmicro:bit Clap LampClap once and the whole LED display lights up like a lamp; one more clap turns it off. The onboard microphone hears the sound (was_event) and set_threshold sets the level. No extra parts are needed.Beginner
  9. 9micro:bit Night Light: Sun or Moonmicro:bit Night Light: Sun or MoonThe LED display also measures the light around it: in a bright room it shows a sun, and when it gets dark a bright moon appears and works as a night light. display.read_light_level reads the light. No extra parts are needed.Beginner
  10. 10micro:bit Pocket Thermometermicro:bit Pocket ThermometerThe board measures the temperature with its built-in sensor and shows it as a rising column: each row is 5 degrees. Press button A and the temperature scrolls as a number. temperature reads the value. No extra parts are needed.Beginner

Projects by difficulty

Beginner10 projects

First Program with micro:bit: Beating Heart
MI-1Beginner

First Program with micro:bit: Beating Heart

Upload your first code to the micro:bit: a big and a small heart take turns on the LED display and beat with a double thump like a real heart. No wires or extra parts; just connect the board to a computer over USB. display.show shows an image and sleep makes the program wait.

micro:bit Name Badge: Scrolling Text on the LED Display
MI-2Beginner

micro:bit Name Badge: Scrolling Text on the LED Display

Your name scrolls across the micro:bit's LED display from right to left, then a happy face shows and it all starts again. Clip the board on with a battery pack and it becomes a digital name badge. display.scroll moves the text; no extra parts are needed.

micro:bit Mood Badge: Faces with Buttons A and B
MI-3Beginner

micro:bit Mood Badge: Faces with Buttons A and B

Button A shows a happy face, button B a sad one and both together a surprised one; after five seconds without a press the micro:bit falls asleep. is_pressed reads a button and if / elif makes the choice. No extra parts are needed.

Ticklish micro:bit: A Board That Giggles When You Touch the Logo
MI-4Beginner

Ticklish micro:bit: A Board That Giggles When You Touch the Logo

Touch the gold logo above the display: the micro:bit giggles and its face wiggles left and right, then calms down when you take your finger away. pin_logo.is_touched senses the touch and audio.play plays the sound. No extra parts are needed.

micro:bit Digital Dice: Shake to Roll
MI-5Beginner

micro:bit Digital Dice: Shake to Roll

Shake the board: the dice rolls for a moment, then stops on a random face from 1 to 6. The accelerometer feels the shake (was_gesture) and random.choice picks the face. No extra parts are needed.

micro:bit Pocket Doorbell: Ding Dong
MI-6Beginner

micro:bit Pocket Doorbell: Ding Dong

Press button A and the onboard speaker plays a two-note doorbell. Button B plays a built-in tune; a note shows while it plays and a house while it waits. music.play plays the notes. No extra parts are needed.

micro:bit Spirit Level: A Dot That Slides as You Tilt
MI-7Beginner

micro:bit Spirit Level: A Dot That Slides as You Tilt

Tilt the board and the lit dot slides toward the lower edge like a marble; when the dot is in the middle the surface is level. The accelerometer measures the tilt (get_x, get_y) and set_pixel lights the dot. No extra parts are needed.

micro:bit Clap Lamp
MI-8Beginner

micro:bit Clap Lamp

Clap once and the whole LED display lights up like a lamp; one more clap turns it off. The onboard microphone hears the sound (was_event) and set_threshold sets the level. No extra parts are needed.

micro:bit Night Light: Sun or Moon
MI-9Beginner

micro:bit Night Light: Sun or Moon

The LED display also measures the light around it: in a bright room it shows a sun, and when it gets dark a bright moon appears and works as a night light. display.read_light_level reads the light. No extra parts are needed.

micro:bit Pocket Thermometer
MI-10Beginner

micro:bit Pocket Thermometer

The board measures the temperature with its built-in sensor and shows it as a rising column: each row is 5 degrees. Press button A and the temperature scrolls as a number. temperature reads the value. No extra parts are needed.

Projects by category

Parts and tools

The parts used most often in these projects, calculators that help while you build, and step-by-step guides.

Frequently asked questions

Which language are the micro:bit projects written in?

These projects use MicroPython. Paste the code into the micro:bit Python editor in your browser and send it to the board over USB; there is nothing to install.

Which micro:bit version are the projects for?

The projects are written for and tested on the micro:bit V2. The speaker, microphone and touch logo exist only on the V2, so we recommend a V2.

Do micro:bit projects need extra parts?

Most do not: the board, a USB cable and a battery pack are enough. Advanced projects add parts such as an LED, a buzzer or a servo with crocodile clip leads.

Other platforms