ME1-2 MICRO:BIT CODING
Home โบ ME1-2 โ Micro:Bit Coding
๐ INSTRUCTOR DOCW Institute ยท Grades 5โ8
Micro:Bit Coding ๐ก
ME1-2
A hands-on physical computing course where students program a real BBC micro:bit โ from first blink to building a fully functional smart device using sensors, radio, data logging, and game design.
Learning Objectives
- Identify the physical components and built-in sensors of the micro:bit
- Connect the micro:bit to a computer via USB and run the out-of-box program
- Understand what a microcontroller is vs. a regular computer
Materials
- BBC micro:bit + USB cable (1 per student or pair)
- Computers with Chrome or Edge browser
- Projector for demo
- Paper for observation notes
Key Vocabulary
- 25 LED matrix (5ร5) โ output display
- Buttons A & B โ user inputs
- Edge connector pins โ connect external components
- Accelerometer โ detects tilt and shake
- Magnetometer โ compass direction
- Temperature + light sensors
- V2 only: built-in microphone and speaker
- The micro:bit appears as a USB drive named "MICROBIT"
- The out-of-box program runs โ scrolling text, animations
- Students press A and B, tilt the board, and observe
๐ฏ Differentiation
- Grade 5: Focus on A/B buttons. Describe each part in own words.
- Grade 8: Research: How does an accelerometer work at the hardware level?
โ Assessment
Exit observation sheet (3 things I noticed, 2 questions I have, 1 thing I want to build). Informal โ no collection required.
Learning Objectives
- Navigate the MakeCode editor (simulator, block palette, workspace)
- Write a program using "on start", "on button pressed", and "show string"
- Flash a program to the physical micro:bit
Materials
- micro:bit + USB cable per student
- Chrome or Edge browser (for WebUSB flashing)
- MakeCode editor open on all computers
Key Vocabulary
- LEFT โ Simulator: Virtual micro:bit โ code runs here instantly without hardware
- CENTER โ Block Palette: Code blocks organized by category (Basic, Input, Logic, Loops, Variablesโฆ)
- RIGHT โ Workspace: Where you drag and connect blocks to write your program
on button A pressed โ show icon โค๏ธ // heart appears
on button B pressed โ show number 42 // shows your age
on button A+B pressed โ show leds [custom] // your pattern
Method 2 (Manual): Click Download โ .hex file saves โ drag from Downloads onto the MICROBIT USB drive. Orange LED flashes during transfer.
Students hold up micro:bits when done and show their scrolling names. ๐
๐ฏ Differentiation
- Grade 5: Steps 1โ3 only. Focus on event โ action pattern.
- Grade 8: Add a counter variable โ count Button A presses, display on B.
โ Assessment
Observe: Can students connect an event block to an action block? Can they flash to hardware? Working name display on physical board.
Learning Objectives
- Use "forever" to create continuously running programs
- Write if/else conditionals using sensor values
- Create and use variables to store changing data
Materials
- micro:bit + USB cable per student
- MakeCode editor
- Tutorial reference: makecode.microbit.org/tutorials
Key Vocabulary
show leds [pattern A]
pause 500 ms
show leds [pattern B]
pause 500 ms
}
if (temperature ยฐC > 25) {
show string "HOT"
} else {
show string "COOL"
}
}
- Button A โ show icon [happy face]
- Button B โ show icon [sad face]
- On shake โ show icon [surprised]
- Grade 7โ8 extension: Add a "mood score" variable (0โ10). A increases it, B decreases it. Display on logo touch (V2) or A+B.
๐ฏ Differentiation
- Grade 5: Mood Monitor without variables. Focus on if/else structure.
- Grade 8: Nested conditionals + capped variable (if mood > 10 โ set mood to 10).
โ Assessment
Demo Mood Monitor to a partner. Observe: correct if/else structure, loop usage, sensor read working on hardware.
โ ๏ธ Before Class
- Download and review the Lesson Plan. Download the PPT โ it has embedded walkthrough videos.
- Share the Learner Links PDF with students via Google Classroom, Teams, or printed copies.
- Note: micro:bit must be calibrated before the magnetometer works. The board will display "TILT TO FILL SCREEN" โ students tilt it to fill all 25 LEDs.
Learning Objectives
- Use the micro:bit magnetometer to detect direction and magnetic fields
- Apply if/else logic to compass heading ranges
- Build a working compass and magnetic field detector
Materials
- micro:bit + USB cable per student/pair
- Small magnets (optional, for magnet detector testing)
- Teacher PPT displayed on projector
- Learner Links distributed to students
Key Vocabulary
if (compass heading < 45 or compass heading > 315) โ show string "N"
else if (compass heading < 135) โ show string "E"
else if (compass heading < 225) โ show string "S"
else โ show string "W"
if (magnetic force ยตT > 100) โ show icon [target]
else โ show icon โ
}
๐ฏ Differentiation
- Grade 5: Part 1 only โ display heading as a number first, then add N/S/E/W text.
- Grade 8: Add arrow LED patterns pointing in each compass direction. Research: magnetic north vs. true north.
โ Assessment
Working compass on hardware โ demonstrated to instructor. Check: correct heading ranges in if/else, calibration completed successfully.
Learning Objectives
- Use AND, OR, NOT logic operators in micro:bit programs
- Design program logic using a flowchart before coding
- Build a multi-condition program
Materials
- micro:bit + USB cable per student
- Printed Flowchart Worksheet (link above)
- Teacher PPT on projector
- Learner Links distributed to students
Key Vocabulary
if (button A pressed AND button B pressed) โ show icon [target]
// OR โ at least one must be true:
if (button A pressed OR button B pressed) โ show icon โค๏ธ
// NOT โ flips true โ false:
if (NOT button A pressed) โ show string "idle"
๐ฏ Differentiation
- Grade 5: Simple flowchart with 1 condition. Focus on AND vs. OR distinction.
- Grade 8: Nested logic + truth tables. Research: how AND/OR gates work in hardware.
โ Assessment
Collect flowchart worksheets. Check: valid decision structure, at least 1 compound condition. Does coded program match the flowchart?
โ ๏ธ Before Class
- micro:bit V2 has a built-in speaker โ no extra hardware needed.
- micro:bit V1: students need alligator clip cables + headphones or a small speaker connected to Pin 0 and GND. Prepare these in advance.
- Pre-program one micro:bit with a short melody as the class hook.
Learning Objectives
- Use Music blocks to play notes, melodies, and rhythms
- Understand musical concepts as programming constructs
- Create an interactive instrument using sensor input
Materials
- micro:bit V2 (preferred) or V1 + alligator clips + speaker
- Printed Melody Worksheet
- Teacher PPT on projector
Key Vocabulary
rest for [1/2 beat] // silence
set tempo to [120] bpm // speed of all beats
- Button A โ one note or chord
- Button B โ another note or chord
- A+B โ short melody
- Grade 7โ8 extension (Theremin):
forever โ play tone mapped from [acceleration x] (-1023 to 1023) โ (131 to 1047 Hz)โ tilt controls pitch!
๐ฏ Differentiation
- Grade 5: Melody worksheet only (8 notes). Button A = play, Button B = stop.
- Grade 8: Build a theremin using the accelerometer. Layer a background beat loop.
โ Assessment
Collect melody worksheets. Does the coded melody match the written plan? Does the instrument respond correctly to input?
โ ๏ธ Before Class โ Critical
- All micro:bits MUST use the same radio group (e.g., group 1). Include "radio set group 1" in "on start" for every program today.
- Students need 2+ micro:bits per pair. Confirm you have enough hardware for pairs.
Learning Objectives
- Use radio blocks to send and receive strings and numbers
- Understand radio groups/channels
- Build a two-way communicator and a class voting system
Materials
- 2+ micro:bits per pair of students
- USB cables + computers
- L4 and L5 PPTs on projector
- Learner Links distributed
Key Vocabulary
on start โ radio set group [1]
on button A pressed โ radio send string "Hello!"
// RECEIVER (new project, same group):
on start โ radio set group [1]
on radio received [receivedString] โ show string [receivedString]
- Button A โ send their name
- Button B โ send a number (score, age, etc.)
- On received string โ show it
- On received number โ show it
๐ฏ Differentiation
- Grade 5: Two-way name exchanger only. Instructor runs the vote counter.
- Grade 8: Build the complete vote counter. Use "radio send value" with named columns.
โ Assessment
Working two-way communication demonstrated to instructor. Check: same group number, send and receive both function, strings and numbers handled correctly.
Learning Objectives
- Use Game blocks to create sprite-based games
- Program player movement, enemy movement, and collision detection
- Design a playable game on a 5ร5 LED screen
Materials
- micro:bit + USB cable per student
- Teacher PPT on projector
- Learner Links distributed
Key Vocabulary
sprite change x by 1 // move right
sprite change y by -1 // move up
sprite is touching [enemy] // boolean for collision
game score change by 1 // add 1 point
game over // end screen with score
- Player sprite at bottom, moves left/right with buttons or tilt
- Enemy sprite starts at top, moves down with a forever loop + 800ms pause
- Collision check: if player touches enemy โ game over
- Score: game score +1 each time the enemy passes the bottom and resets
- Enemy reset: when y=4 โ set to y=0, random x position
๐ฏ Differentiation
- Grade 5: Player + enemy only. Skip scoring. Focus on collision detection.
- Grade 8: Add difficulty scaling (enemy speeds up every 10 points). High score saved via radio.
โ Assessment
Playable game on hardware. Check: player control, enemy movement, collision detection working, score increments correctly.
Learning Objectives
- Understand what data is and how sensors collect it
- Use the micro:bit Data Logger to record sensor data
- Analyze a .csv data file and draw conclusions
Materials
- micro:bit V2 preferred (built-in data logger)
- L1 Worksheet printed for each student
- L1 and L2 PPTs on projector
- Spreadsheet software (Google Sheets or Excel) for data analysis
Key Vocabulary
on button A pressed {
log data column "temperature" value [temperature ยฐC]
log data column "light" value [light level 0-255]
show icon [checkmark]
}
๐ฏ Differentiation
- Grade 5: L1 worksheet + temperature logging only. Open the data file as a class.
- Grade 8: Log multiple columns, export to Google Sheets, create a chart, calculate mean and range.
โ Assessment
Collect L1 worksheets. Observe: Can students log data, retrieve the file, and identify one pattern in their data?
โ ๏ธ Before Class โ Station Setup
- Set up 3 physical stations with printed worksheets and learner links at each.
- Pre-load Station 1 and 2 micro:bits with the relevant programs if possible.
- Station 3 is paper-based only โ no micro:bit needed.
- Download and play the L4 sound file from a speaker at Station 2.
- Incandescent: 60W
- CFL: 14W
- LED: 8W
Preview: "You've now used every major micro:bit feature. Next 2 classes: design and build your own Smart Device."
๐ฏ Differentiation
- Grade 5: Complete all 3 stations at the simplified level โ observe and record only.
- Grade 8: At Station 3, calculate the school's annual carbon footprint difference and write a one-paragraph sustainability proposal.
โ Assessment
Collect L4 and L5 worksheets. Observe Station 1 and 2 data: Are readings plausible? Can students explain what the data represents?
๐ Project Requirements โ Every Project Must Include:
- Random delay signal before button prompt
- Measures response speed
- Tracks and displays scores
- Counts steps using accelerometer
- Displays step totals
- Button to reset count
- Detects movement via accelerometer
- Sounds alert when triggered
- Arm/disarm with buttons
- Tracks happiness/hunger with variables
- Responds to button presses
- Displays emotions on LED screen
- Displays current temperature
- Alerts when threshold exceeded
- LED status indicator
- Pitch to instructor for approval
- Must meet all 6 requirements
- Feasible within 1 class period
- Button input โ L2
- Variable โ L3
- If/else โ L3 & L5
- Loop โ L3
- Sensor โ L4, L6, L9, L10
- Device Name
- Purpose: What problem does it solve or service does it provide?
- Target User: Who is this designed for?
- Inputs: Which buttons and sensors will be used?
- Outputs: What do the LEDs and/or speaker show/play?
- Flowchart: Sketch the main program flow
๐ฏ Differentiation
- Grade 5: Choose one of the 5 preset ideas. Instructor helps complete the design brief. Focus on core sensor + if/else.
- Grade 8: Original project required. Flowchart must include 3+ decision points. Add a "feature stretch goal" to the brief.
โ Assessment
Collect design brief sheets. Check: all 6 required elements planned, purpose is clear and achievable, flowchart is logically valid.
Learning Objectives
- Complete and debug the Smart Device project
- Present the device clearly covering purpose, sensors, code logic, and challenges
- Give and receive constructive feedback
Materials
- micro:bit + USB cable per student
- MakeCode editor
- Optional: battery packs for untethered demos
- Optional: completion certificates
โ Pre-Presentation Checklist
- At least 1 button input is used
- At least 1 variable is created and changes during use
- At least 1 if/else conditional is working correctly
- At least 1 loop is running (forever or repeat)
- At least 1 sensor is actively read
- The device has a clear, working purpose
- Variable names are descriptive (not "item", "item2")
0:10โ0:17 โ Add polish: visual feedback, sound effects, display messages, smooth animations
0:17โ0:22 โ STOP coding. Prepare the 90-second presentation.
Instructor circulates with the checklist above. Key coaching: "Does it do what you designed it to do? Is every required element present and working?"
- What does the device do?
- Which sensors and inputs were used?
- How does the program work? (Walk through the key blocks)
- What challenge did you overcome during development?
- "One thing I liked: ___"
- "One question I have: ___"
- "One thing I would add: ___"
Hand out completion certificates.
๐ฏ Differentiation
- Grade 5: 60-second presentation. Focus on what it does and which sensor was used.
- Grade 8: Full 90-second presentation. Write a 3-sentence reflection: what would you do differently with more time?
โ Assessment
Working device meets all 6 requirements. Presentation covers all 4 points. Collect design brief from L11 alongside the device. Grade 8: collect written reflection.