This project is for a student Quiz Bowl (think Jeopardy). Eight handheld push button switches that turn on an led indicator (one for each player) and energize a buzzer. It must also block all other buttons so there are no simultaneous lights. Oh, and must be battery powered.
Just to clue you in on my capabilities, the last course I took in electronics was for tube radios. I can solder.
you need 8 diodes, or an 8 input or gate, eight flip flops and a 5V regulator (7805) and a 9v battery. or the buttons together with a the diodes, also connect each button to a set input ona flip flop. use the or'd button signal to strobe the clock line to all flip flops through a .01 uf capacitor. use an 8 input AND gate to AND the negative outputs from the flip flops and use the output of the gate to power the other side of the switches.
(you can rework this with NOR/NAND logic if that is more convenient) - about
5 chips and 10 minutes to wire together.
you can do it with discretes or relays if that's easier for you, but with TTL or CMOS logic you will use less power and it will be easier to move around.
another way to do this is to use an 8 input latch, one input per switch, triggered by the OR of the switches through a single shot circuit - might take fewer chips.
look these chips up by type in a chip catalog and choose what is cheap and available.
One of the cheap little basic programmable microcontrollers ought to do the job, something with 16 I/O lines preferably so you don't need additional support chips. I believe Radio Scrap carries some of the Parallax micros, as does Fry's.
This is a fairly common question and you can see some really weird solutions if you google for Jeopardy switches lights circuit.
If you don't want to use a PLC like Karl suggested, or a microprocessor, as many would suggest, then see
simple and straightforward circuit as discussed in following URL:
solution uses about 9 parts per station, plus a bunch for the main panel. It depends on SCR operation to interlock the stations, so only the first-button-pressed station lights and stays lit.
Also see relays methods
. The former link is mentioned in informative thread about jeopardy-game-design-requests,
is copied from the sci.electronics.design newsgroup where jeopardy-game-design-requests are a FAQ.
Two of the weird ways:
flipflops etc to arbitrate every pair of stations, so would require about 28 FF's for 8 stations, and a mess of wiring.
(near the middle) says "... they press the button ... a powerful xenon flash is produced by the box ... A light detector in each of the boxes detects the light flash and temporarily disables the [other boxes]..."
It depends on just how close in time the contact closures might happen. Relays are a lot slower than logic circuits, so a tie might happen with the relays which would not be one on the logic circuit versions.
Simpler in basic. Just a loop doing a peek of the input port looking for a value other than 255 (presuming switches pull low). Looping a some 10s of killoHertz should be plenty fast in any of the current little micro chips. After that it's a simple test to see which line went low or if there is a tie. Gives you the ability to handle that rare tie better, perhaps a rapid flash on the appropriate LEDs, can also do sound effects easily.
Equally easy in PIC assembler. 10 "bit test and skip" in a row where they skip over a jump to light the correct LED, which just loops waiting for the "clear" button and jumps back to the 10 Test and skips, some thing like this...
ALLOFF: MOVLW 0xFF ;assumes high is off MOVWF PORTC MOVWF PORTD
CHECKSWITCHS: BTFSS PORTB,0 ;test 1st switch, skip if it's not pushed BRA TUNRON0 ;go turn on LED BTFSS PORTB,1 BRA TUNRON1 BTFSS PORTB,2 BRA TUNRON2 BTFSS PORTB,3 BRA TUNRON3 BTFSS PORTB,4 BRA TUNRON4 BTFSS PORTB,5 BRA TUNRON5 BTFSS PORTB,6 BRA TUNRON6 BTFSS PORTB,7 BRA TUNRON7 BTFSS PORTA,0 ;note we switch to port A for the last 2 switchs BRA TUNRON8 BTFSS PORTA,1 BRA TUNRON9 BRA CHECKSWITCHS ;keep trying.
TURNON0: BCF PORTD,7 ;buzzer on BCF PORTC,0 ;assumes lo is on BTFSS PORTA,3 ;is the "clear putton pushed? BRA ALLOFF ;yes go turn everything off BRA TURNON0 ;keep checking
TURNON1: BCF PORTD,7 ;buzzer on BCF PORTC,1 ;assumes lo is on BTFSS PORTA,3 ;is the "clear putton pushed? BRA ALLOFF ;yes go turn everything off BRA TURNON1 ;keep checking
;;;8 more of these for each LEDS.... last 2 would use bits in PORTD
Wanna see it in C... How about a couple of C++ classes... Mabe JAVA?, or are you a PHP type?... ohh I know you want it in PYTHON...
Theres also no need for debouncing the push buttons since once one pushed you hang in the led loop for clear and vica-versa..
Of course this dosen't test for "multiple pushs at once", but that wasn't part of the spec :-) Pretty easy to do though, just read all the switchs at once.
You could also make the program slightly more complicated and after you light the correct LED jump to a loop that either pulses the buzzer... of buzzes it for a set ammount of time and then goes quite, but still leaves the LED on...
FYI PIC's run just fine off batteries and have a built in 8MHZ Oscillator and cost 3 bucks... parts list would be the PIC, 4 external resistors, the buzzer, switchs, and LED's.. LEDS will need current limit R's unless you buy the expensive ones with them built in. Other external R's are because only one port on the PIC has builtin pullups for 8 of the 11 switchs, the 11th is "clear button" or you *could* just power it down. and back up. :-)
I had a new hardware only idea, this will guarantee no logic races, though under a rather odd circumstance it coudl be "unfair"
use a counter with at least 8 discrete outputs and a 555 oscilator set to some conveninent frequency - say 20 Khz. the counter will now energize one of 8 outputs one at a time in rapid succession.
each counter output goes to a switch. Each counter output also drives an LED through a resistor. All LEDs will glow dimly.
Other end of all switches goes to a latch (two NAND gates will do the trick). when you press a switch (any switch) the latch sets.
Output of latch goes to 555 "enable" line dragging it to the "disable" condition - oscillator stops, counter stops - the LED on the line that was active when the switch is pressed will glow brightly, all others off.
chip count is four, if I counted right, power draw is minimal, particularly with CMOS.