Ping Pong Score Board

Hi,

At work we have a Ping Pong table. It gets used almost every break and unfortunately I am never usually the winner. The most frustrating part of playing is that keeping score constantly leads to arguments that result in game restarts or just agreeing on a random even score.

To try and solve this issue I thought it would be a fun project to create a Ping Pong Score Board using an Arduino Mega that I had been messing around with. I was originally going to use 4 7-segment displays that I had for the display but after searching the internet for a better option I found the Rainbowduino. The Rainbowduino is an Arduino compatible controller board used for controlling an 8x8 RGB led matrix.

I purchased 5 x Rainbowduinos and 5 x led matrixes. The Rainbowduinos can be easily cascaded together allowing I2C controlling of the displays. I also modified the Ping Pong table at work so that score inputs could be handled by the players themselves. A button was mounted at each corner of the table and wired up to a connecter that could be plugged into the score board. This allows for the score board to be easily removed and programmed at home. I have a breadboard setup at home that simulates the table setup.

Below are some pictures of the project so far with some details on what's going on;


Figure 1. Score Board with no power.

Figure 1 shows the score board with no power applied. It is housed in a custom made aluminium box that allows power and USB to come in on the left. There is also a cable from the back that connects to the actual Ping Pong table.


Figure 2. Basic identification of top parts of score board.

Figure 2 is a basic layout of the front of the score board. 5 Rainbowduinos are mounted atop a removeable sliding platform and the Arduino is mounted to the rear of the platform. This allows for easy access to the Arduino and also permits expansion later on.


Figure 3. Score Board awaiting game initialisation.

Figure 3 shows the power after initial power on, or when a game reset command has been sent. The score board waits patiently for a player to press their button. At work, we play for serve. Meaning that we have a quick initial 1 point round to see which team serves for the actual game. Once the serve has been won, the winning player will press their button, and the score board will point the green arrow shown in Figure 4 to the serving side.


Figure 4. Score Board after a game has been initiated.

Figure 4 shows the display once a game has been initialised. In this picture, players 1 & 2 have won the serve, so the green allow indicates this. At work, a person serving has 5 serves, and then the other team get the serve for 5 points, etc. As 5 points is reached, the arrow points to the other side, as shown in Figure 5. This removes the need to remember how many serves a team has had.


Figure 5. Score Board displaying current score.

Figure 5 shows that 5 points has been reached. The arrow has changed sides indicating that Team 2 is now serving.

There is still a long way to go with the Arduino code. The Rainbowduinos are loaded with a modified version of “Rainbowduino Firmware 3” found at http://code.google.com/p/rainbowduino-firmware/. Each Rainbowduino is programmed with a unique address from 0x10 to 0x14. The Arduino Mega is programmed as the I2C master.

All inputs from the Ping Pong table are sent to the Arduino, which in turn processes these and updates the score board as required.

My source code can be found at Google Code Archive - Long-term storage for Google Code Project Hosting.. It is fairly untidy at the moment as I write so it does what I want, then I tidy it up. I am more than happy to take on board your ideas; especially improvements to the code that you can see would make a change for the good.

I will endeavour to put up more pictures of the actual score board and the inside of it. It is an engineering marvel, haha.

That's for taking the time to read my post. I hope I haven't score board you too much. Ha! I crack myself up.

Daniel.

Some more pictures for your viewing pleasure.


Figure 6. Score Board side panel removed.

Figure 6 shows the left hand side panel removed. You can see the Arduino Mega mounted to the rear of the sliding panel and the 2 I2C wires and 2 power wires coming in to the first Rainbowduino. On the left you can see the cable coming from the rear. The reason there is an additional white wire is that the actual wiring I used contains 5 wires, and I totally forgot about 5v that I needed to send to the ping pong table. My bad :smiley: I will hopefully clean this up later. The green tape holing the two cables together does look very fancy though, so I might leave it.


Figure 7. Score Board Side panel.

Figure 7 is a picture of the side panel that has been removed in figure 6. It is made of aluminum as is the rest of the box. Flush mount rivets and captive nuts make it extremely easy to remove and install.


Figure 8. Score Board right hand side.

Figure 8 is a picture of the right hand side of the score board. Nothing really special to describe here. I could comment on the frosted glass table that was purchased from Freedom Furniture 3 years ago, but I wont ;D


Figure 9. The Arduino mounted to the rear of the slide panel.

Figure 9 is the underside of the internal sliding panel. The Arduino has been mounted to allow the slide rail to move without any interference. The fit is extremely tight and keeps the score board housing looking really clean. The green sticky tape is an essential part of the mounting hardware :wink: All the wiring is just stripped wire that has been soldered and shoved into the pin sockets. This is due to making the fit so tight that there is not really room for a more suitable solution. It works at the moment so I'm happy.


Figure 10. My table simulation setup.

Figure 10 is my beautiful Ping Pong table simulator. The 4 buttons represent the players buttons on the actual table.

If you would like any more pictures, please ask. I am happy to take custom shots.

Dan.

Very cool.

What level of functionality is this going to provide? Does it keep track of points (and deuce / game end conditions)? or does it also track matches? Players' records? I'm sure with a few modifications you could have it track games/matches for every player and keep track of W/L record. But then, maybe I'm just over competitive. :slight_smile:

Hey Head Phoned,

At the moment it is coded for just the basic purpose of display score. There is definately going to be further improvements as I complete the basic score displaying routines.

Current functions

Increase Score - Players can increase their team score by pressing their table button once. Each push will advance the score by 1.

Decreasing Score - Players can decrease their team score by having one team member pressing and holding their button, followed by the second team member pressing their button. This will reduce their score by 1.

Green Arrow - The green arrow points to the team who currently holds serve. Serve changes after every 5 points. The initial arrow direction is decided by a simple "play for serve" round. The winning team presses either of their buttons to start a game with the arrow pointing in their direction.

Game Reset - Resetting of a game can be achieved by pressing all 4 player buttons at the same time.

Five points - A five point shot can be claimed by a team member pressing and holding their button for longer than 1 second. This will display "FIVE?" on the display. A member from the other team is required to validate the 5 point claim by pressing their button. This will add 5 points to the claiming team's score.

The five point score is a rule we have at work. In each corner of the table is a 5x5cm piece of plastic glued to the table. When you hit the ball over and land it on the other sides plastic, you win 5 points in the other team does not return the ball. If they do return the ball it is only 3 points. This feature needs a lot of work.

These are the current features I am working on. Once this basic functionality is achieved I will look at further improvements. I am always open to suggestions.

Your thoughts on tracking matches has been through my head. This could be archieved via either user input, or since we use Smart Cards at work to access the buildings, I could attach an RFID reader where players could "sign in" as such.

The players records would be very nice aswell. At the moment I am going to just score the highest and lowest scoring games in EEPROM and recall this when the scoreboard is inactive. I have implemented a basic screen saver as such that scores text and this can be used to display the scores mentioned.

Further on the scores, we play to 21. When 21 is reached, the game is over. UNLESS, the scores are within 2 points. The rule is you must win by 2. If the scores are 21-20 then the game will continue until a 2 point gap is reached. This has not been implemented yet.

If you have any other ideas or questions regarding the project please feel free to ask. I am extremely interested in peoples ideas as I am not always thinking outside the square. This is my first Arduino project and my first time coding in the C language so I am doing everything via lots of google searches. I am sure my code has a lot of room for improvement.

Thanks,

Dan.

Very professional,

Although a POV display mounted on a pole would be more fun, rotating slowly, it could provide 360 degree visibility.

It would also be fun if a ball got near the rotor arm :wink: