Maker Pro
Maker Pro

How to handle many I/O events - like a pinball machine?

How does a pinball machine handle the gazillion sensors and lights and
coils and stuff?

I'm an electronic newbie who's interested in robotics and electronics
now. I have a comp. sci. education (years ago) so programming
challenges are OK but the electronics is slow going. I like to study
some machine until I learn something. CNC router = learning motor
control for example.

I've always wanted to build a pinball machine from scratch. No, not
nearly as complicated as, say, Funhouse but thought it would be an
interesting challenge where I could deal with much electronic theory -
it'll take years of course. One of the things that is immediately
apparent to me is the slew of lights, swtiches, sensors, scoring
targets, and solenoids that must be addressed by the microprocessor(s).
How is this handled? I doubt the microcontroller has 150 discreet
I/O lines with 150 relays, MOSFETS, transistors, switches, whatever -
but does it? Or is there some sort of matrix or something where the
CPU can switch them all with few I/O lines.

Asked another way, how can a BASIC stamp (or whatever) with, say, eight
I/O lines independently control 100 different lights? Or read 100
different switch events? Surely there is some clever way? Can you
point me in the right direction?
 
J

James Beck

Jan 1, 1970
0
How does a pinball machine handle the gazillion sensors and lights and
coils and stuff?

I'm an electronic newbie who's interested in robotics and electronics
now. I have a comp. sci. education (years ago) so programming
challenges are OK but the electronics is slow going. I like to study
some machine until I learn something. CNC router = learning motor
control for example.

I've always wanted to build a pinball machine from scratch. No, not
nearly as complicated as, say, Funhouse but thought it would be an
interesting challenge where I could deal with much electronic theory -
it'll take years of course. One of the things that is immediately
apparent to me is the slew of lights, swtiches, sensors, scoring
targets, and solenoids that must be addressed by the microprocessor(s).
How is this handled? I doubt the microcontroller has 150 discreet
I/O lines with 150 relays, MOSFETS, transistors, switches, whatever -
but does it? Or is there some sort of matrix or something where the
CPU can switch them all with few I/O lines.

Asked another way, how can a BASIC stamp (or whatever) with, say, eight
I/O lines independently control 100 different lights? Or read 100
different switch events? Surely there is some clever way? Can you
point me in the right direction?
Google :
Switch Matrix
Lamp Matrix

Basically all the switches are read in 8 bit lumps and the lamps are
strobed the same way, just at higher current levels.
The coils are driven using latches that are set and reset to turn the
drivers on and off.

Jim
 
How does a pinball machine handle the gazillion sensors and lights and
coils and stuff?

I'm an electronic newbie who's interested in robotics and electronics
now. I have a comp. sci. education (years ago) so programming
challenges are OK but the electronics is slow going. I like to study
some machine until I learn something. CNC router = learning motor
control for example.

Most of it is simple, since pinball machines
are the perfecr machines for what computers
are worst at, audio-visual random events,

Most of the io you'tre talking about is
pretty simple in theory, but a little
difficult to build right. You use
multiple delay lines between the
various lights and bells. That gives
the machine a simulated depth percetion
that really isn't there.
So it's really in principle the same problem
as programming a pinball game to
play over the net.
 
J

jasen

Jan 1, 1970
0
yOn 2006-12-26 said:
How does a pinball machine handle the gazillion sensors and lights and
coils and stuff?

the old ones used hard-wired logic.
I've always wanted to build a pinball machine from scratch. No, not
nearly as complicated as, say, Funhouse but thought it would be an
interesting challenge where I could deal with much electronic theory -
it'll take years of course. One of the things that is immediately
apparent to me is the slew of lights, swtiches, sensors, scoring
targets, and solenoids that must be addressed by the microprocessor(s).

since the ball can only be in one place at a time: some sort of matrix would
work for many of the sensors.

I think many of the bumpers operate autonomously too, if ther ball hits one
it hits back. and signals to the scoring processor.
Asked another way, how can a BASIC stamp (or whatever) with, say, eight
I/O lines independently control 100 different lights? Or read 100
different switch events? Surely there is some clever way? Can you
point me in the right direction?

use a matrix.
 
B

Bob Masta

Jan 1, 1970
0
How does a pinball machine handle the gazillion sensors and lights and
coils and stuff?

I'm an electronic newbie who's interested in robotics and electronics
now. I have a comp. sci. education (years ago) so programming
challenges are OK but the electronics is slow going. I like to study
some machine until I learn something. CNC router = learning motor
control for example.

