Gamblers

Project Overview

With the rise in popularity of sports betting, sports viewers do not have enough screens to watch every game and track their bets. Our product will provide consumers with a one-screen system that tracks and updates any stats from all possible games. Our Gambling Screen will leverage API data from SportRadar and display user’s inputted bets to a screen. Subsystems for the project include: a display, lights, sound, the API from SportRadar, and a website. The display will be used to provide a clean UI to easily reference how close bets are to hitting or busting. Speakers and LEDs provide audio feedback and visual feedback on the health of the bet with different sounds playing for different conditions The API from SportRadar is pulled every 10 seconds to update the display screen and view multiple bets.

Project Hardware

The hardware design consists of a single board with a ESP32-WROOM-32E 16MB Flash connected to power via a wall outlet. We selected the WROOM model for its WiFi capabilities that are essential to connect to our website and receive game updates from the SportRadar API. Our board presents a powering scheme based on a MOSFET switch that uses a PMOS transistor and Schottky diode to swap between USB and outlet power to prevent shorts. Additionally, our peripheral devices all use GPIO pin connections to accept commands from our software logic that trigger changes in the devices.

Project Software

To get live scores and player stats, our project relies on SportRadar’s MLB API. Once we know what team or player a person has placed a bet on, we make an API call to find SportRadar’s game ID for that game. Having the game ID allows us to repeatedly call and parse the game’s play-by-play to extract the scores and stats we want. We store these data in a custom “Game” class and update each Game every 10 seconds. Once we are tracking a game, we can retrieve any relevant stat we want to show on the screen.

The website itself is stored on a GoDaddy Web Hosting server. The web server allows us to send information from our webpage to a databse. gamblingscreen.com is a static HTML page that consists of forms for users to enter all of their bets. Once they add the desired bets to the webpage, a AJAX handler sends the bet information to a SQL database. A separate file embedded into the same server, writes all the information from the database into a text file. The ESP32 accesses this information by reading from the text file at the same domain.