Learning Objectives
By the end of this lesson, you will be able to:
-
Understand what the BBC Micro:bit is and how it works.
-
Identify the main parts and built-in features of the Micro:bit.
-
Recognize examples of Micro:bit projects.
-
Create a simple demonstration using Micro:bit’s built-in components.
What is Micro:bit?
The BBC Micro:bit is a small, programmable computer designed to make coding and electronics fun and easy for beginners. It’s about the size of a credit card but packed with powerful features that allow you to create games, control devices, and even build simple IoT projects.
You can program the Micro:bit using block-based coding (Microsoft MakeCode), Python, or JavaScript. It connects to your computer via USB or Bluetooth, making it very accessible for students.
Main Features of Micro:bit
-
LED Display – A 5x5 grid of LEDs for showing text, numbers, and images.
-
Buttons – Two programmable buttons (A and B) for input.
-
Sensors – Built-in accelerometer (detects motion/tilt) and compass (magnetic direction).
-
Temperature Sensor – Detects the surrounding temperature.
-
Light Sensor – Measures light levels.
-
Pins – For connecting external components like LEDs, buzzers, or motors.
-
Wireless Communication – Bluetooth for sending/receiving data to other devices.
Examples of Micro:bit Projects
-
Step Counter – Using the accelerometer to count steps and display them on the LED grid.
-
Digital Compass – Showing directions using the compass sensor.
-
Temperature Alert – Displaying a warning when the temperature is too high or low.
-
Light Level Meter – Using the light sensor to measure brightness in a room.
-
Simple Games – Rock-Paper-Scissors or reaction time games using the buttons and display.
Demonstration Idea
Demo 1: Light Level Display
-
Program the Micro:bit to read the built-in light sensor.
-
Show the light level as a number on the LED grid.
-
If the light level is low, display a sun icon to remind the user to turn on a light.
Demo 2: Temperature Display
-
Read the built-in temperature sensor.
-
Display the current temperature on the LED grid.
-
If the temperature exceeds a certain limit, display a warning symbol.
Demo 3: Button Counter
-
Use button A to count up and display the number on the LEDs.
-
Use button B to reset the count.
Tutorial: How to Use Micro:bit Online
1. Introduction
The BBC Micro:bit is a small, programmable microcontroller designed for learning coding and electronics. You don’t even need to own the physical device to start — you can use the online simulator to test your projects.
2. Accessing the Online Micro:bit Editor
-
Open your browser (Google Chrome or Microsoft Edge is recommended).
-
Go to: https://makecode.microbit.org
-
You will see the MakeCode Micro:bit homepage with options to start coding.
3. Creating a New Project
-
Click New Project.
-
Give your project a name (e.g., “First LED Program”).
-
Click Create.
-
The coding workspace will appear — block-based code on the left, simulator on the right.
4. Understanding the Interface
-
Block Categories (left sidebar) – Code blocks grouped into categories like
Basic,Input,Music,LED,Radio, etc. -
Workspace (center) – Drag and arrange blocks here to create your program.
-
Simulator (top left) – A virtual Micro:bit showing how your code will run.
-
Menu Bar (top) – Options to save, share, or download your code.
5. Writing Your First Program
Example: Make the Micro:bit display a heart.
-
In the
Basiccategory, drag the show icon block into the workspace. -
Click the drop-down menu on the block and select the Heart icon.
-
Place it inside the
foreverloop block. -
The simulator will instantly display a heart on the Micro:bit screen.
6. Adding Interactivity
Example: Display a smiley face when button A is pressed.
-
Go to the
Inputcategory. -
Drag the on button A pressed block into the workspace.
-
From the
Basiccategory, drag the show icon block and place it inside. -
Select the Smiley face icon.
-
Press Button A in the simulator — it will show a smiley.
7. Saving and Downloading Code
-
If you have a real Micro:bit:
-
Click Download in the top right.
-
Save the
.hexfile to your computer. -
Plug in your Micro:bit via USB — it will appear as a storage device.
-
Drag and drop the
.hexfile into the Micro:bit drive.
-
-
If you don’t have a real Micro:bit:Use the simulator to test your program directly.
8. More Fun Projects to Try
-
Scrolling text (
Basic → show string) -
Temperature display (
Input → temperature) -
Shake detection (
Input → on shake) -
Simple games (
Gamecategory) -
Music tones (
Musiccategory, requires physical Micro:bit with buzzer)
9. Tips for Beginners
-
Always test in the simulator before downloading to the device.
-
Save your project often — use the Save button.
-
Use comments (
Advanced → More → Comment) to describe your code. -
Explore the Tutorials section in MakeCode for step-by-step guided lessons.
10. Helpful Links
-
Official MakeCode Micro:bit: https://makecode.microbit.org
-
Micro:bit Foundation: https://microbit.org
Comments
Post a Comment