I settled on using my Raspberry Pi with the PiFace GPIO shield for inputs. Initially I was going to use the Pi for the GUI and an Arduino for the input processing. My thinking was the Arduino could constantly monitor the inputs while the RPi did other things. But it turns out the RPi was fast enough to do both, so the end result was much easier to deploy.
The wiring is pretty darn simple. Dry contact switches to the PiFace digital inputs. I used cheap speaker wire for the runs.
The switches all share a common ground. I had an old terminal block lying around that made this a piece of cake.
eBay from China for about $0.50 each. Perfect trivia grips.
The completed, and final, buzzers (yes, I know what it looks like).Python and used PyGame to handle all the graphics and input handling. The game is written such that the buzzers could be simulated with 1-4/5-8 for inputs so I didn't need a PiFace for local testing.
The source for the game is available here: https://github.com/SandyWalsh/trivia-box/tree/master/pi
It's a hack, so please excuse the mess. Patches welcome. There is so much more we can do with it. I have a YouTube video of the game play further down.
Then I set up for game night. Two teams of four players battle at any one time. Forty questions per game. Double elimination ladder for the full tournament. We had 8 couples (4 teams) which took about 3hrs to play through.
I asked the questions, so I was stationed at the end of the table. The RPi was plugged into a projector, then I had amplified speakers for sound and a keyboard for controlling the flow of questions. It's a console app, so no mouse needed.
My wife took care of all the other hosting duties ... here is the sugar cookie tray :)
the source README file.
It was a great night. Everyone had a ball and the software/hardware worked perfectly. There is a lot more I could do with it. I'd especially like to do more around the tournament management ... controlling the win/lose status and the double elimination ladder.
A question - what switches did you use? Also, did you control the game using the keyboard, or another type of switch?ReplyDelete
Fantastic! I wonder about using the rasp as a linux server running hadoop. A few rasps with 16g memory each would be awsome - but I wonder about the computing power. Any thoughts?ReplyDelete
@scott - I used these switches:ReplyDelete
@Don - the computing power is very low. These are slow machines and SDRAM cards are terrible. You'd be better off with an ATX-mini machine.
I Have read the readme an I still don't know how to connect the Buttons. One end goes to the pin thats written in the readme but where Do I connect the ground?ReplyDelete
With all the input switches, one side goes to the ground. That's why I have that big ground bar, tying all the lines together.Delete
I want to do this at a school in Tanzania. We have the Raspberry Pi, but no PiFace. Will it be possible to adapt your code to work with the GPIO pins directly?ReplyDelete
Yeah, it can completely work without the PiFace.Delete
I built something simiilar a few years ago, dismantling a cheap joypad and wiring every button separately:
Then I found out second-hand Buzz controllers on e-bay :-)
Hi Sandy, great coding!ReplyDelete
I'm putting this together for a group using an old raspberry pi v1 but I'm not using a PiFace. Can this be done without altering your code, I noted the "if piface" parts so presumed it can be?
The software is running fine but during testing if I close the circuit by shorting pin 0 to earth the rpi fails and is restarted. This doesn't happen for pins 2,3,4,5,6,7 although it still doesn't trigger these users buzzers either.
Do you have any ideas for me please, I'm at a dead end
I am absolutely in love with this project! I started building but I'm trying to get a grasp on how to compile/run the code on a Pi. While I'm not a n00b to technology - coding is a weak spot. Any pointers (even a "hey dummy this is how it's done" website link would be greatly appreciated!!!ReplyDelete
Nice post, Great thing to play. Why make button if you can buy buzzer button online. There are sites which provide buzzer at very affordable price.ReplyDelete