Components and supplies
Apps and online services
About this project
I use to do basketball training workouts regularly and I 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 to 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.
VersionsAt the beginning of the project, I used the hardware components I had available at home and developed the software (Arduino and Android) needed. This first version (1.1.0) proved to work pretty well so I decided to make some changes to use cheaper components and to implement some software improvements too. The second version (2.0.0) is even better, enjoy.
Step 1: ArduinoHardware
You can see the hardware components list for the version 2.0.0 in the Things section.
These are the main changes made from version 1.1.0 to version 2.0.0:
- 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.1.0 to version 2.0.0:
- 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 signaling thought 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.1.0 to version 2.0.0:
- Change the layout from portrait to landscape.
- Add Light, Humidity, Temperature, and Heat Index.
- Improve the adjust buttons.
- Add feature to keep the screen always on.
- Add press sounds in 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 to 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.
It's time for a smoke test.
Finally, I installed everything on the basketball board.
Step 4: Basketball workout testNow 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...