CC Blog • Projects • Research & Design Hub

Retro-style Miniature Sports Scoreboard

Written by Tyler Bisk

RGB LED Matrix and Raspberry Pi Provide In-Game Updates

This Cornell University graduate describes how he built a miniature, retro-style scoreboard that pulls and displays live college and professional sports scores from the ESPN API—bringing the excitement of being at a sporting event to your living room. Pre-game information, in-game scores, and post-game results are displayed on a built-in PiTFT touchscreen.

  • How can I create a retro-style sports scoreboard with a Raspberry Pi?
  • What hardware and software are needed to build a Raspberry Pi-based sports scoreboard?
  • How do I use the ESPN API to display live sports scores on an LED Matrix?
  • Can I use this Raspberry Pi scoreboard for other sports like soccer or baseball?
  • How does the scoreboard display data for pre-game, in-game, and post-game phases?
  • Raspberry Pi 4
  • PiTFT touchscreen
  • 64×32 LED Matrix
  • rpi-rgb-led-matrix Python module
  • ESPN API
  • Python programming language
  • Pygame library
  • Cron utility
  • SD card with Raspberry Pi
  • Linux
  • HTTP GET requests
  • JSON data format
  • Bicubic Interpolation (for image resizing)
  • Adafruit Industries | www.adafruit.com

This project emulates a scoreboard by using a Raspberry Pi connected to a 64×32 LED Matrix. Using the touchscreen of a PiTFT, the user can select a team to display from collegiate and professional hockey, football, and basketball. The user can also select rotation between teams instead of displaying only one team. The system then queries the ESPN API to get live scores from the Internet according to the user’s settings. Finally, the team names, logos, and scores are displayed on the LED matrix. The scoreboard displays a celebration whenever a team scores in football or hockey.

When the selected team is not currently in a live game, the scoreboard displays the results of the previous game or the date, time, and opponent in the next game, depending on which is closer in time. Using cron, a command-line utility for scheduling jobs, the service starts on automatically on boot and defaults to displaying any supported sport and team.

HARDWARE DESIGN

The hardware consists of three major components: a Raspberry Pi 4, a touchscreen PiTFT, and a 64×32 LED Matrix. The Raspberry Pi contains a 16GB SD Card with the default Raspberry Pi Linux installed. As shown in Figure 1, The LED Matrix gets 5V of power from the included DC adapter, the PiTFT gets power from the Raspberry Pi, and the Raspberry Pi gets 3.3V from the included USB-C cable. The LED Matrix gets wired to the Raspberry Pi’s GPIOs, according to Table 1 and Figure 2, while the PiTFT header is designed to simply snap onto the top of the Raspberry Pi [1]. LED Matrix pins are numbered left to right, and top to bottom.

Figure 1 System overview showing how the Raspberry Pi 4, touchscreen PiTFT, and 64x32 LED matrix are connected.
Figure 1
System overview showing how the Raspberry Pi 4, touchscreen PiTFT, and 64×32 LED matrix are connected.
Table 1 Wiring of Raspberry Pi to LED Matrix
Table 1
Wiring of Raspberry Pi to LED Matrix
Figure 2 Top-down view of the system, including all wiring.
Figure 2
Top-down view of the system, including all wiring.
SOFTWARE DESIGN

Setup: The LED Matrix requires one additional Python module called rpi-rgb-led-matrix, which contains functions to draw text and images on the LED Matrix. To install the tool, download the shell script from Adafruit’s official GitHub page [2]. Once the script has downloaded, run the script and select “Adafruit RGB Matrix Bonnet.” After rebooting, the packages are installed and import rgbmatrix in Python will succeed.

Matrix Object: The Matrix Object, found in matrix.py, is a general class for configuring the LED Matrix, and provides many helper functions, fonts, and colors to be used later. Using the configuration, row count is set to 32, column count is set to 64, and brightness is set to 80. After these values are set, the LED Matrix is ready to be used. Some of the helper functions implemented include resizing a logo to prevent aliasing, drawing boxes with given dimensions and color, and converting an image from black to white, which is easier to see on the RGB LED Matrix.

THE SCOREBOARD

Parsing Data: Upon launch, the scoreboard reads in the initial sport, league, and team to display from a configuration file called config.yml. The scoreboard proceeds to send an HTTP GET request to ESPN’s API, using the provided values of sport and league. The format for such an API request is: http://site.api.espn.com/apis/site/v2/sports/{SPORT}/{LEAGUE}/scoreboard[3]. This project implements three sports—hockey, basketball, and football—at the sport’s American professional league, as well as the men’s and women’s (where applicable) NCAA league.

