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?

Reply to
steadisteve
Loading thread data ...

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

Reply to
James Beck

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.

Reply to
zzbunker

the old ones used hard-wired logic.

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.

use a matrix.

--

Bye.
   Jasen
Reply to
jasen

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

formatting link
Home of DaqGen, the FREEWARE signal generator

Reply to
Bob Masta

--
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?
Reply to
John Fields

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.

Reply to
Arlet

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 snipped-for-privacy@mindspring.com

Thanks for your input...

Scott

Reply to
Scott Brehler

Quickly. :-)

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.

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

Reply to
Rich Grise

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,

snipped-for-privacy@aol.com wrote:

Reply to
ccon67

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:

formatting link
formatting link
formatting link

Good luck Chris

Reply to
Chris

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 snipped-for-privacy@aol.com. Thanks again.

snipped-for-privacy@aol.com wrote:

Reply to
Steadiguy

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

Reply to
Externet

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

Reply to
HKJ

--
You can get them at  news:alt.binaries.schematics.electronic
Reply to
John Fields

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.