# BallerStats

1,751

18

3

created by OASIS (Omid, Amol, Shikhar, Information Systems)

## Step 1: Objective

Our hope is to create an automated stats collector during a basketball practice session. This could be used for all ages and on most courts. Our approach of finding a project was finding something that people do, that could be replaced by a machine. People are still needed to be statisticians so we hope that this type of system could replace that job. We aim that with the use of these particular sensors, it could calculate shots taken and shots made. We plan to put sensors on the backboard to record the number of shots taken and shots made. This information will be shown on an app and the app will receive the information via bluetooth. This app will display the indication if a shot was taken and a shot was made.

## Step 2: Acquiring All the Parts

Before assembling and coding for this project, we had to acquire all necessary materials for this device to work. The PIR Sensors are the two sensors being used to detect if a shot was taken and if a shot was made. The PIR, without a tape covering, will be placed on the top of the backboard looking down. This sensor is the one that detects if a shot was taken since it covers 180 degrees so it will detect if a basketball is around the basket. The PIR with the tape covering will be placed below the net and will detect if a shot was made. The next item is the BLE Shield which has bluetooth capabilities, allowing us to integrate the date received from the sensors into the app. Lastly, we are using the Arduino Uno which connects the software we are using and allows us to code. With Arduino, we are able to construct the code and calibrate the sensors so they continuously work.

## Step 3: Coding for Arduino

To calibrate the sensors and receive the data needed, we needed to code in the Arduino software. We had to learn and then use the language C# to code this. The main functions it needed to be able to do is detect if a basketball is around and if the shot was made. We had to set parameters of what amplitude the sensors need to detect for it to count it as a shot taken or made. Also we had to include the code for the bluetooth so it will be able to relay the data to another entity. We also inserted a delay in the sensors so the sensors would not count one shot as twice since a basketball was still in the vicinity.

## Step 4: 3D Modeling

Part of the installation of our device on the basketball board, we created a box fixture for the backboard. This is created to hold the the arduino device and have the wires running out of it to the different sensors. We used tape to attach this box to the back of the backboard so it does not interfere with the shot. In order to design this box, we utilized Solidworks 3-D Modeling Software. Once the CAD was finished, we printed the box using a Masterbot 3D Printer.

## Step 5: Switch (Power Source)

We had to create a switch for our system to start and stop on the person's command. We had to strip wires and connect them to longer wires in order for the switch to reach the player from the backboard which is 10 ft. high. We had to put a middle wire which is around 6 ft. In order to successfully have the electricity run through all the wire, we had to solder the copper wires together. Then we had to insulate the open wire with a shrink wrap as a safety hazard.

## Step 6: Code for the App

We used Apple's XCode software in order to create the app, BallerStats. We integrated a code from an open source app called BLE Shield by RedBear Labs in our custom application. This provided the bluetooth capabilities needed for our project. We also used PhotoShop in order to create our custom logo for our group, OASIS. Finally, we were able to rename the shield itself using both the Arduino-Side code as well as the Phone-Side code.

Here is a link to the code we worked off of from RedBear Labs:

https://github.com/RedBearLab/iOS/tree/master/Exam...

## Step 7: Installing the Hardware

This is the final step, installing the sensors and arduino box to the basket. In the pictures shown, we can see that we used tape to attach the box to the back of the basket and tape to position the wires on the outsides of the basket. The arduino box is fully mounted and the sensors are positioned with one sensor on the top of the basket and under in order to record shot taken and shot made. Also the switch would be attached to the arduino box for power and then the wire comes out toward the side to be able to switch it on and off.

## Recommendations

• ### Large Motors Class

11,459 Enrolled

## 3 Discussions

Nice project! Suggestion; after the sensor has registered an attempted shot, wait one second before reporting it. If during that second a goal is made then only report the goal. In this way you easily can see the number of failed shots without mixing them with shots that turned into goals. Just an idea, good work!