Introduction: Arduino Beer Pong Arcade

We are going to be making a flashy beer pong table.   The table lights up as cups are eliminated and old style arcade sounds are played.

This games elevates the subtle art of BEER PONG to a new level.  A sporting level.  A competitive, exciting, potentially sober (but hopefully not), future olympic sport!

This instructable only shows how to make half a table, but to complete the game and make ot 2 sided, just repeat all the steps and attach the two sides.

Here's what you'll need-

- 1000x800 sheet of ply
- 6 x Pint Cups
- White + Coloured Paint
- Old beer cask or keg for style points
- Some scrap wood / box / bricks for base

- Arduino board
- Bread Board
- 6 x LEDs
- 6 x Piezo sensors
- loads of wire
- Basic Soldering skills

-  Patience.....

-  More Patience


Optional
---------
- LOADS OF BEERS AND MATES AND GOOD INTENTIONS

Step 1: Making the Table

Get a sheet of whaever wood is lying around, MDF / Ply, whatever it's going to be painted so dont worry too much about it.

Cut the sheet to 1000mm x 800mm.

Decide out where you want your cups to sit, by drawing a triangle and deviding the triangle into 4 even triangles (like the TRIFORCE).

The corners of each traingle show the centre points of your cups.

Drill a 10mm hole through the table at each centrepoint.

Paint all surfaces white and give it time to dry.


Step 2: Map Out the Table Pattern

run tape around the outside of the table, and one strip dividing the top surface in half.  Like the pattern on a PingPong table.

Slap on a colour of your choice to complete the pong styling.

We chose to go for grey as  our design is intended for use by the carling company.

Let it dry.

Step 3: Build the Table.

Get your empty beer cask and fix it to the base of the table with screws / tape / glue/ whatever you want just get it stable.

Decide how high you want your table to be and add whatever size box to the base you require.

we set our table about 850mm high.

Step 4: Arduino Time

Drill 10mm holes through the centre bases of all cups.

Fix a bread board and arduino board to the underside of the table with glue / tape.

Get your 6 sensors and your 6 LEDs and attach them to the base of your cups.

Run the wires through the holes you drilled in the table and attach them at the appropriate place on the breadboard.

-----------------------------------------------------------

THINGS GET A BIT MESSY AT THIS POINT

Just deal with one loop at a time, one sensor, one LED, get this working then deal with the next.

----------------------------------------------------------

Step 5: Arduino Code

bang this into your arduino and upload.  You will need to have a play with monitoring each sensor, and adjusting their sensitivity individually.

-----------
const int ledPin1 = 13;      // led connected to digital pin 1
const int ledPin2 = 12;
const int ledPin3 = 11;
const int ledPin4 = 10;
const int ledPin5 = 9;
const int ledPin6 = 8;
const int knockSensor1 = A0; // the piezo is connected to analog pin 0
const int knockSensor2 = A1;
const int knockSensor3 = A2;
const int knockSensor4 = A3;
const int knockSensor5 = A4;
const int knockSensor6 = A5;
const int threshold =  500;  // threshold value to decide when the detected sound is a knock or not


// these variables will change:
int sensorReading1 = 0;
int sensorReading2 = 0;
int sensorReading3 = 0;
int sensorReading4 = 0;
int sensorReading5 = 0;
int sensorReading6 = 0;// variable to store the value read from the sensor pin
int ledState = LOW;         // variable used to store the last LED status, to toggle the light
int lastReading1 = 0;
int lastReading2 = 0;
int lastReading3 = 0;
int lastReading4 = 0;
int lastReading5 = 0;
int lastReading6 = 0;

void setup() {
pinMode(ledPin1, OUTPUT); // declare the ledPin as as OUTPUT
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
pinMode(ledPin4, OUTPUT);
pinMode(ledPin5, OUTPUT);
pinMode(ledPin6, OUTPUT);// declare the ledPin as as OUTPUT
Serial.begin(9600);       // use the serial port
digitalWrite(ledPin1, LOW);
digitalWrite(ledPin2, LOW);
digitalWrite(ledPin3, LOW);
digitalWrite(ledPin4, LOW);
digitalWrite(ledPin5, LOW);
digitalWrite(ledPin6, LOW);
lastReading1 = analogRead(knockSensor1);
lastReading2 = analogRead(knockSensor2);
lastReading3 = analogRead(knockSensor3);
lastReading4 = analogRead(knockSensor4);
lastReading5 = analogRead(knockSensor5);
lastReading6 = analogRead(knockSensor6);
}
void loop() {
  // read the sensor and store it in the variable sensorReading:
  sensorReading1 = analogRead(knockSensor1);
   sensorReading2 = analogRead(knockSensor2);
   sensorReading3 = analogRead(knockSensor3);
   sensorReading4 = analogRead(knockSensor4);
   sensorReading5 = analogRead(knockSensor5);
   sensorReading6 = analogRead(knockSensor6);
  Serial.println(sensorReading4); 
  Serial.println(lastReading4);
  // if the sensor reading is greater than the threshold:
  if (sensorReading1-40 > lastReading1){       
     lastReading1 = sensorReading1;
  delay(50);
    digitalWrite(ledPin1, HIGH);
  }       
  if (sensorReading2-100 > lastReading2){
     lastReading2 = sensorReading2;
  delay(50);
    digitalWrite(ledPin2, HIGH);
  }
  if (sensorReading3-50 > lastReading3){
     lastReading2 = sensorReading2;
  delay(50);
    digitalWrite(ledPin3, HIGH);
  }
  if (sensorReading4-50 > lastReading4){
     lastReading4 = sensorReading4;
  delay(50);
    digitalWrite(ledPin4, HIGH);
  }
  if (sensorReading5-78 > lastReading5){
     lastReading5 = sensorReading5;
  delay(50);
    digitalWrite(ledPin5, HIGH);
  }
  if (sensorReading6-50 > lastReading6){
     lastReading6 = sensorReading6;
  delay(50);
    digitalWrite(ledPin6, HIGH);

  }
}

Step 6: VOILA - Time to Play.

et Voila.  Build a few and start a league?  Go on a national tour? Get steamin as usual but with MORE LIGHTS?

either pat yourself on the back.  Show off to your mates.  You've done it.  Ruddy good job chap.