Pinball table
A pinball table you wire up: servo flippers, pop bumpers on a kicker coil, standup targets, a drain beam, a plunger and one steel ball.
The playfield is under the glass, with a shooter lane down the right. Wire it up and the ball rolls, closes the switches it hits and breaks the drain's beam on its way out.
Pins
| Pin | What it does |
|---|---|
FL, FR |
The left and right flipper servos' signals. |
VCC, GND |
5 V for the servos and the drain sensor. GND is also every switch's common. |
KICK1, KICK2 |
The pop bumpers' kicker coil, a 12 V solenoid. Drive it from a MOSFET with a diode across it. |
TA TB TC |
Standup targets A, B and C: closed to GND while hit. |
B1, B2 |
The pop bumpers' skirt switches: closed to GND while hit. |
DRAIN |
The drain sensor's output: LOW while the beam gets through, HIGH while the ball is in it. |
LAUNCH |
The plunger's switch: closed to GND while the plunger is pulled. |
Every switch closes to GND, so wire each one to an INPUT_PULLUP pin and it
reads LOW while closed.
How it plays
The table is 26 by 48 cm, tilted four degrees, with an 18 mm ball. Hold the
LAUNCH knob to pull the plunger back (that closes LAUNCH) and let go to send
the ball up the lane, around the arch and into the field.
The flippers are the servo horns themselves. With the Arduino library's pulse
window, the left flipper rests at 150 degrees and is raised at 100, and the
right one rests at 30 and is raised at 80, each swinging 50 degrees. They are
fast digital servos, 1200 degrees a second (flip_speed), so a flip takes
about 40 ms.
The ball bounces off the walls, posts and targets, off the bumpers a little harder, and off a moving flipper with the flipper's own speed. A target or a bumper it hits stays closed for at least 25 ms, long enough for any loop to see. When the kicker coil pulls in, a ball within 12 mm of a bumper is thrown off it. Past the flippers, the ball breaks the drain's beam and rolls back to the plunger a second later.
Every switch can be worked by hand too: hold a target, a bumper or the drain to close it, as you would flick a real one with a finger. The round arrow puts the ball back on the plunger.
What the model gets right
- The flippers are the servo model (pulse window, no motion under 4 V) at a faster speed.
- The coil is the solenoid model, solved in the matrix: 12 V, 40 ohm, 30 mH. Leave out the diode and the MOSFET sees the spike, exactly as on the bench.
- The drain sensor is the photo interrupter model.
- Everything is deterministic: the same flips at the same moments play the same game.
What it does not model
- Spin, slingshots, tilt and more than one ball.
- The coil's pull curve: it kicks at full strength once it pulls in.