I've always wanted to build a pinball machine from scratch. No, not
nearly as complicated as, say, Funhouse but thought it would be an
interesting challenge where I could deal with much electronic theory -
it'll take years of course. One of the things that is immediately
apparent to me is the slew of lights, swtiches, sensors, scoring
targets, and solenoids that must be addressed by the microprocessor(s).
How is this handled? I doubt the microcontroller has 150 discreet
I/O lines with 150 relays, MOSFETS, transistors, switches, whatever -
but does it? Or is there some sort of matrix or something where the
CPU can switch them all with few I/O lines.

Asked another way, how can a BASIC stamp (or whatever) with, say, eight
I/O lines independently control 100 different lights? Or read 100
different switch events? Surely there is some clever way? Can you
point me in the right direction?

One easy way to add more I/O lines is via multiplexing.
You can do this with two ports, one to select the target
(or source) and the other to read or send the data.
For example, if the "selector" output uses only 4 active
bits, it can output one of 16 values, which go to a 1-16-line
multiplexer chip to enable only 1 of 16 octal latches. Then the
data (8 bits) is written to the other (output) port, and it goes only
to the selected latch. So this way you can control 16 * 8 output
lines. And of course, since the control output actually has 256
states you could ultimately control 256 * 8 lines. Inputs work
in a similar manner.

Best regards,



Bob Masta
dqatechATdaqartaDOTcom

D A Q A R T A
Data AcQuisition And Real-Time Analysis
www.daqarta.com
Home of DaqGen, the FREEWARE signal generator
 
A

Arlet

Jan 1, 1970
0
John said:
---
The way I'd do it would be to use a couple of shift register chains.

For the input side I'd use parallel-in serial out devices, and for
the output side I'd use serial-in parallel out devices. this would
allow you to read and control many more sensors and actuators than
you'd care to put in the machine, at a cost of 5 I/Os.

Would you like a schematic?

You'd have to watch the speed requirements for the inputs. A fast
moving ball hitting a switch may only produce a brief pulse. Depending
on the shift register speed, and the number of bits, the overhead for
the controller may be considerable. You could of course add an RC
filter to lengthen the pulse at the cost of some extra components.

At high serial clock speeds, you'd also need to watch the length and
type of cable. I'd recommend plenty of ground wires (one for each
signal), and proper termination.

A matrix type solution would add more wiring, but can be made a bit
faster. Especially if you can select all rows at the same time, and
have the columns hooked up to some interrupt pins. The interrupt would
indicate some switch got hit, and then you can quickly select one row
at a time to identify it.

Instead of simple shift registers, it's also an option to use a number
of small microcontrollers (or PLDs) locally. You can put them next to a
couple of switches that you want to monitor, and have them send a
status at a much lower speed. This adds a bit of complexity, but should
be robust, and requiring similar amounts of wiring as the shift
registers.
 
J

John Fields

Jan 1, 1970
0
How does a pinball machine handle the gazillion sensors and lights and
coils and stuff?

I'm an electronic newbie who's interested in robotics and electronics
now. I have a comp. sci. education (years ago) so programming
challenges are OK but the electronics is slow going. I like to study
some machine until I learn something. CNC router = learning motor
control for example.

I've always wanted to build a pinball machine from scratch. No, not
nearly as complicated as, say, Funhouse but thought it would be an
interesting challenge where I could deal with much electronic theory -
it'll take years of course. One of the things that is immediately
apparent to me is the slew of lights, swtiches, sensors, scoring
targets, and solenoids that must be addressed by the microprocessor(s).
How is this handled? I doubt the microcontroller has 150 discreet
I/O lines with 150 relays, MOSFETS, transistors, switches, whatever -
but does it? Or is there some sort of matrix or something where the
CPU can switch them all with few I/O lines.

Asked another way, how can a BASIC stamp (or whatever) with, say, eight
I/O lines independently control 100 different lights? Or read 100
different switch events? Surely there is some clever way? Can you
point me in the right direction?


---
The way I'd do it would be to use a couple of shift register chains.

For the input side I'd use parallel-in serial out devices, and for
the output side I'd use serial-in parallel out devices. this would
allow you to read and control many more sensors and actuators than
you'd care to put in the machine, at a cost of 5 I/Os.

Would you like a schematic?
 
S

Scott Brehler

Jan 1, 1970
0
John Fields said:
---
The way I'd do it would be to use a couple of shift register chains.

For the input side I'd use parallel-in serial out devices, and for
the output side I'd use serial-in parallel out devices. this would
allow you to read and control many more sensors and actuators than
you'd care to put in the machine, at a cost of 5 I/Os.

Would you like a schematic?

Hi John,

I've been following this thread and was wondering if you'd mind sending me
your schematic. I'm currently "refreshing" my digital skills (hopefully
progresssing to PLD's) and would be interested in seeing what your talking
about. My email is [email protected]

Thanks for your input...

Scott
 
R

Rich Grise

