High School / HS-08

Machine Vision Sorting Robot

Available Grades 9–12 Computing & data Robotics & controls

Build a camera-guided servo sorter, classify objects by color or shape, and measure accuracy with a confusion matrix.

Overview & learning outcomes

A webcam looks down at a small tilting tray. Students drop a token in, an IR break beam starts the clock, Python + OpenCV measure the token's shape (circularity, extent) and colour (hue on a circle), a classifier decides, a servo diverter aims a chute at one of four bins, and the tray tips. Then students do what real inspection engineers do: run 45 tokens, build a confusion matrix, compute accuracy with an honest confidence interval, precision and recall, and find out what breaks it (lighting, rotation, thresholds) and how fast it can go.

Students will:

  • Compare RGB and HSV color spaces and choose thresholds from measured data
  • Separate training and test sets and explain why mixing them inflates accuracy
  • Build a confusion matrix and compute precision and recall per class
  • Measure the trade-off between sorting speed and accuracy

Every high school pack includes worked math and physics, prediction-versus-measurement labs, at least two design-and-test iterations, data logging, a rubric, and documentation templates, plus printable Builder's Corner build journal pages.

Bill of materials & where to buy

Parts, specs, quantities, and estimated unit costs, with places to buy. Prices change; anything marked as an estimate is an estimate. Links were checked when the BOM was written.

Estimated kit cost

  • A. Vision and electronics (per station): $129.81 typical · $98.96 low-cost path
  • B. Structure and tokens (per station): $48.50 typical · $31.50 low-cost path
  • C. Tools and safety (once per school or station): $84.09 typical · $15.59 low-cost path
  • Everything from zero: $262.40 typical · $146.05 low-cost path (low-cost path uses listed substitutes and assumes a school or makerspace already owns reusable tools)

Totals are computed from the line items below. Prices were read from vendor pages on the dates shown and will change. Rows tagged estimate have no verified link and are planning numbers only.

A. Vision and electronics (per station)

