Skip to main content
Version: ACS CC

Smart Hoop

A smart basketball hoop powered by a Raspberry Pi Pico 2W and Rust.

info

Author: Radu Andrei-Laurențiu
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-andreilaurentiuradu

Description

A smart basketball hoop built on a Raspberry Pi Pico 2W, using the Rust programming language and Embassy async framework.

Features:

  • Ball trajectory detection using 3 ultrasonic sensors
  • Real-time shot quality feedback with RGB LEDs
  • Score counter on a 7-digit display

Motivation

As a sports enthusiast and basketball fan, I wanted to create a project that helps players improve their shooting accuracy. This smart system provides instant, data-driven feedback to optimize performance during training.

Architecture

Processing Unit: the Raspberry Pi Pico 2W interprets sensor data, decides on shot accuracy, updates score, and controls visual feedback.

Feedback Layer: includes the RGB LEDs and the 7-digit display to provide immediate, local feedback.

Communication Layer: the built-in Wi-Fi module transmits shot statistics to an external device for visualization or analysis.

Data Acquisition Layer: composed of ultrasonic sensors, which collect real-time data after each shot.

Flow Summary:

After a shoot, the sensors will send the data via WIFI to PC for processing. If the ball goes through the hoop, the score increases on the display. Based on the shoot, the RGB LEDs will show one of the color:

  • green for a perfect one
  • yellow for a good one
  • red for a fail

Block Scheme

diagram

Log

Week 5 – 11 May

TO DO

Week 12 – 18 May

TO DO

Week 19 – 25 May

TO DO

Hardware

The Raspberry Pi Pico 2W serves as the core controller, interfacing with the sensors and peripherals.

  • IOE-SR05 Ultrasonic sensors : measure the distance between the ball and the rim to analyze the trajectory.
  • RGB LEDs : light up based on shot accuracy (e.g., green for perfect, red for miss).
  • 7-digits display : increments the score when a basket is made.
  • Wireless module(built-in): sends data to a PC or mobile device for further analysis.

Schematics

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2Microcontroller40 RON x 2
Small basketball hoopSkeleton65 RON
JumpersConnectivity8 RON
IOE-SR05 Ultrasonic Distance Sensor with Serial Interface (3 - 5.5 V)Getting data20 RON x 3
74HC595 2 Digits 7 Segment LED Display ×9Visual display9 RON
RGB LEDSFeedback for Player50 RON

TOTAL: ~210 RON

Software

Crate / ToolRole in ProjectDescription
panic-probePanic handlerProvides minimal panic messages compatible with defmt
defmt + defmt-rttLogging frameworkUsed for real-time debug output over RTT, ideal for embedded systems
rp-picoBoard support crateHardware abstraction for the Raspberry Pi Pico 2 (RP2040 chip)
embedded-halHardware abstraction layerUnifies access to GPIO, I2C, PWM, and other peripherals across MCUs
embedded-graphicsGraphics libraryRenders text and shapes on OLED displays
fugitTime utilitiesManages time-based tasks like LED blinking and debouncing
embedded-nalNetworking abstractionDefines traits for network communication (TCP/UDP) over Wi-Fi modules
esp-idf-sys / arduino-rsPlatform support cratesEnables wireless networking and board support for ESP32 or Arduino
serdeSerialization/deserializationConverts score and analytics data to/from formats like JSON
reqwest / rumqttcNetwork clientsSends data to servers using HTTP or MQTT
nalgebraMath and linear algebraUsed for trajectory estimation and analytics (e.g. angle, velocity)
  1. Connect ultrasonic sensors
  2. RGB LED - Raspberry Pi Pico
  3. Connecting To The Internet With The Raspberry Pi