top of page

Accuracy-Sensing Smart Sports Rebounder with ESP32

Updated: Apr 16

Foreward

I created a smart sports rebounder using 4 x acceleration sensors (accelerometers) with an ESP32 microcontroller and machine learning (neural network) to calculate and log a soccer ball's bounce position. This article touches on different aspects of mechanical, electrical, and software engineering, which, when utilized together, can create powerful results! I hope you find this open source project educational and informative.


[Demonstration video link is forthcoming.]


ESP32 Accuracy Sensing Sports Rebounder
ESP32 Accuracy Sensing Sports Rebounder


Article sections

  1. Introduction

  2. Supplies

  3. Mechanical Hardware

  4. Electrical Hardware

  5. Microcontroller Programming

  6. Machine Learning

  7. Structure

  8. Training

  9. Result

  10. Real-Time Operation

  11. Conclusion


Introduction

Most sports projects and commercial products utilize a vision system when they want to track the position of a ball, for example in this project by Youtuber Stuff Made Here, where he created a moving basketball hoop that doesn't let you miss a shot.


Such systems are inspiring and impressive, but most require a vision system to track the ball's flight path. If the camera lens gets wet, dirty, or obstructed, or if the lighting is insufficient, this can affect the tracking results. I wanted to build a sports training tool that (1) doesn't require a vision system, (2) can be used at night, and (3) can be implemented with a low-cost microcontroller. Sports rebounders are perfect candidates for such a tool, because the meaningful training data has to do with the impact of the ball, not its flight through the air.



Rebounders are simple and self-explanatory - you throw or kick a ball at a springy backboard, and the ball is rebounded back to the player. The vast majority of rebounders on the market today don't provide measurements or feedback to the player. The closest thing I've found to a non-vision based bounce tracking system is this commercial trampoline system, which uses a proprietary algorithm/calculation to identify bounces.


The idea I wanted to try for myself is to mount 4 x accelerometers on a rebounder net. These types of sensors output the acceleration along 3 x axes, as well as the rate of rotation about those 3 x axes. I could have tried collecting the acceleration data and then teasing the ball landing position out from it using a closed-form equation or algorithm, but given their rise in accessibility in the last few years, I realized that machine learning would be perfect for this application.


Accuracy-Sensing Smart Sports  Rebounder Diagram
Accuracy-Sensing Smart Sports Rebounder Diagram

Neural networks are one such type of machine learning - they are based our understanding of how neurons in the human brain are believed to operate, and they excel at modeling relationships between input (the accelerometer data) and output (any information we want to learn about the ball impact.) In the end, this machine learning structure was able to infer the soccer ball landing position with surprising accuracy!


Disclosure: Some of the links in this article are affiliate links. This means that, at zero cost to you, I will earn an affiliate commission if you click through the link and finalize a purchase.


Supplies

  1. 1 x Telescoping coupling/clamp for 1/2" to 3/4" EMT conduit

  2. 1 x 3-foot piece of 1/2" EMT conduit

  3. Roughly 18 feet of 3/4" EMT conduit

  4. 12 x 3/4" EMT conduit end-to-end metal connectors

  5. 1 x 3/4" EMT conduit bender tool

  6. 1 x Rotary cutting tool

  7. 1 x Rotary deburring tool

  8. Various bolts (1/4"-20 thread, #2 self-tapping, etc.)

  9. 2 x Metal bracket with 2 mounting holes

  10. 2 x Metal bracket with single mounting hole

  11. 1 x 18 thickness black Nylon net with rope border, 15 rows x 15 columns with 1-1/4" squares

  12. 60 x #8-32 rivnuts (rivet nuts)

  13. 60 x #8-32 thread, 1-7/8" length J-bolts

  14. 1 x 2-foot length of Buna-N foam tubing

  15. 1 x Rivnut (rivet nut) installation tool

  16. 1 x 25 feet of black elastic shock cord, 1/4" diameter

  17. 1 x 100 feet of 1/8" diameter black elastic shock cord

  18. 2 x Yards of 210 Denier black Nylon coated fabric

  19. 1-inch wide Nylon webbing

  20. 1 x Black metal grommet

  21. 1 x Grommet installation tool and punch

  22. 1 x USB-C cable

  23. 1 x Pack of assorted colored zip ties

  24. 1 x ESP32-based custom PCB (bill of materials included below.)

  25. 1 x Hammond black ABS enclosure for the PCB, part number 1593LBK

  26. 2 x Common-anode 5mm RGB LEDs

  27. 2 x 5mm LED holder

  28. 4 x MPU6050 accelerometers

  29. 1 x ST-SM cable-to-cable assorted connectors

  30. 1 x JST SM crimper tool

  31. 28AWG wire, various colors

  32. Laptop or PC to run Python scripts

  33. 1 x USB Webcam

  34. 1.75mm black PLA filament

  35. (Optional) 1 x Voxelab Aries FDM 3D printer (or equivalent FDM 3D printer)

  36. (Optional) - Brother SE600 Sewing and Embroidary machine (or equivalent sewing machine)


Mechanical Hardware

I created the rebounder frame out of cheap and readily-available metal tubing called EMT (electrical metallic tubing) conduit, which is typically used by electricians for construction wiring, but has grown increasingly popular in recent years for home projects. I cut the tubes to length and removed their sharp edge (deburred them) using a rotary deburring tool for the inner diameter (ID) and a hand file on the outer diameter (OD.) I used a conduit hand bender tool to make the corners. These 3/4" conduit pieces were connected end-to-end using metal set screw couplings.



On the rear of the frame, I used 4 x U-shaped metal hinges plus shoulder bolts to allow the frame tilt angle to be set. A center pole made from 1/2" conduit and 3/4" conduit utilizes an EMT conduit telescoping coupling to lock the tilt angle. This coupling is available in my online store, with free shipping available for all orders in the USA. Shipping to Canada is also available. To ensure all pieces would fit together, I modeled the PCB, enclosure, and EMT conduit telescoping pole using Autodesk Fusion 360. The CAD model render is below, along with the actual assembly.


ESP32 PCB, Enclosure and EMT Conduit Telescoping Pole
ESP32 PCB, Enclosure and EMT Conduit Telescoping Pole

PCB Enclosure on EMT Conduit Telescoping Pole
PCB Enclosure on EMT Conduit Telescoping Pole

I drilled holes in the sides of the front frame using a cheap drill press, installed rivet nuts (rivnuts) using this tool, and then threaded metal #8-32 thread, 1-7/8" J-bolt into them, locking the position with an extra nut. These hooks are used to hold the elastic shock cord (bungee cord) which loops through the outer edge of the net.