IDPart & specQtyUnit (typical)Line (typical)Where to buyCheaper substituteAdult handling / safety gear
E1USB webcam, 720p
Logitech C270 HD · 720p/30 fps, 55° diagonal field of view (vendor page); UVC, works with OpenCV on Windows/macOS/Linux
1$29.99$29.99logitech.com
Logitech
$29.99 · checked 2026-10-09 · In stock
Any UVC webcam with manual exposure (re-measure the field of view in Lab 1)—
E2ESP32 Feather V2 (controller)
Adafruit PID 5400 · USB-C
1$19.95$19.95adafruit.com
Adafruit
$19.95 · checked 2026-10-09 · In stock
Adafruit HUZZAH32 Feather (PID 3405); same codeHeader soldering: adult supervision, eye protection, ventilation
E38-Channel PWM/Servo FeatherWing (PCA9685)
Adafruit PID 2928 · I2C 0x40, servo headers, 2-pin power terminal block
1$9.95$9.95adafruit.com
Adafruit
$9.95 · checked 2026-10-09 · In stock
Generic PCA9685 breakout + jumpers (same library)—
E4Stacking headers for Feather
Adafruit PID 2830 · 12- and 16-pin female (Wing stacks on the Feather)
1$1.25$1.25adafruit.com
Adafruit
$1.25 · checked 2026-10-09 · In stock
Plain female headers—
E5Micro servo TowerPro SG92R
Adafruit PID 169 · 2.5 kg·cm, 0.1 s/60° at 4.8 V, 19 cm lead, horns + screws (vendor); one tips the tray, one turns the diverter, one spare
3$5.95$17.85adafruit.com
Adafruit
$5.95 · checked 2026-10-09 · In stock
Any 9 g micro servo (re-measure the body and update SERVO_W/SERVO_D in mv_cut_gen.py)Keep fingers out of the tray pivot while powered
E6IR break-beam sensor pair, 3 mm
Adafruit PID 2167 · emitter + receiver, 20 × 10 × 8 mm housings, 230 mm leads; open-collector output (LOW = broken)
1$2.95$2.95adafruit.com
Adafruit
$2.95 · checked 2026-10-09 · In stock
Skip it and press Enter to trigger each capture (Lab 4 loses the timing data)—
E7NeoPixel Ring, 16 × 5050 RGB
Adafruit PID 1463 · 44.5 mm OD / 31.7 mm ID (vendor); controlled lighting for the camera
1$9.95$9.95adafruit.com
Adafruit
$9.95 · checked 2026-10-09 · In stock
Desk lamp at a fixed position (low total); Lab 3 then compares room vs. lampDo not stare into the ring at full brightness
E85 V 2 A switching power supply (UL listed)
Adafruit PID 276 · 2.1 mm barrel; feeds the servos and ring
1$7.95$7.95adafruit.com
Adafruit
$7.95 · checked 2026-10-09 · In stock
—Use the listed adapter only; no bench supplies above 6 V on the servo terminal
E92.1 mm DC jack to screw terminal
Adafruit PID 368
1$2.00$2.00adafruit.com
Adafruit
$2.00 · checked 2026-10-09 · In stock
——
E10USB-A to USB-C data cable
Adafruit PID 4474
1$4.95$4.95adafruit.com
Adafruit
$4.95 · checked 2026-10-09 · In stock
Classroom cable—
E11Hook-up wire 22 AWG solid (6 × 25 ft)
Adafruit PID 1311 · ring power, beam sensor extensions; one box serves a classroom
1$15.95$15.95adafruit.com
Adafruit
$15.95 · checked 2026-10-09 · In stock
Classroom stock—
E1274AHCT125 quad level shifter, DIP-14 (NeoPixel data 3.3 V -> 5 V)
Texas Instruments SN74AHCT125N · VCC 4.5-5.5 V, V_IH(min) 2.0 V (TI datasheet); powered from 5 V, drives the ring's DIN through a 470 ohm resistor
1$0.87$0.87tme.com
TME
$0.87 (1 pc) · checked 2026-10-09 · 1552 in TME stock
Adafruit PID 1787 ($1.50, out of stock 2026-10-09); any SN74AHCT125N/74AHCT125 in DIP-14 from a distributor (TME ships from Poland: check shipping)—
E13Electrolytic capacitor 1000 µF, 10 V or higher (ring bulk capacitor)
SparkFun COM-08982 · 1000 µF / 25 V; across the ring's 5V and GND pads, stripe (−) to GND
1$0.50$0.50sparkfun.com
SparkFun
$0.50 · checked 2026-10-09 · In stock
Any 1000 µF electrolytic rated 10 V or higherPolarised: stripe (−) to GND; a reversed electrolytic can vent
E14470 Ω ¼ W resistors (pack of 25)
Adafruit PID 2781 · series resistor at the ring's DIN
1$0.75$0.75adafruit.com
Adafruit
$0.75 · checked 2026-10-09 · In stock
Any 300-500 Ω resistor—
E15Half-size solderless breadboard (400 tie points)
Adafruit PID 64 · holds the 74AHCT125, resistor and wiring
1$4.95$4.95adafruit.com
Adafruit
$4.95 · checked 2026-10-09 · In stock
Small protoboard (soldered)—
Subtotal$129.81Low-cost path: $98.96

B. Structure and tokens (per station)

