I do basketball training workouts regularly and always track the sections' statistics (number of shots, scores, misses, etc). Track these numbers is kind of boring and hard to accomplish. The smart balls can be used for this but they have some drawbacks:
- If you want to train with multiple balls you'll need to buy several (expensive) smart balls.
- The accuracy isn't so good.
- The durability of the ball.
In my previous project smart basketball scoreboard prototype, I used the Avnet SmartEdge device to test a method to track my basketball workouts. I used the acceleration sensor to detect the shots and the proximity sensor to detect the scores. Now, the idea of this project is to implement a definitive solution for the basketball scoreboard task.
Versions1.x.x
At the beginning of the project, I used the hardware components I had available at home and developed the software (Arduino and Android) needed. After some tentatives and tests, the first version proved to work pretty well.
2.x.x
With the success of the first version, I decided to make some changes to use cheaper components and to implement some software improvements too. The second version showed to be even better, so I mounted it in a more robust, durable, and "definitive" enclosure. Note: It isn't "professional", but it's very better than the old model.
Step 1: ArduinoHardware
You can see the hardware components list for version 2 in the Things section.
These are the main changes made from version 1 to version 2:
- Arduino Mega 2560 => Changed to Arduino Nano R3
- Bluetooth Shield => Changed to HC-05 Bluetooth Module
- Rechargeable Li-ion Power => Changed to 9V Battery
- DHT22 Temperature & Humidity Sensor => Added.
Some considerations about other components used in this project:
- E18-D80NK Infrared Proximity Sensor: Other proximity sensors could be used in this project, but have in mind that it's better to use one that doesn't suffer from sunlight interference, like this one.
- SW420 Vibration Sensor: Other vibration sensors could be used in this project, this one works really well.
The Arduino schematics for the two versions are available in the Schematics section.
Software
I used the Arduino IDE to develop the Arduino code, programmed with the following strategy:
- After the initialization (variables, LED, Bluetooth, etc) it stays continuously monitoring the status of the sensors.
- If the proximity sensor detects the presence of the ball, it means a shot has just happened and it's a score.
- If the vibration sensor detects some movement, it means a shot has just happened but it waits for 2 seconds (maximum) to make a decision.
- In this time, if the proximity sensor detects the presence of the ball, it (immediately) knows it's a score.
- At the end of the 2 seconds time, if the proximity sensor didn't detect the presence of the ball, it knows it's a miss.
- The Arduino informs the Android through Bluetooth that a shot (score or miss) has just happened.
- The process restarts.
These are the main changes made from version 1 to version 2:
- Change support from Bluetooth shield to HC-05 Bluetooth module
- Add support to DHT22 Temperature & Humidity sensor
- Improve the logic to detect shots, scores, and misses and to better signal through the LED.
The Arduino codes for the two versions are available in the Code section.
Step 2: AndroidI used the MIT App Inventor to develop the Android code, programmed with the following strategy:
- After the initialization (shots, scores, misses, Bluetooth, etc) it waits for the "Start" button to be pressed.
- When the "Start" button is pressed it stays continuously monitoring the Bluetooth connection.
- Every time it receives any data it updates the board and plays the correct notification sound.
- The process repeats until the "Pause" button is pressed.
- There're buttons to select de Bluetooth device, reset the count, and some extra buttons to adjust the board if necessary.
These are the main changes made from version 1 to version 2:
- Change the layout from portrait to landscape.
- Add Light, Humidity, Temperature, and Heat Index.
- Improve the adjust buttons.
- Add a feature to keep the screen always on.
- Add press sounds on all buttons.
- Adds functionality to warn each time the 50-shots mark (50, 100, 150, etc) is reached.
The Android codes for the two versions are available in the Code section.
Step 3: Basketball board setupThis is the original basketball board that I regularly use to do basketball training workouts.
First I removed the plastic cover under the hoop and made a hole for the proximity sensor.
Then I made a small hole to fix the vibration sensor.
I could not attach the sensor directly to the plastic cover due to its curvature so I built a support to the sensor using MDF.
I fixed the proximity and vibration sensors using some bolts and a nut.
Then I connected the other components.
Version 1
Version 2
So it's time for a smoke test.
Version 1
Version 2
Finally, I installed everything on the basketball board.
Version 1
Version 2
Now it's time to test everything.
And the grand finale... it's showtime!
Step 5: Final considerations- The system proved to be very accurate, with very few false positives and rare false negatives.
- It's fantastic to play with the system to know the workout statistics in real-time and after the training.
Have fun...
Comments