Close
0%
0%

Game Show Emulator

Play game shows with your Raspberry Pi and some big pushbuttons.

Similar projects worth following
Instead of watching game shows, be in them! This console can emulate the game show Jeopardy, and will soon be able to emulate many more.

Hardware

The Game Show Emulator has two basic components.

  1. The Raspberry Pi
  2. The Buttons

The Raspberry Pi runs the emulation software, and polls the buttons. The buttons are connected to ground and Raspberry Pi pins 4, 17, and 22 using the BCM layout. Each button is housed in a plywood case with a removable bottom to get at the circultry.


The blue and green cases are connected to the central red case via 6 wire ribbon cables and IDC connectors.

The red center case houses both the red button and the Raspberry Pi. Connections to 5V, HDMI, and USB come from here.

The Software

Right now the Game Show Emulator runs a version of Adam Beagle's Jeoparpy software. His original software only worked on Windows and Ubuntu, so I ported it to the Raspberry Pi. My version also uses the pin 4, 17, and 22 as ring in buzzers instead of the 1, 2, and 3 keys on your keyboard. I am currently programming new game shows into this console that should be finished soon.

  • 1 × Raspberry Pi Any model will do, A+ will be slower.
  • 3 × Big Pushbuttons Little ones work to, but are not as fun to press. Get them at Sparkfun or Adafruit.
  • 3 × Transistors The leds in the buttons draw too much for the Pi, so use transistors. I used an H-Bridge
  • 4 × IDC Connectors (Female) Crimp these with ribbon cable to connect the buttons/leds together.
  • 4 × IDC Connectors (Male) Solder on wires to connect to Pi or buttons.

View all 7 components

  • Setting Up Jeopardy

    tyspa01/01/2015 at 15:33 2 comments

    In this log I will explain how to run Jeopardy on your Raspberry Pi.

    Step 1: Download Software

    Start by cloning the Jeopardy Pi Edition software:

    git clone https://github.com/spadgenske/jeopardy.git

    Step 2: Test Run

    Change to the jeopardy directory with the command

    cd jeopardy
    

    Now, test run the software with the command

    python start.py 

    A small window will pop up asking you to select what game you wish to play. Right now it doesn't matter, all the games are examples. If a big window pops and the Jeopardy logo fades in, the software is working!

    Once Pi Edition is displayed under it, press the spacebar to continue onto the rules. Press it again to see the categories. Now, you will be in the game. When a player asks for a clue, the host would double click on that clue. From here, the host can read the clue. After this, it is a race to ring in first. To do so, just press a button. (If no buttons are set up, the 1, 2, and 3 keys will also ring in.) If the player answers correctly, the host will press the spacebar. If the player answers incorrectly, the host will press backspace. If no answer is given, the clock will time out and the player will lose money automatically. If the player answers incorrectly, the other two players have a chance to ring in. If no one rings in, it times out and you go back to the main screen. When the game is over, the host can press the "q" key to show the winner and scroll the credits. Once you are familiar with the controls, you can add your own clues and categories in.

    Step 3: Adding Your Own Game

    The categories, clues, and players are all text file based. Now I will show you how to edit them to create your own game.

    Start by entering the games directory. Believe it or not, where all the games are stored.

    cd games

    There will be four games in this directory. All of them are examples, so we will start by editing the "Example" game.

    cd Example

    Add Players to your Game

    Now, lets edit the players.

    nano players.txt

    In the file, each line will be a player. Change the lines to the three players who are playing. Remember, no more than three lines. When you're done, the file should look somewhat like this:

    Bob
    Joe
    Steve

    Add Categories to your Game

    To add the five categories, just edit the categories.txt file.

    nano categories.txt
    Each line is a category. Remember, only 5. No more, no less.

    Add Clues to your Game

    Adding clues is pretty much the same, just more lines.

    nano clues.txt
    The first 5 lines are to clues to the category on the first line in categories.txt.

    The next 5 lines are for the category on the second line in categories.txt.

    Your get the picture.

    Change each line to the clue of your dreams. Once all 25 clues are filled in, your game is complete!

    Renaming your Game

    At the moment, your game is named "Example". lets change it. Start by going back to the games directory.

    cd ..
    Now lets rename the directory.
    mv Example MyNewGameName

    Only Four Games?

    You can only have four games in the games directory. Any more and the software will ignore them. But you can load more via a flash drive.

    Step 4: Tags

    When running

    python start.py
    there are a couple of tags that can be used.
    • The -f tag puts Jeopardy in full screen.
    • The -w tag puts Jeopardy in windowed mode.
    • The -d tag puts Jeopardy in debug mode.
    • The -s tag skips the intro sequences.
    • The --drive tag loads the games from the
      /media/flashdrive/games/
    • Instead of

      /home/pi/jeopardy/games/

    Final Notes

    Congratulations! You just setup Jeopardy on your Raspberry Pi and created a game! Go back and run start.py and instead of example you should see your game. If you have any questions/corrections, please comment so I can fix them immediately.

