1

Level 1: Hit Detector

about $25 (one micro:bit V2) 路 30 minutes

The micro:bit's LED screen can also sense light. Shine a flashlight on it and it counts a hit, just like the mosquito in the MS-2000.

  1. 1Open makecode.microbit.org and start a new project.It is free and runs in the web browser.
  2. 2Find your threshold first.Make a tiny program: forever, show number (light level). Write down the number in room light, then with the flashlight right on the micro:bit. Pick a number between them.
  3. 3Click the JavaScript tab and paste the code below.Change 150 to your threshold. Click Blocks to see it as blocks.
  4. 4Download it to the micro:bit.Plug in the USB cable and drag the file onto the MICROBIT drive.
  5. 5Shine the flashlight on the LED side.The micro:bit beeps and shows a target. That is a hit.
  6. 6Press B to see your score, A to reset.Now it is a game: can a friend hit it while you move it around?
let hits = 0
input.lightLevel()
basic.pause(1000)

input.onButtonPressed(Button.A, function () {
    hits = 0
    basic.showIcon(IconNames.Yes)
    basic.pause(300)
    basic.clearScreen()
})

input.onButtonPressed(Button.B, function () {
    basic.showNumber(hits)
    basic.pause(1000)
    basic.clearScreen()
})

basic.forever(function () {
    if (input.lightLevel() > 150) {
        hits += 1
        music.playTone(988, music.beat(BeatFraction.Sixteenth))
        basic.showIcon(IconNames.Target)
        basic.pause(300)
        basic.clearScreen()
        basic.pause(400)
    }
})

The first light reading after power-on is always 0, so the code reads it once and waits.

Test it like a scientist
  • Does standing farther away change the light number? Measure at 1, 2, and 3 steps.
  • Does a red, blue, or white light give a bigger number?
  • Can you score more hits in 30 seconds when the micro:bit is still or moving?
2

Level 2: Camera Tracker

about $125 路 A weekend

An AI camera learns a toy, and two servos turn it to keep the toy in the middle of the screen. This is the MS-2000 without the laser.

  1. 1Plug the micro:bit into the expansion board.We use the DFRobot Xia mi board. It has a HuskyLens port and 5 V servo pins.
  2. 2Connect the HuskyLens to the HuskyLens port, the pan servo to P1, and the tilt servo to P2.Tape or rubber band the camera onto the tilt servo, and the tilt servo onto the pan servo.
  3. 3On the HuskyLens, pick Object Tracking. Point it at a toy and hold the learn button.Move the toy closer and farther, and turn it, while it learns. A box appears around it when it knows it.
  4. 4In MakeCode, add the HuskyLens extension.Extensions, then search HuskyLens. It gives blocks for the X and Y of the box.
  5. 5Build the program on the right with blocks.Servos use the "servo write pin" block from Pins.
  6. 6Move the toy slowly. The camera follows.If it turns the wrong way, swap the + and the - for that servo.
The program, in plain words. The middle of the screen is x 160, y 120.
start
pan = 90, tilt = 90
forever
ask the camera for the learned object
if it sees it
if x > 170: pan = pan - 2
if x < 150: pan = pan + 2
if y > 130: tilt = tilt + 2
if y < 110: tilt = tilt - 2
servo P1 to pan, servo P2 to tilt
if 150 < x < 170 and 110 < y < 130: beep, locked on!
3

Level 3: The full MS-2000

about $225 plus batteries and craft supplies 路 About 6 weeks of weekends

Add a safe laser, a mosquito that feels every hit, a wand that saves the data, sound effects, and a 3D printed body. Everything Addie uses is here.

1
Buy the parts
Every part, two stores, with a backup for each.
2
Print the body
12 parts on five plates, about 11 hours of printing.
3
Look at it in 3D first
Spin it, tap a part, pull it apart.
4
Build and code it
Sixteen steps with wiring maps and all seven MakeCode programs.
5
Learn how it works
Eleven short lessons with things to try.

Science fair questions you can test

Any level can answer a real question. Change one thing, count what happens, five runs each.

Does a faster target get hit less?
One of the MS-2000 tests. Swing the target from different heights.
Does the camera learn better from more angles?
Teach it from 1 side, then 4 sides. Count how often it loses the target.
Does the background color matter?
Try a black, white, and busy backdrop.
Does target size matter?
Small, medium, and large targets. Time to first lock-on.
Does target color matter?
Same toy in three colors, or colored paper covers.
Do weak batteries make it miss more?
Fresh batteries against used ones. Count hits.

For grown-ups

Laser class
Use only a laser labeled Class 2 (under 1 mW) from a known maker. Cheap laser pointers are often stronger than their label. Most school fairs do not allow anything above Class 3R; ask your fair first.
Never at eyes
Mount the laser so it only points at the backdrop. The MS-2000 has an arm switch a grown-up controls.
Soldering
The sensor and LED wires need soldering. A grown-up does it or supervises closely.
School rules
Many fairs want the student to do the writing and a handwritten journal. These pages give the plan; the words should be the kid鈥檚.
Free to use
Plans, print files, and code here are free for personal and school projects.