IDPart & specQtyUnit (typical)Line (typical)Where to buyCheaper substituteAdult handling / safety gear
S1Baltic birch plywood 3 mm, 12 × 20 in
Wood Vault, 1/8" Laser/CNC grade variant; 3 sheets (base + mast / towers, tray, diverter / chute, bins, 36 token layers)
3$3.50$10.50woodvault.com
The Wood Vault
$3.50 per sheet (1/8" Laser/CNC grade variant) · checked 2026-10-09 · Not confirmed (variant availability not in page HTML)
Any 3 mm laser plywood (check thickness; slots are 3.2 / 6.2 mm)—
S2Acrylic paint markers, red / yellow / blue (+ white or matte white card)
Colour the 18 tokens (two each of 3 shapes × 3 colours); matte white card for the tray floor
1$12.00 estimate$12.00Craft / office store (no link)
—
Coloured card glued on, or tempera paintVentilate while markers dry
S3M3 × 12 screws, nuts, washers; M2 servo screws; zip ties; rubber feet
Tray pivot (tower B), servo flange screws, sensor ties
1$6.00 estimate$6.00Hardware store (no link)
—
Classroom stock—
S4Wood glue, clear packing tape
Glue-up of doubled mast, bins, chute; tape lowers chute friction
1$5.00 estimate$5.00Hardware / office store (no link)
—
——
S5Laser cutter access or cutting service
3 sheets, ≈ 15 min each (estimate)
1$15.00 estimate$15.00Makerspace / cut service (no link)
—
—Trained adult operator; never leave a running laser
Subtotal$48.50Low-cost path: $31.50

C. Tools and safety (once per school or station)

IDPart & specQtyUnit (typical)Line (typical)Where to buyCheaper substituteAdult handling / safety gear
T1Temperature-controlled soldering iron
Pinecil (Feather and Wing headers)
1$68.50$68.50sparkfun.com
SparkFun
$68.50 · checked 2026-10-09 · Not recorded
Assumed owned in the low totalAdult supervision
T2Lead-free solder 15 g
SparkFun
1$4.95$4.95sparkfun.com
SparkFun
$4.95 (single-unit price) · checked 2026-10-09 · Not recorded
—Wash hands after soldering
T3Safety glasses, ANSI Z87.1 Z87+ (high-impact) (soldering, cutting, servo testing)
3M SecureFit SF201AF · clear anti-fog polycarbonate lens marked Z87+ (ANSI Z87.1 impact-rated; 3M spec table on strobelssupply.com and safetycompany.com, read 2026-10-09)
2$5.32$10.64platt.com
Platt Electric Supply
$5.32 EA · checked 2026-10-09 · 40 in stock (company-wide)
Any glasses marked Z87+ (ANSI Z87.1 high-impact). Not SparkFun SWG-11046: it lists only CE/EN 1836, a sunglass standard, not impact-rated—
T4Laptop with Python 3, numpy, opencv-python, pyserial
Windows, Linux or macOS; one USB port for the camera, one for the Feather
1$0.00 estimate$0.00School (no link)
—
Raspberry Pi 4/5 (not priced)—
Subtotal$84.09Low-cost path: $15.59

The pack is digital files only. Hardware is bought separately.

Standards map

These are standards the pack's activities are mapped to by Laue Labs. They are not a certification or endorsement by any standards body or state.

Activity NGSS Common Core Math
Lab 1 Camera geometry, calibration HS-ETS1-2 (break a problem into smaller, solvable ones); HS-PS4-5 (devices using waves/light to capture information) HSG-SRT.C.8 (right-triangle trig); HSF-LE.A.1 (linear model of µs vs angle)
Lab 2 Shape features HS-ETS1-3 (evaluate solutions against criteria and trade-offs) HSG-GMD.A.1 (area/perimeter formulas); HSG-MG.A.1 (model objects with shapes)
Lab 3 Colour and lighting HS-PS4-3 (light: wave/particle models, colour as spectrum) HSF-TF.A.2 (angles on the unit circle)
Lab 4 Full run, friction, timing HS-PS2-1 (Newton's 2nd law on an incline); HS-ETS1-4 (computer simulation of a system) HSA-CED.A.4 (rearrange formulas: μ_k from t)
Lab 5 Classifier evaluation, report HS-ETS1-3; SEP 4 (analysing and interpreting data), SEP 5 (computational thinking) HSS-IC.B.4 (margin of error from a sample); HSS-IC.B.6 (evaluate reports based on data); HSS-CP.A (conditional probability: precision/recall)

License options

$17 Individual

One student or one household.

You may:

  • Use, print, and modify the files for your own builds and experiments
  • Share photos and videos of your finished project

You may not:

  • Use the pack as curriculum for a class, club, camp, or co-op (see Homeschool / Co-op and Classroom)
  • Redistribute, resell, or publish the pack files
$39 Homeschool / Co-op

One homeschool family, or one co-op group of up to 10 learners with its facilitator(s).

You may:

  • Print guides and lab sheets for the learners in that family or co-op group
  • Use the facilitator notes, rubric, and pacing guide with that group

You may not:

  • Use it for a co-op group larger than 10 learners, or for a school class (see Classroom)
  • Redistribute, resell, or publish the pack files
$59 Classroom

One teacher with up to 30 students in a single class or cohort.

You may:

  • Print or project materials for those students
  • Copy code and cut files to student machines for that class

You may not:

  • Share files with other teachers or schools, or post them publicly
  • Use it as a whole-school or multi-year site license, or for more than 30 students, without contacting us

All licenses: digital files only (hardware not included). Keep Laue Labs attribution on printed handouts. After checkout you get an instant download on the thanks page. License questions, more learners, or site licenses: lance.haney@gmail.com.

Safety & legal notes

  • Pinch points at the servo chute: keep fingers clear while powered.
  • Students should work with adult supervision for tools, soldering, batteries, and anything flagged in the BOM.