Lessons and the learning game

Build a foam dart sentry

A foam dart desk guard built safety first: thermal aim on pan and tilt, a range check, a solenoid trigger with flyback, an arm switch and no-fire zones.

Safety first

Foam darts from a toy launcher only, never anything hard or sharp. Everyone in the room wears eye protection. Never aim at a face, a pet, or anyone who has not agreed to play. The code backs that up (it starts disarmed, holds fire with no range or inside 1 meter, and never fires into the top rows of the camera's view), but you are the first line of safety.

What it teaches

Six lessons in three chapters:

  • Find and aim: an AMG8833's 8 x 8 pixels, 7.5 degrees each, as fixed directions for a pan and tilt pair; a heat threshold over the background, and a limit that ignores a hot mug.
  • Range and trigger: an HC-SR04 range window of 1 to 3 meters with no range no fire, a 12 V solenoid on an IRLZ44N with a 1N4007 flyback diode, a fail-safe arm switch, and a reload time.
  • Safe zones and the guard: a face-height no-fire zone, a lock time, a doorway zone, and the project: a desk guard with a magazine that runs out.

Open it at /learn/path/build-nerf-sentry.

The circuit

Foam dart desk sentry: an AMG8833 on SDA and SCL, fixed on the base; pan and tilt servos on pins 9 and 10; an HC-SR04 on pins 7 (TRIG) and 8 (ECHO); a 12 V solenoid switched by an IRLZ44N from pin 5, with a 1N4007 across the coil; and a slide switch that arms the sentry by pulling pin 4 to ground. It runs sentryguard.

Play the visitor by moving the camera's hot spot (its pixel and temperature), the ultrasonic slider, and the arm switch.

Troubleshooting

  • It never fires: it has to be armed, the range between 100 and 300 cm, the hot spot below the top two rows and outside any doorway zone, and held on one pixel for half a second.
  • "disarm before aiming by hand": slide the arm switch back first.
  • "magazine empty": press Run again to reload.