Jan 1, 1970
0
How does a pinball machine handle the gazillion sensors and lights and
coils and stuff?

Quickly. :)
I've always wanted to build a pinball machine from scratch. No, not
nearly as complicated as, say, Funhouse but thought it would be an
interesting challenge where I could deal with much electronic theory -
it'll take years of course. One of the things that is immediately
apparent to me is the slew of lights, swtiches, sensors, scoring targets,
and solenoids that must be addressed by the microprocessor(s).
How is this handled? I doubt the microcontroller has 150 discreet
I/O lines with 150 relays, MOSFETS, transistors, switches, whatever - but
does it? Or is there some sort of matrix or something where the CPU can
switch them all with few I/O lines.

As the others have said, all of the switches are scanned, hundreds of
times a second; the flippers, bumpers, lights, etc. are controlled with
either power transistors or SCRs - some of them actually run raw AC
(~12-15 VAC) through SCRs to light bulbs - the bulbs don't really care,
but the SRRs are really simple to control with a port bit.
Asked another way, how can a BASIC stamp (or whatever) with, say, eight
I/O lines independently control 100 different lights? Or read 100
different switch events? Surely there is some clever way? Can you
point me in the right direction?

Not with eight I/O lines, no, unless you add a whole bunch of matrixing
hardware. Get one with 24 or 36 I/Os, and it's just software.

And, as another poster has said, thumper bumpers are "autonomous" -
there's a switch contact that drives the solenoid, and closes a
contact for the scoring scanner. Flipper solenoids are kewl - there
are two solenoids in one: a very, very powerful one to do the actual
flipping, and there's a microswitch at the top of its travel that
disconnects the flip solenoid, and lets a sort of holding solenoid
take its place. (they're both on the same core, of course.) You might
observe this effect if you're holding the flipper up, and the ball
hits it hard enough to trigger the flip solenoid again - it bounces
back faster than it hit the flipper arm. :)

I used to fix these things; it's kinda kewl - the PCB itself is
interchangeable between different styles of machines (from the same
manufacturer, of course), with _possibly_ different ROMs - sometimes,
they can use the same board and the only difference is the layout of
the playfield.

Hope This Helps!
Rich
 
You've learned comp. sci b 4, that's a plus.

For the micro-processor that I'm working with now, it can do only ONE
thing at a time (same as human ?) I always keep that in mind, it helps
to make things simpler.

regard,
 
C

Chris

Jan 1, 1970
0
John said:
---
The way I'd do it would be to use a couple of shift register chains.

For the input side I'd use parallel-in serial out devices, and for
the output side I'd use serial-in parallel out devices. this would
allow you to read and control many more sensors and actuators than
you'd care to put in the machine, at a cost of 5 I/Os.

Would you like a schematic?

The ICs the OP needs are the 74HC595 (serial in from the
mictrocontroller, higher drive capability parallel out to the machine)
and the 74HC165 (parallel in from switches, buttons, &c, serial out to
microcontroller). The OP can daisy chain these together as Mr. Fields
suggested and, given enough time to shift enough data in and out one
bit at a time, he can literally have a couple hundred inputs and a
couple hundred outputs from 6 or 7 microcontroller pins. And 8 bits is
less than a buck in any quantity. If the OP gets some ULN2803s to
drive his lamps and relays (and can even drive smaller solenoids
directly), he'll be good to go.

Here are the data sheets:

http://www.onsemi.com/pub/Collateral/MC74HC595A-D.PDF
http://www.onsemi.com/pub/Collateral/MC74HC165A-D.PDF
http://www.st.com/stonline/products/literature/ds/1536/uln2803a.pdf

Good luck
Chris
 
S

Steadiguy

Jan 1, 1970
0
Thanks for all the help guys. Gives me much to think about and work
on!
Since some offered, I would be interested in any schematic examples.
You can send them to [email protected]. Thanks again.
 
E

Externet

Jan 1, 1970
0
Hi.
For the sensors, I would consider using the device under your nose : a
keyboard. ~100 keys that can be even more using the 'shift' key.
Rewiring the keyswitches matrix to the pinball machine sensors, using
only the microcontrollet gut. The program made to respond accordingly
to the scan codes received.
Miguel
 
H

HKJ

Jan 1, 1970
0
Asked another way, how can a BASIC stamp (or whatever) with, say, eight
I/O lines independently control 100 different lights? Or read 100
different switch events? Surely there is some clever way? Can you
point me in the right direction?

Another way to handle many inputs/outputs is with multiple
microprocessors on a serial bus.

Microprocessors are very cheap today and letting each processor do
preprocessing of the signales, your do not need much external electronic.
With a fast serial interface between the processors, the main processor
can control lots of inputs and outputs without much processing
 
Top