The HTTP GET request to the API returns a JSON that corresponds to the sport and whether the game is in progress. For example, “timeouts-remaining” is applicable for in-progress basketball and football but not for hockey or for scheduled or completed games. Therefore, there are different cases for displaying scores for each sport and whether it is before, during, or after the game. After all relevant data, including team names. logos, scores, time remaining, and ball location has been extracted from the JSON, the data can be displayed on the LED Matrix.

Displaying Data: Data is displayed based on the status of the game, which is either pre-game, in-game, or post-game. If the game has not yet started, there are no scores to display. The team logos, abbreviations, ranks, and records are displayed, along with the date and time of the event. As shown in Figure 3, everything cannot fit on the matrix simultaneously. Instead, all data is cycled through in an 8-second period. The date of the matchup and the team abbreviations are shown for 4 seconds, then the time of the matchup and the team records are shown for 4 seconds. The sport of the game is represented by either a small football, basketball, or hockey sticks in the center of the screen

Figure 3
Pre-game display of a Cornell hockey matchup. The display shows the sport, team names, team logos, team rank, and date of the matchup.
Figure 3
Pre-game display of a Cornell hockey matchup. The display shows the sport, team names, team logos, team rank, and date of the matchup.

During the game is when the most data is needed to fully describe the situation. Therefore, when in-game, the logos are four times smaller and moved to the right half of the screen. Boxes encapsulating the logos, team abbreviations, and scores are drawn according to the team’s colors. Timeouts remaining and possession, if applicable, are indicated with dashes and dots, respectively, just as they are on a real scoreboard. The left half of the screen lists the period and time remaining in the period, as well as the down & yards to go, and location of the ball if applicable. Figure 4 shows a professional football game, including down & yards to go, location of the football, timeouts remaining, and possession.

Figure 4
In-game display of a professional football matchup. The left half of the screen shows the period, time remaining, down, yards to go, and ball placement. The right half of the screen shows teams, logos, scores, timeouts remaining, and possession.
Figure 4
In-game display of a professional football matchup. The left half of the screen shows the period, time remaining, down, yards to go, and ball placement. The right half of the screen shows teams, logos, scores, timeouts remaining, and possession.

When a team scores in football or hockey, a celebration animation is displayed. (Basketball scores happen too often for this to be necessary.) The celebration animation blinks the name of the play (such as goal or touchdown,), the name of the team, and a full-screen team. After five blinks, the animation is over and the score of the game returns. The animation is shown in Figure 5.

Figure 5
Scoring animation for Cornell hockey displaying a goal for Big Red. After blinking the animation five times, the normal in-game scoreboard returns.
Figure 5
Scoring animation for Cornell hockey displaying a goal for Big Red. After blinking the animation five times, the normal in-game scoreboard returns.

At the end of the game, the final score is displayed with large logos. As shown in Figure 6, the status of the game is at the top of the LED Matrix, with the logos in a similar position to the pre-game view. The scores and the sport logo are shown in the center of the screen.

Figure 6
Final score for Cornell hockey, including the sport, team logos, and status. The scoreboard also indicates that this game went into overtime.
Figure 6
Final score for Cornell hockey, including the sport, team logos, and status. The scoreboard also indicates that this game went into overtime.
PYGAME ON THE PiTFT

While the scoreboard displays competition data, the PiTFT runs a touchscreen GUI, using Pygame to allow the user to select the sport, league, and team to display. As shown in Figure 7, the GUI offers three sets of arrow keys—one each for sport, league, and team. The options for league depend on the selection for sport, and the options for team depend on the selection for league. When the desired parameters are reached, the SEND PARAMETERS button is pressed to send the new values to the scoreboard. This button updates the global variables that are read by the scoreboard when pulling from the API and selecting a competition from the returned JSON.

Figure 7
Touchscreen Pygame GUI for selecting sport, league, and team. The user can either send the parameters to the display or start a demo, which cycles through pre-recorded games.
Figure 7
Touchscreen Pygame GUI for selecting sport, league, and team. The user can either send the parameters to the display or start a demo, which cycles through pre-recorded games.

The final button on the GUI, START DEMO, starts the demonstration of all capabilities of the system. In this state, instead of querying the ESPN API for new JSONs, the JSONs are pulled from the local filesystem. Pulling from the local filesystem was previously used for testing the system, so the only additional code needed was to pull the correct JSON for the given state of the demo. The demo highlights the four different phases of a Cornell hockey game: pre-game, in-game, goal scored animation, and final. The user can click back and forth between states and go back to live scores by ending the demo when finished. Demo mode is helpful, since most of the time there are no sports games in progress.

