The Final Project
8/5/2020 - Made with LabView2019, SystemLink.com, Arduino.cc, Adobe Illustrator, DaVinci Resolve 15, and some office supplies
The final project for our class consisted of making a game that utilizes the skills we've developed over the course of this summer term. I've decided to recreate the classic basketball arcade machine using parts of my Arduino kit, Arduino.cc, SystemLink, and LabView. On top of implementing the software required for this project, the main challenge will be creating a physical casing for all of the components in order for the user experience to run smoothly.
Part 1: Storyboard
The storyboard (made on Adobe Illustrator) is shown below. On the left is a sketch of the entire project. Players place the contraption on a chair or against a wall. To start the game, players first configure settings in LabView, such as the name to be displayed on the scoreboard, and the time allowed. Then they hit the start and and begin throwing the given ball (probably a squash ball or ping-pong ball due to availability) at the hoop. If the ball goes through the hoop, the ultrasonic sensors (shown in turquoise) detects the object and ticks up the player's "score". The ball slides down the chute back towards the player for retrieval. The LED will flash on each successful point. As the timer runs, a servo motor will control a timer arm (shown in red) that will slowly tick down. Once time runs out, the player's score will be displayed on a SystemLink dashboard, along with the current record score.
Please ignore the terrible storyboard name :)
Part 2: Physical Construction
Due to the planning done with the storyboard above, construction was fairly straightforward. I was able to procure a few large thick sheets of cardboard, as well as the core of a roll of packing tape. This core was the "basket", as it was a good size for the ping-pong ball used; it wasn't too small that the shot was impossible, but it wasn't big to the point where the shot was easy.
The ramp was done by scoring a sheet of cardboard and folding it into a pointed U shape. To stop the U from straightening itself out, a rubber band was stretched over the U near the tip of the ramp to act as a clamp of a sort.
In order to keep the front side wire-free, holes were cut in the backboard to threat the wires and parts of the components (servo, LED, touch) through. The timer arm was made by attaching a shortened plastic drinking straw to the controller arm of the servo motor. The LED and touch sensor were friction-fit into holes cut in the backboard.
The ultrasonic was fit into the right side of the ramp through a hole cut in the wall of the ramp. The cardboard covering plate above it ensures that the ball does not bounce above the detection range of the ultrasonic sensor.
I made a video covering the entire construction process accessible here.
There is an annotated picture below pointing out each component of the product
Part 3: Code
Arduino:
The Arduino coding aspect of this project took the longest. Due to the nature of void loop(), I had a hard time figuring out how to make two loops run simultaneously without their individual delays affecting each other. At first, my ultrasonic detection loop was delaying the timer loop, which meant that each successful point scored would gift the player an extra second of playtime. However, thanks to suggestions from classmates, I was able to work around this restriction by having one loop nested in another. The end result is my ultrasonic detection loop running within the timer loop, and having one delay covering both loops.
My Arduino code (with comments) is available here, and is also embedded below.
SystemLink:
To utilize the internet of things, SystemLink was utilized to create a scoreboard. At the end of each round, the player's score is compared to the current record, and if the player's score is higher, the current record is replaced by the new record. This is done with GET and PUT commands in Arduino. View the dashboard I used for testing here.
LabView:
The user interface itself was constructed on LabView. Allows the player to input a username to be associated with their score, and features a live feed of the current record score. It was done simply with 1 write function and 3 read functions.
Download the VI here. Alternatively, view a screenshot of the block diagram here.
The final product turned out pretty well. The player starts off on the LabView, where they input a username. They then push the touch sensor to begin the game, and have a minute to score as many points as possible. After the time runs out, the information is pushed to SystemLink and, if appropriate, the record time is updated. The information is then pulled from SystemLink back down to LabView for the player to see.
The reason I have LabView pulling all the information back from SystemLink is because I didn't want the player to have too many programs open. It would have felt very gimmicky if they had to have LabView, SystemLink, and the physical product in front of them, so I tried to provide a simpler and more minimalistic experience.
If I were to do this again with more time and materials, I would definitely build the physical product out of more robust materials like MDF and some 3D printed parts, but I had to work with what I had. I wish I was able to incorporate some AR aspect to this project, but short of displaying a "live" feed of the player's score (which would probably be running 30 seconds behind anyway), I could not think of proper use for AR.
Overall, this project was tons of fun to design and construct. I was able to utilize a good portion (though not all) of the skills I acquired in this class, and I definitely want to make bigger and more advanced projects in the coming fall semester.
Below is a video documenting the build process with a demonstration towards the end
(same video linked in Part 2)