View project log

  • 1
    Step 1

    Gather Materials

    Before we begin, purchase all the stuff we are going to need.

    I also have a wishlist on Sparkfun which includes most of the things you will need.

  • 2
    Step 2

    Assemble Electronics

    The electronics for the emulator are pretty straight forward. The Pi pins are in the BCM layout.

    • Pi GPIO4 to button (Make sure its the button, not the LED. Multimeter will do the trick)
    • Pi GPIO17 to button
    • Pi GPIO22 to button
    • GND to all three buttons

    Make sure you connect the Pi to the Normally Open terminals. The big push buttons from Adafruit and Sparkfun can be normally closed depending on what you connect. Use the picture below for reference:

    Depending on what kind of casing you are using, you may want to connect the buttons to the Pi with IDC ribbon cables like I did.

  • 3
    Step 3

    Test Buttons

    Now, before we start a game show, we should test the buttons out. Start by cloning a test script.

    git clone https://gist.github.com/fc61215e14f2b4712002.git

    Change to the scripts directory with the command:

    cd fc61215e14f2b4712002
    Now, run the script with the command:
    sudo python button.py
    When you press each button, a line should be printed out displaying which button was pressed. If lines are constantly being printed out, you may have the pi connected to a normally closed terminal instead of a normally open terminal.

View all 5 instructions

Enjoy this project?

Share

Discussions

haramnoor wrote 10/02/2024 at 17:25 point

https://nullsbrawlsapk.com/brawl-stars-mod-apk/

  Are you sure? yes | no

Ken wrote 03/01/2018 at 20:31 point

An old project, but it's just what I wanted.  I found I had to add pull-down resistors to the buttons, that is between the GPIO pins and ground to keep them from floating and creating phantom presses.  When using little buttons that plug right into the prototype board it worked fine without.  With a button on a short wire it worked with ~10K ohm resistors, just the first ones I grabbed.  When I used a longer wire I needed to reduce that all the way down to 220 ohms.  Arrived at that experimentally, I'm no electronics engineer and can't tell you why.  I wonder, though, if adapting the circuitry and software to use normally closed buttons would work better -- the pin would not float and generate spurious results when no one is pressing it.

On the software side, I had to use an old Wheezy version of Raspian on an older RPi.  I had problems with the pygame module on Stretch.  I don't know if Wheezy works with newer RPi-3's or Zeroes, just went with what I could get working with least effort.  Given more time to poke at it maybe it could be made to work on newer software & hardware.  Would be nice to be able to use one of the more powerful CPUs.

  Are you sure? yes | no

cchhita wrote 09/20/2016 at 03:31 point

HI Tyler, Great project! I got the software setup very quickly and without issues! 

I decided to purchase similar components to what you had for the hardware buttons.  I looked at your fritzing diagram but was confused as two of the buttons were not connected to anything.  Did I misread the diagram?  I am new to this so probably just dont understand how it is drawn.

Also, was there any soldering required onto the GPIO ports? 

Thanks i advance

  Are you sure? yes | no

tyspa wrote 09/20/2016 at 15:19 point

Hello,

I built my console with ribbon cable connectors, so that is why the diagram shows just the connector. In reality all the black wires are connected together, the yellow wires are connected together same with blue etc. You don't have to solder directly to the raspberry pi gpio, you can use female jumper wire like I did (https://www.adafruit.com/products/1950) you will have to solder to the buttons though but that is much easier

  Are you sure? yes | no

cchhita wrote 09/21/2016 at 23:50 point

thanks for your quick reply. I have decided to use female jumper wires as per your recommendation. Instead of soldering the other end, I was planning to use wire disconnects so I can reuse the buttons for other applications.

I was also thinking about using extra buttons to replace the need of the keyboard. I.e. backspace for incorrect answer is a red button, and green button to replace space bar.

Are there any other buttons I would need in order to completely replace the keyboard?

I also set my pi to auto boot into the game, so I don't need to worry about getting into the application.

Thanks!

  Are you sure? yes | no

Adrian Castillo, CTS wrote 08/17/2016 at 04:33 point

Greetings, Tyler.  I am having the same issue as many of the folks with the buttons.  The button script seems to run wild even if no buttons are plugged in.  In game, player 1 seems to trigger itself first every time regardless of buttons being plugged in.  Any guidance is greatly appreciated!  

  Are you sure? yes | no

cchhita wrote 09/23/2016 at 23:42 point

Adrian, I did not see this behavior at first but it just started happening for me.

I tried a different pi and a fresh install of rasbian with a fresh copy of the jeopardy game and still get the same result with player one always getting triggered. Have you found a solution?

I will post back if I find the source of the issue 

  Are you sure? yes | no

cchhita wrote 09/24/2016 at 16:28 point

Adrian,