Given a sport and league, the GUI also allows the user to select “All” or a specific sports conference or league instead of just one team. If one of these special options is selected, the scoreboard will display matching competitions for 8 seconds each, looping back to the beginning after all matchups have been displayed. Figure 8 shows the system when Ivy League men’s basketball has been selected. Each of the day’s men’s basketball games involving an Ivy League team is shown in succession.

Figure 8
View of entire system rotating through all games in Ivy League basketball. The touchscreen PiTFT (right) controls which sports games are displayed on the LED Matrix (left).
Figure 8
View of entire system rotating through all games in Ivy League basketball. The touchscreen PiTFT (right) controls which sports games are displayed on the LED Matrix (left).
USER INTERACTION ON START UP

Since this is an embedded system, the scoreboard must start up on boot any user interaction. Using cron, a command-line utility for scheduling jobs on Unix-like operating systems, the start script start.sh, is run on boot [4]. The two-line start.sh accepts optional arguments for brightness, size of the matrix, username, and how many seconds to wait for Wi-Fi to the Internet before attempting to pull from the ESPN API. The intention is to use absolute file paths for both main.py and the fonts used on the matrix, so users must specify their usernames if theirs is different than the default value of “pi.” Now, when connected to power, the system boots up automatically and defaults to display the sport, league, and team specified in config.yml.

THE FINAL SYSTEM

The LED Matrix came with magnets screwed into its back. After organizing the wires and mounting the Raspberry Pi and PiTFT in place under the LED Matrix, the entire scoreboard system could be suspended magnetically on any suitable surface. The system is now an all-in-one, portable scoreboard, ready to be mounted anywhere, as shown in Figure 9.

Figure 9
The final retro scoreboard system, showcasing an upcoming NCAA Basketball game. The Embedded system is complete with a GUI, and boots automatically when connected to power.
Figure 9
The final retro scoreboard system, showcasing an upcoming NCAA Basketball game. The Embedded system is complete with a GUI, and boots automatically when connected to power.
RESULTS

Everything performed as expected, and the goals were met. The scoreboard pulled live scores from the ESPN API and displayed them on the LED Matrix as planned. The Raspberry Pi, PiTFT, and LED Matrix worked together in harmony to provide an embedded system complete with a GUI and plenty of compute and memory to spare. 

The scoreboard can transition between the three states of pre-game, in-game, and post-game, without the need for human interaction. The demo mode worked well for showcasing the basic features of the system. The extra features implemented, such as displaying other sports besides hockey, rotating through multiple teams, and flashing the team logo when a goal is scored, all served to make the result even better. The ESPN API, along with the 4-second refresh rate, provided the perfect amount of delay when watching games. The scoreboard and television were synchronized enough that the scoreboard was not spoiling the action by being ahead, or unrelated to the action by being too far behind.

Many bugs occurred when relying on an external API to generate the JSONs needed for displaying data. ESPN is often missing games or details for leagues such as NCAA women’s hockey, which are not nearly as popular as the NFL.. For these less popular leagues, the pre-game and post-game results may be shown, but ESPN does not show live, in-game scores. Errors were handled well, allowing top-notch performance and reliability. Default values were assigned when parsing JSONs, so the script would never exit. Furthermore, if the user selected a team that was not found in the JSON, the scoreboard simply displayed the first competition in the list for the selected sport and league.

Taking photos of the system was surprisingly difficult. Though impossible to see with the naked eye, the LED Matrix does not light up all LEDs at the same time (Figure 10). There is flicker that can only be detected with a camera, so the only way to take good pictures of the Matrix was to decrease shutter speed for a longer exposure. All photos taken make the Matrix look worse than it does to a real-time observer.

Figure 10
Short exposure photo of LED Matrix revealing how the entire matrix is not lit up in any given instant. This flicker is not detectable by the naked human eye, but makes photography of the scoreboard difficult.
Figure 10
Short exposure photo of LED Matrix revealing how the entire matrix is not lit up in any given instant. This flicker is not detectable by the naked human eye, but makes photography of the scoreboard difficult.

Testing Hardware: Testing the hardware involved wiring everything up and seeing if the Matrix would display simple text. Initially, one source gave incorrect information, saying Pin 12 on the LED Matrix should be connected to GND. This wiring is only true for 32×16 LED matrices. For the larger 64×32 matrix, connecting this pin to GND resulted in the bottom half of the matrix being dark and the top half working perfectly. After changing Pin 12 to GPIO 20, this issue was resolved.

