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

Ghostbusters Trap Armband

Project showcase by Danielle Gormley

  • 81 views
  • 0 comments
  • 2 respects

Arduino Wireless Weather Station

Project tutorial by Nick Koumaris

  • 7,084 views
  • 2 comments
  • 31 respects

Virtual Arduino Tennis

Project tutorial by Arduino “having11” Guy

  • 556 views
  • 4 comments
  • 4 respects

ADITI: Affordable Diagnostic Thermal Incubator

Project in progress by Team ADITI

  • 15 views
  • 0 comments
  • 0 respects

How to make Arduino based Automatic Door Opening

Project tutorial by vijendra kumar

  • 1,785 views
  • 4 comments
  • 6 respects

3D Projection

by Vicente Arturo Zavala Ortiz

  • 1,339 views
  • 0 comments
  • 4 respects
Add projectSign up / Login