After seeing a few extremely difficult projects involving automating games, I thought I'd try to make an easier and unobtrusive version using Arduino and tools on hand!
The device uses a stepper motor, motor driver, limit switch, rotary encoder, and OLED display. This transforms a static party game into a violently unpredictable, moving physical arcade machine!
When turning on, the cups run through a homing sequence to find the limits of the AL2020 rail it slides on. This solves a critical "Homing" problem. If the Arduino loses power mid-game, it completely forgets where the mathematical Step 0 is. When it reboots, it might think it's in the middle, try to drive left, hit the physical wall, and cause mechanical damage.
- The Limit Switch Execution: Mechanical Microswitches are installed exactly at the left edge of the rail.
- When the Uno turns on, it runs a
Homing Sequence. - It blindly forces the stepper left at an incredibly slow, safe speed (
Speed = 50) untildigitalRead(LimitSwitch) == LOW. - The instant the switch clicks, the Uno halts the engine:
stepper.setCurrentPosition(0);(Flawless zero-point calibration achieved!)
Afterwards, you are able to select your difficulty 1 - 10 and start the motor through the menu displayed on the OLED screen. The Arduino does not execute a pattern; it actively generates completely random velocity and distance integers on the fly.
The NEMA Randomization Matrix (AccelStepper.h)
You cannot use a cheap $2 DC motor. It will slam the massive heavy wooden platform into the edges and shatter the entire rail system instantly.
- The project requires the incredible
<AccelStepper.h>library driving anA4988Stepper Module and a physicalNEMA 17 Stepper Motor. - The massive integer is absolute mechanical smooth acceleration!
stepper.setAcceleration(200); stepper.setMaxSpeed(400); - The Software Execution: The
loop()holds a massive randomizer engine.
if (stepper.distanceToGo() == 0) { // The platform just arrived at its destination!
// Instantly generate a completely new, unpredictable destination position!
// The rail is exactly 3000 steps wide!
long nextRandomPosition = random(0, 3000);
// Instantly generate a new, completely erratic speed!
long nextRandomSpeed = random(100, 600);
stepper.setMaxSpeed(nextRandomSpeed); // Violently alter the velocity profile!
stepper.moveTo(nextRandomPosition); // Fire the new engine dynamics!
}
stepper.run(); // Absolutely critical non-blocking hardware pusher!
Moving Platform Construction Requires
- Arduino Uno/Nano (Standard execution speeds).
- A4988 or TMC2208 Stepper Driver (TMC2208 is massively requested because it physically deletes the horrific high-pitched screaming noise steppers usually make!).
- NEMA 17 Stepper Motor (Driven by a massive 12V 2-Amp external brick).
- Complete Linear Rail and Timing Belt mechanical assembly (Often sourced directly from standard commercial 3D printer frame parts!).
- Standard Mechanical End-Stop Microswitch.
The table is made from a sheet of 3/4" plywood and some 2"x2" used as legs. It also uses 1/4" thick acrylic at the ends to show the mechanism below the table, while keeping the entire top of the table flush and flat. Thus, you can use the table as a normal beerpong table, or as the automated version if supplied with power!