Skip Navigation


By Jen Perry 2-3 hours
Grades 4-6
English Language Arts,
Science and Technology,
  • Programming
  • Computing and Networks
  • Data
  • Design
Tools & Languages

Key Coding Concepts

  • Algorithms
  • Conditional Statements
  • Events
  • Variables



A step-by-step set of operations to be performed to help solve a problem



Making connections based on conditions (ie. if it is raining, then open your umbrella)



When one thing causes another thing to happen



A placeholder for a piece of information that can change

In the first project, learners will explore the magic of micro:bit by creating their own magic wand that will control a program through Scratch.

In the second project, learners will learn about conditionals and ‘If...Then...Else’ statements as they program their own Magic 8 Ball game.

In the third project, learners will code their micro:bit to act as the sorting hat from Harry Potter.


  • The educator should have some knowledge of micro:bit
  • Learners should have had some previous experiences with coding (Scratch or Blockly)


  • micro:bit (1 per learner)
  • Computers or a device capable of pairing to micro:bit


  • Craft supplies for magic wand: wooden dowels, fabric, duct tape, cardboard, glitter, tinfoil, elastic bands, etc.

Before the lesson…

  • Review key coding concepts and ensure you are confident describing them to your group
  • Build the lesson’s main project, ensuring you are comfortable with all steps

Project #1: micro: Magic Wand (60+ minutes)

Provide learners with materials to create their own micro:bit magic wand. The micro:bit should be hidden securely behind the star part of the wand.

Make sure Scratch is connected to micro:bit by following these instructions.
*Note: this project could be adapted to work with MakeCode program

Watch the video ‘Magic Wand (Scratch 3.0 + micro:bit)’ from Pinky Pepper.
*Note: Timestamp 1m06s shows code.

Allow learners an opportunity to remix their own magic wand program.

Project #2: Magic 8 Ball Game (30+ minutes)

Using the micro:bit MakeCode editor, learners will program the micro:bit to act as a Magic 8 Ball. The finished game allows you to ask the micro:bit a question and it will respond with a random answer!

Complete the easy to follow 7 steps.

Allow learners an opportunity to remix the code. For example, they could change the Magic 8 Ball’s responses.

Project #3: micro:bit Hogwarts Sorting Hat (101Computing.Net) (30+ minutes)

Using the micro:bit MakeCode Editor, learners will program their micro:bit to act as a sorting hat.

Complete the following tutorial.

Allow learners the opportunity to create some of their own code (remix the project).

Is the learner able to independently follow coding instructions?

Does the learner have a growth mindset, troubleshooting any bugs that may arise?

Is the learner able to take risks and create some of their own code?

For Project #2

As a Language Arts extension, have learners write down possible questions they could ask the Magic 8 Ball. Have a discussion about open vs. closed questions.

As an art extension, have learners use crafting materials to create their own crystal Magic 8 Ball.

For Project #3

As an art extension, learners could design their own sorting hat that the micro:bit can be attached to.

MakeCode Reference Guide:

The Official BBC micro:bit User Guide (2018) by Garteth Halfacree

micro:bit Tutorial Series Part 1: Getting Started

micro:bit by BBC - Creative Classroom Tips for Educators

Connecting Scratch to micro:bit

Magic Wand (Scratch 3.0 + micro:bit) from Pinky Pepper: Magic 8 Ball

Variables ( Video)

Conditional: If...Then...Else Statements (Flocabulary Conditional Video)

micro:bit Hogwarts Sorting Hat (101Computing.Net)

Teach lessons that are tied to your existing curriculum!


More Lesson Plans For Grades 4-6

    View All Lesson Plans

    Explore lessons based on components

    The K-12 Computer Science Framework

    Although learning how to build digital projects is a key part of Computer Science education, students should also learn a wider set of skills and competencies that will help them to harness the power of digital technologies as both creators and consumers. A comprehensive approach to K-12 Computer Science education includes learning about the following five focus areas:

    View Framework ➝


    By the end of high school, students should be able to create a simple computer program.

    Computing and Networks

    By the end of high school, students should understand and be able to use the tools and devices commonly used to build digital projects.


    By the end of high school, students should be able to explain how we use computers to create, store, organize, and analyze data.

    Technology and Society

    By the end of high school, students should be able to explore the ways in which technology and society have mutually shaped each other.


    By the end of high school, students should be able to apply design principles to the digital projects they create.