Introduce your class to physical computing with micro:bit and MicroPython. This course is an advanced introduction to micro:bit and requires prior Python programming knowledge. The curriculum engages campers as they see their abstract programs come to life on a tangible physical device that they can control with their hands. Using built-in micro:bit sensors, buttons, and the 5X5 LED display, campers build animated LED emojis, real-world temperature sensors, pedometers, multiplayer games, and even a two-way Morse code radio.
The course includes 16 hands-on projects with step-by-step instructions. It is delivered in an interactive notebook-style lesson format so that campers can learn new concepts, write programs, and deploy code to the micro:bit right from the lesson interface. There is nothing to download or install on your computer. In addition, campers can also launch Tynker Code Editor and write their own programs from scratch.
The lesson plans in this course build and reinforce STEM skills, problem solving, debugging, and collaboration skills as campers bridge digital and physical learning. Students wiil apply abstract programming concepts to create tangible hands-on micro:bit-based inventions.
Each lesson is designed for a class period of 45-60 minutes. All campers work is automatically tracked and assessed, and you'll be able to monitor individual progress and mastery charts for your campers.
This course is recommended for advanced campers who are already familiar with Python. Beginner campers may enroll in micro:Bit 101 where they use Tynker Blocks to program micro:bit.
This course is supported online and not supported on iPad.
Recommended Accessories: This course requires micro:bit devices (not included). You may purchase these separately at a variety of resellers or consider buying the classroom pack from Tynker. Each lesson has a detailed Parts List.
- micro:bit, USB cable, Battery pack, 2xAAA batteries (for each camper or group)
- Accessories: Lessons 13, 14 require a Piezo speaker and Alligator clips
- Lessons 15,16 require two or more micro:bits
- Optional: microBit Inventor’s Kit: Classroom Pack (includes accessories required for all lessons)
While most lessons need a single micro:bit, it is encouraged that campers improvise to create inventions that incorporate external cables, LEDs, speakers, aluminum foil, and other accessories, when available.
See the this section on the micro:bit foundation for more ideas!
Topics Covered: micro:bit Python commands, 2-way radio communication, deploying code to the micro:bit, light and temperature sensing, reading sensor values, gestures and motion detection, Programming the LED grid, multiplayer game development
* Online courses require a modern desktop computer, laptop computer, Chromebook, or Netbook with Internet access and a Chrome (29+), Firefox (30+), Safari (7+), or Edge (20+) browser. No downloads required.
MicroPython Studio Lesson Plan
Time: 45+ mins
Welcome to Tynker's MicroPython Studio course! This course contains 14 exciting lessons that will teach your campers how to program a micro:bit, which is a small (yet powerful) computer called a microcontroller. Did you know microcontrollers are all around us? They can be found in automobiles, mobile phones, laptops, and more! As campers progress through the course, they'll learn about microcontrollers as they create a variety of projects while reinforcing coding concepts in the challenge activities.
Campers will likely encounter a situation where their micro:bit does not work as expected, so they'll need to troubleshoot. The problem could be caused by human error (e.g., incorrect syntax, forgetting to attach the USB) or the device (e.g., the firmware isn't updated).
By the end of this lesson, campers will become familiar with using their micro:bit as they complete a text scrolling and counter project. Note: Answers to all challenge solutions and quiz questions are located below the "Standards" section of this teacher guide.
- display.scroll() : This is a display function that allows the user to scroll text on the micro:bit.
- button_a.was_pressed() : This is a button function that returns True when button A is pressed on the micro:bit.
- button_b.was_pressed() : This is a button function that returns True when button B is pressed on the micro:bit.
- micro:bit : A small computer that can run MicroPython commands
- MicroPython: A version of Python that's designed to run on tiny computers, such as the micro:bit.
- Booleans: Values that can only be True or False.
- Loop: A loop is used to repeat one or more commands over and over
- Demonstrate how to program and download code onto the micro:bit
- Apply coding concepts to complete the challenge activities
- Create a text scrolling and counter project using the micro:bit
- micro:bit device (recommended 1 per camper)
- USB cord
- Computers, laptops, or Chromebooks (1 per camper) with student account access to Tynker.com
Warm-Up (5 minutes)
Tell campers that they're going to learn how to program their micro:bit today using Tynker! Prepare campers for today's lesson by helping them understand how to program their micro:bit. For example:
- Step 1: Use Tynker's Text Code Editor to write your code
- Step 2: Attach your USB to the computer and the micro:bit
- Step 3: Click Deploy, then select the device you're using
- Step 4: Test your micro:bit to make sure your code transferred correctly
Activities (45 minutes)
Facilitate as campers complete all Introduction modules on their own:
1. What Is a micro:bit? (Document)
- Campers will read a short document that introduces micro:bit and the MicroPython Studio course. Here's what the micro:bit looks like:
- Emphasize to campers that they’ll need to read each module carefully so they can apply concepts from the lesson to program their micro:bit correctly and answer a multiple-choice quiz.
- Point out the different features of the micro:bit: accelerometer, thermometer, compass, light sensor, and radio. Explain to campers that they'll explore these features and more in the upcoming modules.
- Tell campers to click the Next button (located at the bottom of the document) to move on to the next module.
2. What is MicroPython? (Example)
- In this module, campers will learn about MicroPython, a version of Python that can be used to run on micro:bits. Additionally, they'll learn how to deploy code to the micro:bit.
- Explain to campers that the purple image of a micro:bit indicates an activity that requires using the Tynker Code Editor and deploying code. Here's what the purple circuit icon looks like:
- Are campers struggling to deploy their code?
- Read the "Deploy Code" instructions carefully
- Make sure the USB cable is properly attaching the micro:bit to the computer
- Ask them to click the Deploy button in the code editor
- Check that they're connecting the micro:bit to the correct device (e.g., BBC micro:bit CMSIS-DAP, TDAP-Link, LPC1768)
- Update the micro:bit's firmware. Here's a link with helpful instructions:
3. Hello, World! (DIY)
- Campers will learn how to write their first program using MicroPython and the display.scroll() function.
- Tell campers that the display.scroll() function allows them to display text on their micro:bit.
- Coding Challenge: Change the Display
- To solve this challenge, campers need to change the word "Tynker" to "Hello, World!". Note: Answers to all challenge solutions are located below the "Standards" section of this teacher guide.
- Remind campers to type their code inside Tynker's Code Editor. Then, they'll need to click the Deploy button:
- Optional: Ask campers, "What does the Deploy button do?" (Answer: The Deploy button downloads the code onto the micro:bit.)
- If campers finish early, ask them to change the text to a different word, such as their name or favorite color. Their code might look similar to this:
4. Scorekeeper (DIY)
- Campers will learn how to create a program that keeps track of a score using the A and B buttons on the micro:bit.
- Point out to campers that the A and B buttons on the micro:bit can be used to increase, decrease, or reset the count. Once campers finish programming their micro:bit, they can see the count displayed on the micro:bit.
- This page includes two challenges:
- Coding Challenge: Creating a Variable- Tell campers to create a variable called counter and make sure they assign it a value of 0. Next, they'll need to display the counter variable using the display.scroll() function.
- Coding Challenge: Using the Buttons- To solve this challenge, campers need to program the micro:bit's button A to increase the counter variable and button B to decrease the counter variable. Give a hint: Tell campers that in Python, the += operator adds to the variable, whereas the -= operator subtracts from the variable.
- Are campers struggling with the "Taking It Further" activity?
- Give a hint: Tell them to create an if statement using the button_a.was_pressed() and button_b.was_pressed() functions. Next, they'll need to reset the counter to 0. They'll also need to display the counter variable using the display.scroll() function.
- The code for the bonus section might look similar to this:
5. Review (Document)
- This page reviews the following:
- How to import the micro:bit's module using from microbit import *
- How to increase a variable's value by using the += operator
- display.scroll(text, wait=False, loop=False): Check that campers understand the different parameters. For example, the text parameter needs to be in quotations. Point out to campers that display.scroll() can also include wait and loop parameters.
- The button_a.was_pressed() function controls button A on the micro:bit.
- The button_b.was_pressed() function controls button B on the micro:bit.
- Applying two different loops: while True: and If...Else...
6. Quiz (Multiple-choice)
- Inform campers that they'll need to apply what they've learned and answer a multiple-choice quiz. Note: Quiz questions and answers are located below the "Standards" section of this teacher guide.
Extended Activities (10 minutes)
Lead a discussion with your campers:
- Who can name at least two different micro:bit parts you learned today? (Answer: input/output pins, button A, button B.)
- What does the Deploy button do? (Answer: downloads your code onto the micro:bit.)
- If you're micro:bit isn't working as expected, what should you do? (Answer: check your code's syntax, make sure the USB is attached properly, ask a neighbor or the teacher for help, make sure you're pairing your micro:bit correctly, update the firmware.)
- CCSS-ELA: 6-8.RST.3, 6-8.RST.4, 6-8.RST.7
- CSTA: 2-AP-11, 2-AP-13, 2-AP-15, 2-AP-17
- CS CA: 6-8.AP.11, 6-8.AP.13, 6-8.AP.15, 6-8.AP.16, 6-8.AP.17
- ISTE: 1.c, 1.d, 4.d, 5.c, 5.d, 6.b
Key Stage 2 (Years 4-6)
- Design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller parts.
- Use logical reasoning to explain how some simple algorithms work and to detect and correct errors in algorithms and programs.
- Understand computer networks, including the internet; how they can provide multiple services, such as the World Wide Web, and the opportunities they offer for communication and collaboration.
- Use technology safely, respectfully and responsibly; recognise acceptable/unacceptable behaviour; identify a range of ways to report concerns about content and contact.
Key Stage 3 (Years 7-9)
- Understand several key algorithms that reflect computational thinking [for example, ones for sorting and searching]; use logical reasoning to compare the utility of alternative algorithms for the same problem.
- Create, re-use, revise and re-purpose digital artefacts for a given audience, with attention to trustworthiness, design and usability.
- Understand a range of ways to use technology safely, respectfully, responsibly and securely, including protecting their online identity and privacy; recognise inappropriate content, contact and conduct and know how to report concerns.