AI Goal Tracker

by NazarTuruta in Circuits > Raspberry Pi

26 Views, 2 Favorites, 0 Comments

AI Goal Tracker

Nazar_Turuta_AI_Goal_Tracker_poster_without_QR.png

AI Goal Tracker is a football goal detection system designed to automatically detect and count goals and store match history. The system uses two goals with two cameras mounted on them. Images from the cameras are sent to a Raspberry Pi 5 for the processing in real time by trained computer vision object detection AI model.

When the model detects a goal, it automatically plays a sound, shows the current score on the LCD Display, and update the scoreboard in the web interface. Users can add own their own teams, create matches with a custom duration, and pause the game. After the match, users can open the match history.


The main aim of the project to provide a portable, user-friendly, AI powered system for the players, without the need for a person to keep score manually.

Supplies

esp32_cam.jpg
powerbank.jpg

Bill of materials + my own router MikroTik hAP ac lite , Raspberry Pi 5 and Freenova project board

Images

Building the Football Goals

folded_gates.jpg
gates.jpg
photo_2026-06-15_09-24-41.jpg
photo_2026-06-17_17-09-17.jpg

For this project you need 80 screwes 3,5 x 25, 16 metal corners, 4 hinges, net.(Check blueprint in Images )

Building the Main Control Box

empty_main_box.jpg
main_box_photo.jpg

The laser-cut enclosure I've did from the 4mm multiplex. The main box include ports: power supply, LCD display,RGB LED , Button, ventilation. After the laser-cut , I used glue , to attched all side exept top side.Images

Wiring the Electronics

esp32_cam.jpg
breadboard_scheme.jpg

After I created my soccer goal, I connected the ESP32 Cam to my laptop via a router and started collecting data.

On the Breadboard I've created scheme with LCD Display,Button,Buzzer and RGB Led.

Roboflow Annotation

labeling.png

Collecting the dataset might take not a one day moreover you need to label it. It take me a 1 hour for 150 images, in final dataset I have 750 images.

I have 5 classes:

Ball inside the goals

Ball outside the goals

Ball on the goalline

Goalline

Net

check image Roboflow annotation

Backend

For this project, I had to create a database and an API to enable communication between the backend and the frontend.

For the database, I chose PostgreSQL and used Adminer as a web-based database management tool. The database consists of four main tables: Team, Match, Goal, and Pause. These tables store all the information required to manage teams, record matches, track goals, and save match pauses.

Frontend

gradio_match_page.png

The frontend, just like the AI model, is one of the most important parts of the project. It represents the project and provides the main way for users to interact with the system. A well-designed and user-friendly interface makes it easy to create matches, manage teams, view the live scoreboard, and review match history.

For this project, I used Gradio to create a simple and intuitive web interface. Gradio made it possible to quickly develop a user-friendly web application that communicates with the backend and allows users to control the AI Goal Tracker from any device with a web browser.

Running the AI Goal Tracker

To start the system, plug in the power supplies for both the router and the Raspberry Pi.

Look at the LCD display on the main control box. About one minute after powering on the system, the IP address will appear on the display. Open a web browser on a device connected to the same network and enter the displayed IP address into the address bar to access the AI Goal Tracker web interface.

Using the System

gradio_match_page.png

At the About page you may read how to use the interface:

  1. Create teams
  2. Set match duration
  3. Start/Pause/End a match
  4. Review match history
  5. System/degug page