PinBall Table on Arduino © CERN-OHL

Game table created based on our favorite game - Pinball - on the Arduino; the cheapest and most easily manufactured board game.

  • 2,643 views
  • 3 comments
  • 10 respects

Components and supplies

About this project

Step 1

The first thing I made was the wooden housing. Then I decorate the body.

I glued the body of the game table.

Step 2

After that, it was necessary to strengthen the housing wall qualitatively. I used glue, nails and screws.

This action can be done either now or later, but I did it at first. I glued down the right side. I measured the height - it was 13 cm, and the lowest part body - 11 cm. The higher the slope, the more difficult you will run the iron (or another material ball). The body length received 50 cm.

Step 3

Opening holes on the upper platform. I have made but not yet connected the first actuator.

The Circuit

Wiring

The sensors

Schematics

Circuit Schematic
1 b9se9wfk0c

Code

main gameArduino
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C myDisplay(0x27,16,2);

#define greenLED 2
#define yellowLED 3
#define redLED 4
#define sensor1 8
#define sensor2 9
#define sensor3 10
#define sensor4 11
#define sensor5 12
#define sensor6 13

void setup() 
{
  myDisplay.init();
  myDisplay.backlight();
  myDisplay.print("PLAY!");
  delay(2000);
  myDisplay.setCursor(0,0);
  myDisplay.print("        ");
  myDisplay.setCursor(6,0);
  myDisplay.print("GO GO GO");
  delay(2000);
  myDisplay.setCursor(0,0);
  myDisplay.print("        ");
  
  Serial.begin(9600);
  pinMode(sensor1, INPUT);
  pinMode(sensor2, INPUT);
  pinMode(sensor3, INPUT);
  pinMode(sensor4, INPUT);
  pinMode(sensor5, INPUT);
  pinMode(sensor6, INPUT);
  pinMode(greenLED, OUTPUT);
  pinMode(yellowLED, OUTPUT);
  pinMode(redLED, OUTPUT);
 
  digitalWrite(greenLED, LOW);
  digitalWrite(yellowLED, LOW);
  digitalWrite(redLED, LOW);
  
}


int i=0;
void loop() {
  if (digitalRead(sensor1)==HIGH){
    i=i+20;
    myDisplay.clear();
    myDisplay.setCursor(5,0);
    myDisplay.print("+20!");
    digitalWrite(greenLED, HIGH);
    delay(2000);
    digitalWrite(greenLED, LOW);
    myDisplay.clear();
  }
  
  if (digitalRead(sensor2)==HIGH){
    i=i+50; 
    myDisplay.clear();
    myDisplay.setCursor(5,0);
    myDisplay.print("+50!");   
    digitalWrite(greenLED, HIGH);  
    digitalWrite(yellowLED, HIGH);
    delay(2000);
    digitalWrite(greenLED, LOW);
    digitalWrite(yellowLED, LOW);
    myDisplay.clear();
  }
  
  if (digitalRead(sensor3)==HIGH){
    i=i+100;                       
    myDisplay.clear();
    myDisplay.setCursor(5,0);
    myDisplay.print("+100!");       
    digitalWrite(greenLED, HIGH);   
    digitalWrite(yellowLED, HIGH);
    digitalWrite(redLED, HIGH);
    delay(2000);
    digitalWrite(greenLED, LOW);
    digitalWrite(yellowLED, LOW);
    digitalWrite(redLED, LOW);
    myDisplay.clear();
  }
  
  if (digitalRead(sensor4)==HIGH){
    i=i+20;                        
    myDisplay.clear();
    myDisplay.setCursor(5,0);
    myDisplay.print("+20!");       
    digitalWrite(greenLED, HIGH); 
    delay(2000);
    digitalWrite(greenLED, LOW);
    myDisplay.clear();
  }
 
  if (digitalRead(sensor5)==HIGH){
    i=i+50;                        
    myDisplay.clear();
    myDisplay.setCursor(5,0);
    myDisplay.print("+50!");      
    digitalWrite(greenLED, HIGH); 
    digitalWrite(yellowLED, HIGH);
    delay(2000);
    digitalWrite(greenLED, LOW);
    digitalWrite(yellowLED, LOW);
    myDisplay.clear();
  }
 
  if (digitalRead(sensor6)==HIGH){
    i=i+100;                       
    myDisplay.clear();
    myDisplay.setCursor(5,0);
    myDisplay.print("+100!");     
    digitalWrite(greenLED, HIGH); 
    digitalWrite(yellowLED, HIGH);
    digitalWrite(redLED, HIGH);
    delay(2000);
    digitalWrite(greenLED, LOW);
    digitalWrite(yellowLED, LOW);
    digitalWrite(redLED, LOW);
    myDisplay.clear();
  }
  
  if (i>=500){
    myDisplay.clear();
    myDisplay.setCursor(4,0);
    myDisplay.print("YOU WIN!");
    for (int j=0; j<=15; j=j+1){   
      digitalWrite(greenLED, HIGH);
      digitalWrite(yellowLED, HIGH);
      digitalWrite(redLED, HIGH);
      delay(100);
      digitalWrite(greenLED, LOW);
      digitalWrite(yellowLED, LOW);
      digitalWrite(redLED, LOW);
      delay(100);
    }
    i=0;                           
    myDisplay.clear();
    myDisplay.setCursor(0,0);
    myDisplay.print("New Game");    
    delay(2000);
    myDisplay.setCursor(0,0);
    myDisplay.print("        ");
    myDisplay.setCursor(6,0);
    myDisplay.print("GO!");
    delay(2000);
    myDisplay.setCursor(0,0);
    myDisplay.print("        ");
  }
  
  myDisplay.setCursor(0,0);        
  myDisplay.print("Your Score:");
  myDisplay.setCursor(0,1);
  myDisplay.print(i,DEC);  
}
  
    
for servoArduino
#include <Servo.h>

#define servopin 5
Servo myservo; 

void setup()
{
  myservo.attach(servopin);
  myservo.write(90);
  
}


void loop() {
  myservo.write(160);
  delay(1000);
  myservo.write(30);
  delay(1000);
  }

Comments

Similar projects you might like

Mall Assistant Robot

Project showcase by 3 developers

  • 328 views
  • 0 comments
  • 6 respects

BrainForce

Project tutorial by Daniel Rossi

  • 659 views
  • 2 comments
  • 6 respects

Crazy Engineer’s Drawing Robot Arduino GRBL CoreXY Drawbot

Project tutorial by Arnab Kumar Das

  • 4,376 views
  • 4 comments
  • 29 respects

Propeller Display

Project showcase by Team Astro

  • 1,078 views
  • 2 comments
  • 10 respects

Theragym

Project showcase by Team Theragym

  • 64 views
  • 0 comments
  • 1 respect

Make an Autonomous "Follow Me" Cooler

Project tutorial by Hacker House

  • 19,234 views
  • 28 comments
  • 132 respects
Add projectSign up / Login