Arduino Project Hub

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.

  • 464 views
  • 1 comment
  • 6 respects

Components and supplies

About this project

Game Table, created based on all your favorite games - Pinball. Created on the Arduino. The cheapest and easily manufactured board game.

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

I glued the body of the game table.

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). Body Length received 50 cm.

Invisible player hardware component.

Design and painting most of the board.

Production of some of the details on the 3D printer .

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

Take a look at Circuit Schematic

Wiring

The sensors

Testing the gaming table

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

Home Automation Control Panel

Project in progress by Jay

  • 10,726 views
  • 5 comments
  • 52 respects

AmazonKitchen DRS

Project in progress by Tanner Stinson

  • 1,427 views
  • 4 comments
  • 14 respects

Tertiarm - 3d Printed Robot Arm

Project tutorial by Karagad

  • 4,367 views
  • 0 comments
  • 7 respects

Arduino-Controlled Game: Pong-Bot Vs Human

Project showcase by user875241880

  • 2,677 views
  • 2 comments
  • 5 respects

Hot Cocoa 3000

Project tutorial by Team The Three Engineers

  • 827 views
  • 0 comments
  • 4 respects

Dash Button Santa with Arduino MKR1000

by Team Programarfacil

  • 434 views
  • 0 comments
  • 4 respects
Add projectSign up / Login