I created a smart sports rebounder using 4 x accelerometers with an ESP32 microcontroller and a neural network to locate soccer ball bounces
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
Enclosure Rear Panel Drawing.pdfAdobe Portable Document Format - 140.32 kB - 04/14/2023 at 19:53 |
|
|
Enclosure Front Panel Drawing.pdfAdobe Portable Document Format - 140.41 kB - 04/14/2023 at 19:53 |
|
|
Rebounder_Accelerometers_Project.pdfKiCAD SchematicAdobe Portable Document Format - 150.04 kB - 04/14/2023 at 19:53 |
|
|
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.
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!
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.
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.
The #18 black Nylon net was a custom order, and the frame size was designed to both accommodate the net and also easily fit in my car. I used continuous bungee cord to allow the net to spring back, but individual bungee cords or metal springs would have sufficed as well. I initially planned to take advantage of the mechanical response of bungee cord in order to provide an optimal ball bounce - that's a topic I may cover in a future article. I tested the mechanical response of shock cord samples for different diameters from different vendors, and I ultimately decided on this 1/4" diameter shock cord.
I made a cover for the rebounder made from 210 Denier black coated Oxford nylon fabric with 1/8" small-diameter bungee cord around its outer edge. I marked and cut the fabric with scissors, laid the bungee cord around its outer edge, folded and then sewed the fabric edge using a Brother SE600 sewing machine - I bought this machine because it also does multi-colored embroidary, which I utilized for another project. Along the top edge of the fabric cover, I used a hammer + hole punch with a metal grommet to mount the front-facing RGB LED using this plastic retainer. The inner edge of the fabric cover is reinforced using 4 x strips of 1-inch wide Nylon webbing, which I sewed in place. The center of the net features a target ribbon held end to end with adhesive hook and loop.
For extra cushioning, I cut 1-1/2" lengths of Buna-N foam tubing and added it onto the corners of the frame. For indoor testing, I designed and 3D-printed these anti-slip clips with double-sided tape on the underside. For outdoor testing, I created these 3D-printed stakes that are pressed into the ground. Because the rebounder uses accelerometers to take measurements regarding the ball impact, it's important that the frame remains stationary during use, and that it doesn't tip or slide.
All 3D-printed files are available on my Thingiverse page!
The 4 x MPU6050 accelerometers are mounted equidistant from the center of the rebounder net, each using a 3D-printed mount with zip ties. Each accelerometer is attached to its mount using 2 x M2.5 screws that self-tap into the 3D-printed plastic. Although the MPU6050 is admittedly antiquated, they turned out to be sufficient for the machine learning aspect of this project. Each accelerometer is connected to the control PCB via its own cable consisting of 4 conductors for power (3V3), ground, SDA and SCL for I2C communication protocol.
I soldered the cable wires directly to the accelerometer breakout board's header pins, and reinforced the connection with black hot glue. For the next version of this project, I would replace the 3D printed mount and the breakout board with a dedicated PCB of the same shape and zip tie it directly to the net. I would additionally a dedicated cable connector directly to that PCB to minimize the risk of wire and solder joint damage.
First, I verified the circuit using a solderless breadboard with an ESP32 dev board and a TCA9548 breakout board. After verification, I selected an appropriate enclosure, and designed a dedicated PCB to fit inside it:
The custom PCB consists of the following:
The PCB is a simple 2-layer board. Several LEDs indicate whether or not the unit is powered, and if serial communication is taking place. A future design may also include indicator LEDs for each of the accelerometers to show that they are receiving power and communicating with the board. The cables leading out to the accelerometers and their solder joints are at risk of damage from soccer ball impacts, which would make such indicator LEDs useful for debugging in case a connection got damaged.
The PCB is powered via its USB-C connector. A USB cable connects to a PC which runs the machine learning script and logs the ball impact data. The next version of this project may utilize the wireless capabilities of the ESP32 and include a battery so that the USB cable is no longer necessary.
The bill of materials (BOM) for the PCB components from the vendor Digikey can can be found at this link if you'd like to order all the components. Convenient, eh? I included a few extras of the more sensitive components (e.g. FT231XS) in that list, in case you need a spare.
The schematic for the PCB is below. I use KiCAD for my PCB design work - it's open source and I highly encourage anyone interested in learning to check it out! Digikey has an excellent introductory video series here for those interested learning this software and creating their own PCBs. I highly recommend it.
Below is the layout for the PCB. I designed it to fit inside the Hammond 1593 black ABS enclosure. I chose this enclosure due to its size, and because it has two removable panels which can be modified to pass cables through. I 3D-printed replacement panels with cutouts for the rear RGB LED, USB-C cable connector, and the cables leading out to the accelerometers on the net. I modeled the panels in Fusion 360 and printed them on my Voxelab Aires 3D printer, which I've found to be a solid entry-level FDM printer.
The enclosure panels can alternatively be machined on a CNC or manual mill, or laser-cut if a suitable alternative material is used (ABS emits cyanide gas and tends to melt if laser cutting is attemped - acrylic or polypropylene would be suitable alternatives.)
Create an account to leave a comment. Already have an account? Log In.
Andrew thanks for your feedback. Great idea to route the wires inside the frame - I used EMT conduit simply on the basis of cost. Do you happen to know of any standard ways to protect the cut edges of the conduit from corrosion?
The PCB enclosure additionally has slots in the bottom panel to allow the beeper to be heard. If I close those up to improve weather resistance, I assume there aren't any design tricks for making that beeper sound louder aside from utilizing a more powerful beeper?
Interesting, but I'm confused about what you mean by "bounces." Is this predicting where the ball will end up after it bounces off the net? Or are you trying to pinpoint where on the net the ball impacts? I think it's the latter, probably because it makes more sense to me.
Hi Dan, yes that's correct, I intend to locate where the ball impacts on the net. Although I did have that idea as well, i.e. to infer the exit velocity vector for the ball after bouncing off the net to have an idea of where it would land (for the simplified case of flat ground, no wind, etc.)
Become a member to follow this project and never miss any updates
By using our website and services, you expressly agree to the placement of our performance, functionality, and advertising cookies. Learn More
Cool project, utilising different I suppose unconventional techniques and materials.
Why utilise EMT without routing the wires through it? You will have to think of waterproofing if in that environment and making sure there are drain holes etc. Plus what way is it treated against corrosion, that’s a point to consider when cutting etc.