Arduino Mini Arcade Basketball Hoop - Final Project
by connorskorge in Circuits > Arduino
1447 Views, 0 Favorites, 0 Comments
Arduino Mini Arcade Basketball Hoop - Final Project
What's up!
This guide will give you an overview on how I made my own mini arcade basketball hoop using the Arduino Nano RP2040 Connect, and how you can make your own as well! This hoop is a standard over-the-door mini hoop, but with a fun upgrade. When first turned on, the backboard LEDs flash a red light animation, the speaker plays an arcade basketball tune, blows the whistle, and you're off! When the ball passes through the basket, it is sensed by the APDS-9960 sensor and plays a randomized sound like "What a shot!" and "2 points!" while flashing a red, yellow and gold light animation.
I'm a huge fan of shooting some casual hoops in my dorm room, so I figured: why not get the crowd involved and spice up the game a little?!
Supplies
- Arduino Nano RP2040 Connect
- Arduino pin board
- Arduino pin board wires
- Stemma QT Adafruit APDS-9960 sensor
- Over-the-door mini basketball hoop
- LED strips/lights
- Electrical tape
- Velcro Command strips
- Alligator clips
- Auxiliary port mini speaker
- Mirco-USB power bank
- Mu Editor Application
- CircuitPython
- Speedy 360 flexx - Trotec Laser
Assemble Basketball Hoop and Design Project
For this project, I ended up buying a new over-the-door mini basketball hoop (I used this one from Dick's Sporting Goods). Out of the box, there was a little assembly required, but nothing major. After assembling the hoop and taking a few practice shots, it was time to start thinking about the design.
I originally wanted to tuck my Arduino and speaker behind the backboard, but because the backboard hangs flush against the door, this was not possible. So, I drew up a rendition that could house everything I needed (Arduino + board, APDS-9960 sensor, speaker, LED strip) on the front side of the backboard, without interfering too much with the play area.
Arduino Coding!
After creating solid plan, it's time to code!
For my sounds, I edited mp3 files on the Audacity application to create 5 different .wav files. The first file sounds like the start-up tune of an arcade basketball hoop. The other 4 are reaction sounds to baskets being made-- "What a shot!", "2 points!", "3 points!", and "[crowd cheering]".
Once your sound files are set, you can begin coding! I have my code (and sounds) linked to this step!
I created 2 functions--one that commences at the start of the game and one that activates whenever a basket is made. The sensor can detect anywhere from 1(farthest, only a couple inches away) to 255 (closest) proximity pulses, so I set a threshold such that if an object was closer than 1 proximity pulse away from the sensor (i.e. a ball passing through the basket), the reaction function would activate.
Tip: be sure that your speaker, LEDs, and APDS-9960 sensor are connected to the correct pins on your breadboard. I've attached an Arduino diagram and there is additional information in the linked videos!
I have additionally linked a couple of Prof. G's YouTube video tutorials, which were a HUGE help to me while configuring the audio files and APDS-9960 sensor. Check 'em out! He has some awesome videos that showcase additional Arduino capabilities and so much more!
Physical Assembly
After finished coding, start putting all the pieces together! I needed my Arduino and all of its connections to be safe, so I designed a small box that would house the microcontroller and keep all of its attached pieces safe when shooting hoops. My speaker is outside the box, but I would recommend creating a box large enough to keep everything safe! To create the box, I made a design and communicated with our MakerSpace TA, Kevin, to create a vector file that could be printed on the Speedy 360 flexx Trotec Laser.
After glueing my laser-cut box together, I used velcro Command strips to attach everything to the backboard. You can use any sort of adhesion method, but I used the Command strips in this case for a clean removal of parts after assembly. My APDS-9960 sensor is located just below the rim so that it remains unharmed but is still close enough to sense objects going through the basket. I additionally wrapped by LED light connections in electrical tape to ensure a secure link.
And just like that, congratulations! You now have your own Arduino mini arcade mini basketball hoop. Have fun shooting hoops, with the crowd and lights by your side!