Gesture Sensing Moving NBA Ray Allen Desk Toy
by barnesmq in Circuits > Gadgets
335 Views, 2 Favorites, 0 Comments
Gesture Sensing Moving NBA Ray Allen Desk Toy

This build is an interactive picture of Ray Allen's famous shot in Game 6 of the 2013 NBA finals. When an upwards gesture occurs in front of the build, the basketball travels from Allen's hand into the basket and once the ball reaches the basket, the sound of the famous highlight will play. Once it is over the basketball will return to its original position, waiting for another upward gesture to occur.
Supplies
Materials
Acrylic for laser cutter
screws x4
nuts x4
washers x4
Small Alligator Clip to Male Jumper Wire Bundle x3 in each x3
Tape
Cardboard
USB Data cable (USB A to Micro B)
Tools
Box cutter
Laser Cutter
Drill
Hot glue gun
The Base



The first and perhaps most difficult part of this build will be creating the 3 base layers required. 2 layers are acrylic and one is a paper picture of the scene. Decide how big you would like your desk toy to be and laser cut 2 pieces of acrylic to size. My build was 10.25"by 8.75". Similarly, print the picture to this size as well. Next, you must map the arc of the ball to be laser cut into the acrylic on both pieces. I did this by measuring the position of Ray Allen's hand in the picture and the hoop. I then used Trotec, a laser cutting program, to map the arch from each of these positions and make the cut. Once cut, place the acrylic layer over the picture to make sure the arc lines up, and use a box cutter to carefully cut that part out of the picture. Also, laser cut a small ball that will serve as the basketball that moves along the build. You will also need to drill 4 screw holes in the 4 corners of each layer.
Attaching the Servo



On the back of the bottom acrylic layer place the servo at the midway point of the arc and ~5" down. Next, cut a skewer and hot glue it to the servo attachment . Also, make sure to print and cut a basketball the same size to glue to the top of the acrylic ball.Hot glue the acrylic ball to a 2" wire and then hot glue 1" wood skewer piece to the end of the servo attachment position down just above the arc. The wire attached to the ball will be hot glued to this skewer piece once the layers have been put together and screwed in. Also, hot glue two pieces of cardboard to the back of the base layer to act as support to prop up the build.
Connect the Layers
Once you have completed the previous steps, line up the picture properly between the two acrylic layers and insert the screws into position. Add the washers and nuts to secure it in place. Now flip the build over after feeding the ball wire through the hole for the arc, connect it to the skewer attached to the servo with hot glue. This will be what moves the ball back and forth. Also, attach the gesture sensor facing outward by attaching it to the base layer. I choose to attach mine on the left side, but it could be attached on any side. This can be done with duct tape or hot glue.
Wiring

Now you are ready to connect your build to the Circuit Playground Bluefruit. Connect the Servo to A1 (Yellow), GROUND (Brown), and VOUT (Red). The gesture sensor to GND (Black), SCLA A4 (Yellow), SDA A5 (Blue), and 3.3V (Red). The speaker should be connected to GRND and A3.
Code
Download the code below on your Circuit Playground Bluefruit through Circuit Python on your laptop or desktop with it connected to you computer using the data cable mentioned in components. If you need help installing circuit python and downloading the file visit this Tutorial. Make sure to save you file as code.py to your Circuit Playground.
You will also need to download your highlight audio and convert it to an mp3 or wave file. This can be done with the application Audacity and for those who are unfamiliar with Audacity you can watch this Tutorial. I captured my audio via Youtube and converted to a wave file in Audacity.
Downloads
Video Demo
