TAKE a SHOT: Ping Pong Machine

by Take_a_shot in Circuits > Arduino

224 Views, 0 Favorites, 0 Comments

TAKE a SHOT: Ping Pong Machine

Take_A_Shot Useless Machine

The interaction between the users and machines makes the user behave and fill the ball in the tower of Ping Pong. Doing the same behavior does not have a purpose and planned behavior for the “useful” outcomes. However, the infinite loop reminds us of fluidity and repetition, which leads us to find our psychological resonance and attention.


The project idea revolves around creating a machine that through an illusionary veil of fun and playfulness to reduce stress actually distracts the user from productive work. As architect students, coffee - or drinks at least - are common drinks by our side in our work space. Hence, the coffee cup becomes the “trigger” to the activation of the machine. Placing it in the coaster location will activate a mechanism that drops balls sequentially. These balls come down rolling, creating a mess everywhere, making the user pick them up and putting them back into the machine … only for those balls to be dropped again. The secret? It’s addictively fun, this activity of putting back rolling balls. 

Supplies

Electronics: 


  • Arduino Uno
  • Servo Motor SG90 - 1pc
  • Ultrasonic Sensor- 1pc
  • RGB LED - 3 pcs
  • Female-to-Male Dupont Wire -4pcs 
  • Breadboard Jumper Wire - 13pcs
  • Resistors: 1KΩ - 3pcs 


Materials:

  • 30in x 18 in x ⅛ in Baltic Birch Ply - 2pcs
  • Ping pong balls or foam balls -5pcs (could have more but tube holds only 5)
  • Cup 


Tools:

  • Glue 
  • Tape 
  • Laser Cutter

Cut & Assemble

laser cut-01.jpg
Assembled together isometric.jpg
10.png
11.png
12.png

Following the laser cut drawing, plywood boards and servo motors can be cut and assembled to their designated positions.

Wire It Up

Wiring.png

Following the fritz diagram, the wiring can be assembled and located at the bottom compartment.

Time to Code

code.png

Copy Arduino code and upload:


#include <Servo.h>

const int RED = 6; //setting up the pins for the LEDs
const int GREEN = 5;
const int BLUE = 4;

//Distance sensor pins
const int trigPin = 11;
const int echoPin = 12;

// Servo Motor pins and variables related to its function
int angle =0;
const int servoPin = 9;
Servo myservo;


void setup() {
  Serial.begin(9600);
    
  myservo.attach(servoPin);
  myservo.write(0);
  
  pinMode(RED, OUTPUT);
  pinMode(GREEN, OUTPUT);
  pinMode(BLUE, OUTPUT);
  
//Distance
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);

}

void loop() {
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(2);
  digitalWrite(trigPin, LOW);

  long timeDistance = pulseIn(echoPin, HIGH); //measures the time for sound to travel
  long distance = (timeDistance/2) / 29.1; //uses the time to calculate the distance an object is from the distance sensor

//If a cup is detected, the lights will turn blue
  if(distance <= 15){
    digitalWrite(RED, LOW);
    digitalWrite(GREEN, LOW);
    digitalWrite(BLUE, HIGH);
      for (int x = 0; x <= 2; x++) //servo motor starts rotating to move the ball into the position to be dropped, allows the ball to drop, and then rotates the switch back into position
  {
    myservo.write(180);
    delay(1000);     
    myservo.write(80);
    delay(1000);
  }
 }
  else if(distance <= 25){  //if no cup is detected, light turns green and the machine does nothing
    digitalWrite(RED, LOW);
    digitalWrite(GREEN, HIGH);
    digitalWrite(BLUE, LOW);
    myservo.write(90);
    delay(100);
  }
  else{  //de-bugging section; use this code to test distances, delays, etc. in order to change those aforementioned aspects to customize the code according to your preferences
    digitalWrite(RED, HIGH);
    digitalWrite(GREEN, LOW);
    digitalWrite(BLUE, LOW);
    myservo.write(0); //errors are indicated with red lights and rotating the switch piece to outside of the machine                  
  }   
  }



Do No Work

Have fun.png

Distract yourself, for stress-free is the type of life you should live! Stress-free is the new cool; time to show off to your friends!



Conclusion: It Was Hard…and a Fantastic Learning Process

Designing a mechanism that allowed balls to drop one at a time was hard. Initial ideas with opening and closing switches resulted in more than one ball dropping or the switch getting stuck as it tried to close but came in contact with the stack of dropping balls. Instead, we decided to explore the lateral direction as the direction for a switch’s movement. Relying on using the switch to pull a single ball away, through physical prototyping, we arrived at the solution used in the final model.


The creation of the physical model was a difficult process as there is a big gap between an idea and its physical manifestation. We discovered weight to be an extremely important consideration - more important than we thought even after switching to light, foam balls. The weight of balls create static friction, thus making it impossible to move a ball at the bottom of the stack with the servo motor. Through trial and error, we found an optimal solution of 5 balls resting in a tube. 


The physical characteristics of materials also surprised us. We expected baltic birch wood to be stiffer, but when we used it for long spans, the material actually started sinking, creating uneven surfaces, which resulted in even more difficulty in moving the balls. We had to creatively devise support structures to maintain a flat, stable surface for activity to occur on. 


The invention of a “Useless” machine was a challenge to find the intervention between the physical movement to make balls fall on the frames and the mechanical movement of Servo Motor’s rotation. After creating the physical model, we had examined the intersecting times and locations to fall the multiple balls properly. In addition, the weight of balls was also an unexpected input element affecting the rotation. Therefore, we had measured specific types of balls and also found exact heights to fit the balls falling into the frames of intervention. We find that making a physical model is important to simulate the invisible elements and also to find the different two movements of free fall and regular rotation. 


Lastly, for future consideration, considering where the servo motor connects with the piece that allows the ball drop is important. Connecting the servo motor in the corner is not a stable solution; we had to cut more support pieces that supported that piece. Careful consideration (ex. center of mass of pieces) is required to minimize cutting more pieces.