กลับไปหน้ารวมไฟล์
automated-beer-pong-game-moving-cups-755ba5-en.md

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!

Concept, Build, and Demonstration Video

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) until digitalRead(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.

  1. The project requires the incredible <AccelStepper.h> library driving an A4988 Stepper Module and a physical NEMA 17 Stepper Motor.
  2. The massive integer is absolute mechanical smooth acceleration! stepper.setAcceleration(200); stepper.setMaxSpeed(400);
  3. 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!

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x Arduino IDE"
author: "typalowski"
category: "Gaming & Entertainment"
components:
  - "1x Rotary Encoder with Push-Button"
  - "1x Stepper Motor, Mini Step"
  - "1x Limit Switch, 5 A"
  - "1x Arduino Nano R3"
  - "1x OLED Display, Blue on Black"
description: "Erratic kinematic automation! Force precise stepper mechanics into chaotic, wildly randomized horizontal sweeping motions carrying physical fluid-filled targets, actively evading projectiles through continuous non-repeating algorithm structures."
difficulty: "Intermediate"
documentationLinks: []
downloadableFiles: []
encryptedPayload: "U2FsdGVkX19+rpvypnZ+oPJweNLplE4CZ45EaoHyg2CsZ/F1XVqw2V8pOT6zrsNxAjQF5fbWvmuwJK0K6BmqYrWdbRiRgDniVt8XOy5fy/E="
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/automated-beer-pong-game-moving-cups-755ba5_cover.jpg"
lang: "en"
likes: 6
passwordHash: "2e35964e94e7196a7f472950bc4a3f7a9eb5406137b6d18ec385903babe1cd57"
price: 2450
seoDescription: "Upgrade your Beer Pong with Arduino! Build an Automated Beer Pong Game with moving cups to increase the challenge and fun."
tags:
  - "home automation"
  - "food and drinks"
title: "Automated Beer Pong Game - Moving Cups!"
tools: []
videoLinks:
  - "https://www.youtube.com/embed/RzPBX09sT4Y"
views: 8086