Testing Software: Testing the Matrix Object involved displaying random text and images in various sizes and colors. One issue encountered with resizing images was heavy aliasing when downsizing an image to just 20×20. Using the Python Image Library, the “resize image” function was edited to include Bicubic Interpolation. This created smoother and more visually pleasing images on the tiny LED Matrix screen.

To test the various scoreboard states, JSONs were downloaded from the ESPN API, instead of being pulled from the API in real time. This hack kept all parameters static, so modes could be tested and verified without values changing. Bugs occurred when certain states, such as overtime or a missed field goal, were not originally accounted for in the code. All cases were slowly encountered after weeks of keeping the scoreboard running while watching sports.

CONCLUSION AND FUTURE WORK

The goal of bringing the excitement of an in-person sporting event to the comfort of the home by means of a miniature scoreboard was met. The scoreboard pulls live scores from ESPN API and displays them in real time to be viewed at a glance. The user can select from over 200 different teams across three different sports with the use of an intuitive touchscreen GUI. The user can also choose to cycle through all teams of a given sport and league or teams in a specific conference. The user can then watch one game on television, while keeping up to date with other games being played at the same time.

At first, I tried using a 32×16 LED Matrix for this project; it has just one-fourth the number of pixels as the 64×32 matrix. The smallest dimensions to make a 26-character alphabet is 4×6, so it was only possible to display eight characters on one line and less than three lines of text total [5]. Therefore, it was necessary to use the larger 64×32 matrix. A higher resolution matrix was considered but did not line up with the goal of this project, to bring a retro scoreboard feel to the home environment.

This project uses very little computation and memory from the Raspberry Pi 4. One hardware improvement to lower cost would be to replace the $35 Raspberry Pi 4 with a $15 Raspberry Pi Zero W, and verify that the system still works as expected.

One software feature that would be nice to include is to allow the user to rotate between a custom list of teams from various leagues. Although the system currently allows the user to rotate between different games in each league, such as rotating through Ivy League basketball, the system does not allow for customization. The proposed feature would allow the user to add teams to a list to be rotated through, such as all sports teams from a given city or university. Expanding the list of supported sports to include soccer, tennis, and baseball would be a welcome addition as well.

Finally, I wish I’d had time to add a speaker to the system. To more closely mimic in-person sporting events, a siren could go off whenever a goal is scored in hockey, and cheering or the team’s anthem could be played whenever a touchdown is scored in football. This feature would require both hardware and a software additions.

RESOURCES
Adafruit Industries | www.adafruit.com
Pygame, “pygame v2.6.0 documentation – pygame.display,” https://www.pygame.org/docs/ref/display.html

REFERENCES
[1] Adafruit Industries, “Adafruit RGB Matrix Bonnet for Raspberry Pi,” https://learn.adafruit.com/adafruit-rgb-matrix-bonnet-for-raspberry-pi/?view=all
[2] Adafruit Industries, “Raspberry-Pi-Installer-Scripts,” https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/main/rgb-matrix.sh
[3] A. Easwaran, “ESPN hidden API endpoints,” https://gist.github.com/akeaswaran/b48b02f1c94f873c6655e7129910fc3b
[4] J. Skovira, “ECE 5725 Lab 3,” 2023. Lab 3_Fall2023_v1.pdf
[5] R. Pointer, “A very tiny, monospace, bitmap font,” https://robey.lag.net/2010/01/23/tiny-monospace-font.html

Code and Supporting Files

PUBLISHED IN CIRCUIT CELLAR MAGAZINE • SEPTEMBER 2024 #410 – Get a PDF of the issue

Keep up-to-date with our FREE Weekly Newsletter!

Don't miss out on upcoming issues of Circuit Cellar.


Note: We’ve made the Dec 2022 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

Would you like to write for Circuit Cellar? We are always accepting articles/posts from the technical community. Get in touch with us and let's discuss your ideas.

Sponsor this Article
+ posts

Tyler Bisk (tylerbisk@gmail.com) is a recent graduate of Cornell University, where he studied Computer Science and Computer Engineering.  He has a passion for coding and especially loves consumer electronics, embedded systems, and robotics.  Tyler spends his free time cooking, skiing, and watching sports using his live scoreboard.

Supporting Companies

Upcoming Events


Copyright © KCK Media Corp.
All Rights Reserved

Copyright © 2026 KCK Media Corp.

Retro-style Miniature Sports Scoreboard

by Tyler Bisk time to read: 12 min