Introduction: Ping Pong Scoreboard
The initial concept for this project came about when the Animade office pingpong table was becoming a place of row and despair, and people were struggling to remember the scores, and to remember who's turn it was to serve. To solve this we decided to put to use a few common place items we had lying around the studio.
The basic functionality required from the scoreboard were that:
- It allow the user to input his/her desired game settings, such as the number of points to which the game will be played (i.e. games to 5, 11, and 21) and decide based on this input the number of turns each player will have serving (which for ours are 1, 3 and 5 respectively),
- To allow for the score to be reset,
- It has to allow the players to tell the scoreboard who will serve first,
- It has to allow for a tiebreaker, or a deuce mode, and then of course,
- Declare an almighty winner.
This instructable will cover the basics of building a scoreboard for your ping pong table (or any other use you may find for a scoreboard!) using an arduino, an LCD display and/or LED matrix panels, loads of wire, 2 buttons, a potentiometer, and some basic soldering skills.
We made a 'proof of concept' scoreboard using the LCD display if you don't really want to invest in LED panels just yet. But if you're confident jumping on to the real deal then you might want to skip ahead a few steps!
Step 1: Gathering Your Components
You will need:
An Arduino, whichever variety takes your fancy, however we used the standard Arduino UNO R3;
Some LED matrices and the appropriate number of ribbon cables, we used 4 of these and 8 cables,
2 buttons of the arcade variety, for their bashability factor!
A potentiometer (or 2 if using the LCD),
Loads of wire,
A breadboard for easy prototyping, and then later on,
A proto-board and header pins, so as to be able to easily plug & unplug the matrices from the arduino board,
Of course, a soldering iron
And if you want to use an LCD display, then an LCD display! we'll explain how to wire that up too.
Step 2: Downloading the Necessary Software
For this project you'll also need a couple of different programs and useful libraries:
The Arduino IDE which we will use to program our Arduino,
and The Adafruit HT1632 library if using the suggested LED matrices.
To install this, download and Unzip the linked folder, rename the folder it to something more intelligeable, such as for example "LED matrix", and then drag it into /Documents/Arduino/libraries. If you already have gotten hold of the panels you will probably already have stumbled upon this neat tutorial over at Adafruit on how to wire up and test these, if not go check it out!
If you want to include bitmap images in your final scoreboard, check out Jenna Debois' awesome processing sketch for exporting images into your code (you'll need to download the whole file, but the one we are specifically interested for this is the LEDMatrixVisualiser folder) . If you want to do this though of course, you will also need to download and install Processing!
If your starting off with the LCD screen however, all you will need is the LCD library provided with the Arduino IDE.
Step 3: Connecting the Components Together, for Now...
First off the essentials:
1.Connect the power bus to the Arduinos 5V power supply
2. Connect the 2 buttons to power and then to a 220Ohm resistor to ground in order to prevent any false presses being read by the digital inputs.
3. Wire the 1st potentiometer to 5V and ground, and then connect the wiper (the 3rd pin) to an analog input.
4. Lastly, to connect the LCD dislplay: you will want to use the fritzing diagram above as a reference. Make sure you connect the 2nd potentiometers wiper to the VO pin and wire the backlight +/- to the power bus as otherwise you'll wonder why nothings happening!
5. Makes a note of which pins you have connected to what (such as "Potentiometer to A2" or which digital pins you have connected the LCD to), as this will make it easier for you later to modify your code instead of rewiring everything!
6. Plug in your arduino, and open up your IDE...
Step 4: Write/Download the Code
Download this folder from github https://github.com/tompeace/ping-pong-scoreboard
When you have uploaded the video you should get something resembling the above video.
If nothing happens, check that your code matches the corresponding pins on the board!
For using the matrices, you will have to drag the "HT1638" driver folder into your libraries folder, usually located at Users/Documents/Arduino/libraries on a Mac and My Documents\Arduino\libraries\ on a PC.
If you settled for using the LCD display, and if your screen counts to your desired point limit declaring a winner, you've done it!
Step 5: Setting Up the Matrix Panels
There is a great tutorial that accompanies the LED Panels themselves on Adafruit
which will show you how to wire up to the Arduino for testing, this is only a temporary option however as the cables will easily fall out if not secured properly - we will need to translate all of the wiring from the breadboard onto a proto-board, preferably one that mounts straight onto the Arduino, and GND and 5V rails built in as this will save you some wiring.
Make sure you find a spot on the proto-board that will allow for the two ribbon cables to be connected at the same time and close together, as these might get in each others way or interfere with other components, its a good idea to try and imagine what the final circuit will look like before committing to soldering as this isn't that easily corrected.
The cables connect to the underside of the proto-board and will wire underneath and back up into the digital in pin. if you DO make a mistake at this point in the process though fear not, you can always change the pin numbering in the Arduino sketch afterwards. My wiring is a bit messy, but try and make this as neat as possible as space between the proto-board and the Arduino is extremely limited!
The buttons are connected to 5V on one side, and on the other connected to ground AND its respective pin.
Step 6: Building a Box
The panels will need to be secured in some way. For quite some time these were cable tied to a piece of cardboard, which whilst at first was very 'indie' and kinda cool ultimately was structurally unsound and after a while a bit of an eyesore. Included in the github folder is a concept for a box as an illustrator (.ai) file, if you have a laser cutter handy (we didn't), feel free to use this one, and make sure you use 12mm MDF if you do otherwise the joints will not interlock properly.
In the end, simplicity prevailed and ours looks like the one in the photographs. The dimensions of the wood cuts are (all made from 12mm thick MDF): 2 pieces 74mm long x 100mm wide for the sides, 2 pieces 480mm long x 100mm wide, one off-cut 74mm x 10mm was used to mount the Arduino onto.
We used a couple of project boxes from a DIY shop to house the buttons in, and these are wired to MONO 3.5mm phono plugs on the box, then onto the proto-board!
Step 7: The End!
There you have it. If all went well you should now have a fully functioning scoreboard!
We have a be nice policy.
Please be positive and constructive.