PINBALL minimum requirements

Hi, I have been on the slow road of building my own pinball games for the past few years and am finally ready to take the leap into electronics and score keeping! I am an artist in my day job, but I have been teaching myself about wood working, and physical electronics (mostly LED's and such). In the past few months I have been taking online courses in scripting in C#.

...And I'm finally dipping my toe into boards and micro controllers... It's been a slow process.

I need advice on what hardware to purchase!

SO! For my first electric machine I'm going to try and keep the game design VERY simple. Here is the basic component requirements for the game, and how the basic game scripts will function:

Power switch: Provides power to the board, and to the 'dumb' components like flippers and ambient lights.

Numeric Display: At least 4 digits.

Board: This is where I'm most lost at the moment. I have no experience with boards yet.

New Game Button: When pressed, resets the score to zero, and restores the players 'Health' to 3.

Ball Drain micro switch: Triggered when a ball is lost, reducing the players 'Health' by 1. When the player reaches zero health, the game stops awarding points, and a "Game Over" indicator light comes on.

SCORING

Targets: Simple micro switch targets that when hit provide points (10pts) and when hit have an indicator light that comes on. That indicator light should remain on until reset.

Target Groups: When you hit a target the light comes on and provides points. If the target is a part of a group, the lights will remain on until every target in the group has been hit. When the group has been completed, you get a completion bonus (100pts) and all the targets reset and their lights turn off, and are ready to be hit again.

Ramp switch: whenever a ball successfully goes up the ramp, it triggers this switch and adds a light to a counter track. Once you have hit the ramp 3 times, a Target indicator will activate and light up. If you hit that target, you get a bonus score, and the Ramp indicator lights reset.

===========================================================

So, I need a board that will support:

X6 individual microswitch inputs (at least) that can also be paired with LED lights indicating when they have been activated.

X2 individual switches for a ramp scoring system, with x4 LED indicator lights

X1 switch for ball drain

X1 'New Game' switch.

X1 numeric display, that can keep score.

Game over indicator light.

That's what I feel I need for a bare minimum of game design. As I said I have zero experience in boards or their components so I really have no idea where to start. I'll be reading up on tutorials and documentation online of course but any advice you can give me to save me some time and shoe leather would be most appreciated!

I have a bunch of stretch goals like sound effects, music, and automated ball loading, so If you can recommend a board that does more than what I need above, but I'll have room to grow into later, that would also be appreciated.

If you are interested in seeing my last pin game (which had no electronics at all) I'm attaching a pic.

I will offer that most balls are metal and you do not need switches. only paper clips and wires.

if the ball enters a hole, it will touch some parts, if they are paperclips with wires attached, then you have completed a switch.

scoring is all simple math, and if a target is not lit, a point of any value could be assigned.
if it is lit, then any other value could be assigned.

once you start programming, it will start to make much more sense.

If you have not ever built one of these using a microprocessor, then one of the first important things to learn is how to "debounce" switches. Whether you use paper clips or microswitches, the mechanical contact of the ball can actually be several separate contacts all occurring in a few milliseconds. The processor is fast enough to log all of these as separate events, so that when a ball goes through your exit mechanism, the processor may record it as going through more than once. So one single ball leaving the table may light the "Game Over" light.

I don't know how far along you are with learning code, but here's how you debounce.

  unsigned long later;
  int value;
  int exitPin = 5;                    //pin 5 hooked to exit mechanism, so closing switch asserts high voltage on pin 5


void setup()
{
     later = 0;
    ...
}

 
void loop()
{

     ...                                                 //skipping all code down to the exitPin handler

  value = digitalRead(exitPin);
 
  if((value == HIGH) && later < millis())
  {
      later = millis() + 250;                    //allows 0.25 sec. for ball to clear mechanism

     ...                                                  //scorekeeping, accounting for exiting ball
    
  }

If your code comes back to this conditional in less than 0.25 sec., the processing is skipped, so the multiple bounces that may occur after the first will be ignored.

The 0.25 sec. is just for illustration. It would need fine-tuning based on your hardware.

Thanks guys that's good info. Especially the debounce code, I would not have considered that until it was a problem.

I guess my ultimate question was what board should I buy, and after doing a little more research it seems I should have gotten the Mega Board but the Uno seems is fine to learn on. The Mega will provide me with a lot more pins. I'm looking to have at least 12-15 input switches and those all also have to have individual output indicator lights when they are triggered.

I'm currently looking for a good tutorial on how to hook up an LCD display, and an example code on how to collect integer inputs, and add them up on the scoreboard. pretty sure theres the 'Hello World' tutorial for the LCD. But I havent found a good tutorial yet on score keeping.