Hardware project
Goal Detector System
A system I built for my nephew that detects when the ball goes into the goal, shows "GOAL" on screen and plays a goal sound.
- Arduino
- C++
- Python
- Kivy
- pygame
- HC-SR04

About the project
What I built and how.
An HC-SR04 ultrasonic distance sensor sits in the goal. The Arduino Uno measures the distance constantly, and when the ball passes and the distance drops below 40 cm, it sends a "GOAL" message to the computer over serial.
On the computer, an app I wrote in Python listens to the serial port. When the message arrives, "GOAL!!!" flashes on screen and a goal sound plays. I designed the circuit in Tinkercad first.
Highlights
- 01
Ultrasonic detection
The sensor works out distance from the echo time; the threshold can be tuned to the size of the goal.
- 02
Serial link
The Arduino and the computer talk over a 9600 baud serial connection.
- 03
Goal screen
A full-screen interface built with Kivy and a goal sound played with pygame.