Hardware / Complete

Ping-Pong Ball Launcher

Viewers spend channel points to launch a ball at me

Video placeholder Clip — a redemption launching a ball at the streamer

TL;DR

Redeem channel points and a real launcher fires a ping-pong ball at me. It's an ESP32 driving a relay and motor, triggered by MBC over a local HTTP endpoint.

From Redemption to Launch

  1. Redeem

    A viewer redeems the launcher reward on Twitch.

  2. Queue

    MBC adds the shot to the launcher queue.

  3. Trigger

    MBC calls triggerPingPongLauncher, which POSTs to the ESP32's local endpoint.

  4. Launch

    The ESP32 closes the relay and runs the motor for about 2.3 seconds, then the next queued shot can fire.

Problems & Solutions

  1. 01

    Overlapping redemptions

    ProblemIf several viewers redeemed at once, the launcher could receive overlapping motor commands.

    FixA software queue serializes requests. Shots fire one after another, and viewers can still stack up several.

    LessonEvent-driven design doesn't stop at software. Physical devices need the same concurrency control.

  2. 02

    Tuning the motor run

    ProblemThe right motor run time for a single launch had to be found by testing.

    FixAfter trials at longer durations, I tuned the run to about 2300 ms per launch.

The Hardware

Photo placeholder Photo — launcher with ESP32 and relay
Photo placeholder Photo — wiring close-up