Bill of Materials
This implementation of ping pong uses:
- breadboard and jumper wires
- an Arduino microcontroller board
- 2 thumbwheel potentiometers
- a monocolor 8x8 LED matrix, type FS-16 (other types may be used, see the code, along
with a fitted PC board with a MAX7219 display controller
Setting Up the Arduino and Pots
Begin by setting up the circuit using only the pots and the Arduino.
The two pots should be placed on opposite sides of a breadboard; each one
should face “outward”, i.e., away from the center of the board.
For each of the two pots:
Connect the middle connector to an analog input pin (one of the pins labelled
A0, A1, …).
Connect one of the remaining two pins to the power (red) rail on the breadboard.
Connect the final pin on each pot to the
GNDrail on the breadboard.
The resulting circuit looks like this:
|Connecting Just the Pots|
For this setup, a short sketch, shown in code can
be used to measure the full range of motion of each pot and set the limits
Adding the LED Matrix
The circuit board on which the MAX7219 display driver chip is mounted comes with
header pins which need to be soldered in place. (Both straight and bent header pins
come with the PC board, along different configurations,
including chained several matrices together.
This project just uses the straight pins as shown below:
|Header pins before soldering||Header pins inserted|
Notice that the pins are inserted into the side with the
DIN connector. This is where the
data coming from the Arduino is fed into the matrix.
Now insert the LED matrix into the circuit board. Be sure to line up pin
1 on the back of the LED matrix with pin 1 on the front of the circuit board.
|Pin 1 on the back of the LED matrix||Pin 1 on the circuit board|
Now the LED matrix plus its companion PC board should be ready to insert into your breadboard.
Insert this combo anywhere, as long as all 5 header pins are inserted into different columns of
the breadboard. (Notice that the matrix
+PC-board combo will be a little floppy because it
is actually larger than the PC board.)
Now make 5 connections from the PC board to the Arduino circuit. These 5 connections will
power the PC board and LED matrix, and will also set up a serial communications interface
between the PC board and the Arduino. This interface differs from the “simple”
that are used for the Arduino’s Serial Console, because it is synchronous: data is sent/received
at precise times that are determined by a separate clock signal. This interface is fast and
efficient for devices like the matrix which (because it has a time-regular need for data) benefits
from an interface which is simpler and faster than the asynchronous interface used with the
With that said, here are the connections:
VCCpin to one of the red power rails of the breadboard. (Historically, “VCC”
means “voltage at the common collector”, but in practice, it usually means a positive source
of voltage which will power the electronics). A battery or power supply connected to the
same power rail will then provide the power to activate the MAX7219 and light up
the LED matrix.
GNDpin from the PC board to one of the
GNDrails of the breadboard.
DINpin from the PC board to the
MOSIconnector on the Arduino.
For many Arduino’s, Digital Pin 11 doubles as the
MOSIconnector pin. (“MOSI” means
master-out-slave-in; the Arduino is the Master, and the PC board is the Slave.)
CSpin from the PC board to the
CSpin on the Arduino. For many Arduino’s,
Digital Pin 10 doubles as the
CSconnector pin. (
CSmeans “Chip Select”, which is
useful when there is more than one slave listening on the bus. In this case, with one
Master and one Slave, it is not relevant.)
CLKpin from the PC board to the
SCKpin) on the Arduino.
For many Arduino’s, Digital Pin 13 doubles as the
and the highs and lows on this pin keep the communication synchronized to its “beat”.)
To power the LED matrix, you might need more power than the Arduino can supply. In that
case, connect the
- terminals of an external battery or power supply to the
red and black rails of the breadboard.