I have figured out how to fix my button clicks.  The key is the button.py file in the /jeopardy folder. This controls the click action of each button.  Since I was not using the same buttons as Tyler, I had to make an edit to this file.

My buttons are all daisy chained to each other on the ground, and each button individually is connected to the NO (Normally Open) connector.  

I then went into the button.py file and changed wherever it said True to False.

Example:

#Left button stuff
        if left_input == True:
            if self.left_press > 0:
                if self.DEBUG:
                    print('ADMIN: Console button 1 has been pressed')
                self.first = 0

Now becomes

#Left button stuff
        if left_input == False:
            if self.left_press > 0:
                if self.DEBUG:
                    print('ADMIN: Console button 1 has been pressed')
                self.first = 0

I did this for all sections where the each button is defined.  When I now run my game, it waits for a button to be clicked and does not automatically trigger player 1's button.

Hope that helps you and anyone else having this issue

Thanks

Chirag

  Are you sure? yes | no

bverheecke wrote 03/03/2016 at 08:43 point

Hi, 

I was wondering if it is possible to change the time to answer the questions?

Thanks, Bart

  Are you sure? yes | no

tyspa wrote 03/03/2016 at 14:52 point

Yep! Just change line 66 in config.py

  Are you sure? yes | no

bverheecke wrote 03/04/2016 at 11:37 point

Thanks Tyler,

It worked, now the game is perfect to play with the kids!

You are a hero!

  Are you sure? yes | no

annehasseld wrote 12/07/2015 at 13:47 point

I't's me, the teacher from Michigan again.  We have built our game and have run into the problem you discuss here: When you press each button, a line should be printed out displaying which button was pressed. If lines are constantly being printed out, you may have the pi connected to a normally closed terminal instead of a normally open terminal.  Do you know how we can correct this?  Thanks so much!

  Are you sure? yes | no

tyspa wrote 12/07/2015 at 21:12 point

@annehasseld I added a image to step 2. If you are using different buttons you will either need to change them out or edit the code.

  Are you sure? yes | no

annehasseld wrote 11/17/2015 at 20:50 point

Tyler, thanks so much, that worked.  Sorry.  We have the game up and running, a few issues, but we are working through those.  My next question is we are attempting to configure the buttons.  We have read your instructions and tried to look at the photos but they are a little blurry so we can't determine exactly where to connect the IDC connectors to the buttons.  Do you have any clearer pictures you could post or you could send to us?  

  Are you sure? yes | no

tyspa wrote 11/17/2015 at 23:25 point

I added a fritzing image :)

  Are you sure? yes | no

annehasseld wrote 11/18/2015 at 17:17 point

You are amazing!  Thanks so much!!!

  Are you sure? yes | no

annehasseld wrote 11/17/2015 at 13:28 point

I am a high school teacher trying this project. I cannot even get the raspberry pi to download and install the jeopardy software.  I get an error message that says the server certificate verification failed.  I copied the jeopardy files and loaded them to the raspberry pi but I don't know how to install them.  HELP!

  Are you sure? yes | no

tyspa wrote 11/17/2015 at 15:10 point

Try downloading a zip package from https://github.com/spadgenske/Jeopardy/archive/master.zip and then unzip with "unzip master.zip" and change the name to jeopardy with "mv master jeopardy" and you should have the same result as cloning. The software does not need to be installed as it is mainly just python and image files. Not sure why you get the error, may be because you are behind a firewall.

  Are you sure? yes | no

annehasseld wrote 11/17/2015 at 15:59 point

Tyler, thanks for your quick reply.  You are working with a complete rookie here.  I have the file unzipped.  I have no idea how to change the name.  I tried doing that in the terminal and no luck.  If you mean I should just change the file name to Jeopardy on the folder, I did do that, still no luck.  

  Are you sure? yes | no

tyspa wrote 11/17/2015 at 16:29 point

When you download the package from the link above the package is named "master" all you need to do is unzip it and change the name of the folder to jeopardy so the software works properly. then in a terminal, follow step 2 of this project log: https://hackaday.io/project/3721-game-show-emulator/log/12365

  Are you sure? yes | no

greenaum wrote 08/23/2015 at 20:31 point
Ah OK, I thought you'd actually MADE an H-bridge from transistors. Makes sense now!

  Are you sure? yes | no

greenaum wrote 08/10/2015 at 16:17 point

Do you need an H-bridge for your LEDs? Are they bi-colour, reverse-polarity ones? For a single LED any old bipolar transistor should be easily able to drive it. If you need bi-colour LEDs, you might replace them with tri-colour, where the LED chips have a separate lead each, with a shared ground. No messing around with polarity, and you'd save 2 transistors. Or for one more, full RGB and still one transistor less than an H-bridge. 

  Are you sure? yes | no

tyspa wrote 08/10/2015 at 21:21 point

No, you do not need an H-bridge. Plain old transistors will work just fine. I just used an H-Bridge because I had the chips already and was under a time crunch.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates