Arcade Basketball Machine

Advanced Mechatronic Design

“THE KOBE” Arcade Basketball Machine

TEAM MEMBERS: Yifei Liu, Huy Quyen Ngo, Rajath Ravi

  1. Abstract
  2. Design of Subsystems
    1. Dynamic Components
    2. CAD
  3. Schematics
    1. System Design – General Schematic
    2. Schematic Breakdowns
  4. Bill of Materials
  5. State Machine 
    1. State Machine Diagram
    2. State Machine Introduction
    3. State Machine Table
  6. Code Files
  7. Source Code
  8. Conclusion & Lessons Learned

1. Abstract

For our Advanced Mechatronic Design Project, we have built an Arcade Basketball Machine as a tribute to the late basketball legend Kobe Bryant.

Our machine features two game modes namely Easy and Difficult mimicking the levels installed in a usual basketball arcade game. In both the modes the objective is to basket a ping pong ball through a hoop. In the Easy Mode the hoop remains stationary while in Difficult Mode the hoop moves linearly.

“The Kobe” is made of laser cut wood assembled and fastened together by L brackets. Grooves on the edge of the wood panes are the primary fastening method, L brackets are installed to make the device more sturdy.


For linearly moving the 3D printed hoop, another 3D printed component is attached to it which in turn is actuated by a belt connected to pulleys and a motor. The entire subsystem moves along a linear rail.

The motivation for this project is that we wanted to create something that everybody loves to interact / game with and highlight what engineering is all about. We wanted to highlight that engineering need not be fancy all the time and that creativity stems from small ideas / thoughts.

2. DESIGN OF SUBSYSTEMS

The entire machine is broken down into several subsystems as below –

  1. Outer Casing
  2. Welcome Board
  3. Dynamic System Components
    1. Pulleys
    2. Motor
    3. Linear Rail
    4. 3D Printed Hoop and Parts
  4. Electronic Modules
    1. LED Lights
    2. Scoring
    3. Easy & Difficult Mode Buttons
    4. Phototransistor 
    5. IR Sensor

Outer Casing

The outer skeleton of the machine was designed first in SolidWorks. The envelope of the design is 36’’ in  length, 17.5’’ in width (excluding the LED holder) and 17.25’’ in height (including the hoop shooting board). 

The wooden panels used were 5 mm thick and were envisaged to be assembled together by means of grooves on certain edges of the panels. These grooves of one panel slotted into the negative of the grooves of another panel. The wooden panels were cut to shape using a laser cutting machine.

A specialized component to hold the LED light was designed and 3D printed. The part needed to have grooves internally to facilitate wiring. To account for the power supply wires to enter the machine, a big circular cut-out was made in the back wooden panel. 

Two holes in a wooden panel were laser cut to accommodate the Easy and Difficult Buttons. These wooden panels were fastened to the main casing by means of L brackets. All the L Brackets used in our machine were 3D Printed. 

A top wooden panel to cover the electronics and its wires was designed and laser cut. To facilitate the opening and closing of this wooden panel, a big slot was provided in the panel and was attached to the outer casing by means of a hinge.

The outer casing in CAD is as shown in the image below –

Image 1: Outer Casing

Welcome Board 

Most of the dynamic setup of the machine is either attached to the front or rear side of the Welcome Board. Similar to the outer casing, it is made of 5mm thick wood which is also laser cut. Additionally, a slot is also cut on the board to allow for the 3D Printed Assembly to have access to the belt at the back.

The Welcome Board is attached to the left and right side wooden panels of the Outer Casing via L brackets. 

The Welcome board houses the following parts on the front side – the linear rail which in turn houses the 3D printed assembly. Further, on the front side, it has an etching of the sign Welcome on it.

On the rear side, the board houses the pulleys.

Image 2: Welcome Board with its housed components

Dynamic System Components

The dynamic system components of our machine consisted of two pulleys, linear rail, motor, rubber belt and three 3D printed parts assembled together.

Pulleys: Two single pulleys capable of being wall mounted were used. The safe working load of the same was 420 lbs.

The pulleys were used to create tension and to complete the loop of the belt. It is used to convert rotary motion to linear motion. They were placed on either side of the linear rail at a height of 5cm below and were mounted on the rear side of Welcome Board.

Below is an image of the pulleys used in our machine.

Image 3: Pulleys

Motor: For the purpose of providing motion, a Pololu 25D gear motor with encoder is used. The gear ratio of the same is 4.4 : 1. The encoder has a count of 48 and therefore the total count of for one complete revolution is 4.4 * 48 which is 211.2.

The motor is powered by a 12V power supply with the encoder being powered by a 5V power supply. 

The belt is strapped around the shaft of the motor.

Below is an image of the motor used in our machine –

Image 4: Pololu Motor

Linear Rail: A 300 mm long linear rail guide with stainless steel carriage block was used for linear motion. The 3D printed parts assembly is mounted on the carriage block. 

As and when the motor rotates through a certain angle, the belt also travels. The belt is wound around the 3D printed part and through the pulleys.

The hard rubber stops at either end of the linear rail prevent the 3D printed assembly from overshooting the linear rail.

The linear rail is mounted on the front side of the Welcome Board.

Below is an image of the linear rail used in our machine –

Image 5: Linear Rail

3D Printed Hoop and Parts: Customized hoop sizes (suitable for ping pong ball size) and board for the same was designed in SolidWorks and then 3D printed at Techspark. 

The entire 3D Printed Assembly is broken down into three modules. One module consists of the hoop and the board. This part is as shown in Image 5.

The second 3D printed part has a projection to hold the IR Sensor. This component is the one attached to the stainless steel carriage block belonging to the linear rail. This component is as shown in Image 6.

The third 3D printed component is a step shape design that could have the belt strapped around it. This setup enables the 3D printed assembly as a whole to move. The assembly moves linearly along the linear rail with the help of the friction between the belt and the component. This part is as shown in Image 7.

The above three 3D printed components are assembled together with the help of fasteners.

Image 6: 3D Printed Hoop and Board

Image 7: 3D Printed IR Sensor Holder and Mounting Plate

Image 8: 3D Printed Part for Belt Housing

Below is an image of the complete CAD of the machine done in SolidWorks.

Image 9: Complete Machine CAD

Image 10: Front View of Machine               Image 11: Side View of Machine

Electronic Modules

LED Lights: This subsystem consists of the LED lights that light up when a user waves his hand to begin a game (user waves his hand between the photo-transistor and red LED light.

The LED lights are assembled around the Welcome sign on the Welcome Board. 

Scoring: This subsystem consists of a scoreboard which comprises of 8 LEDs. It is used to keep a count / display the score of the user while playing / at the end of the game.

Image 12: Scoring Red LED Display

Easy & Difficult Mode Buttons: This subsystem consists of the buttons which the user presses to select the difficulty mode of the game. 

The blue button is used to select the Easy Mode and the red button is used to select the Difficult Mode.

Image 13: Easy (Blue Color) and Difficult (Red Color) Buttons

Phototransistor: A phototransistor is used in our machine to detect when a user wants to play the game. The user needs to pass / wave his hand between the LED and the phototransistor and this movement is captured by the subsystem.

IR Sensor: An Infrared Sensor is used to count the number of times a user is able to basket the ping pong ball. It is mounted on the 3D printed component shown in Image 7. The sensor detects a distance between 2 to 30 cm with a detection angle of 35 degree.

Image 14: IR Sensor used in our machine

3. SCHEMATICS

Image 15: General Schematics

The general schematic of the machine is shown above. It can be broken down into eight modules:

  • LED Scoreboard
  • Difficulty Buttons
  • Rotary Motor Encoder
  • Motor
  • Hand Wave Trigger
  • IR Proximity Sensor
  • Speaker
  • Welcome LED strip

LED Scoreboard

Image 16: LED Scoreboard Schematic

Two LED display scoreboards are used to keep track of the score throughout the game until the end. 

Each unit consists of 7 pins that are connected to 7 GPIOs in the microcontroller through 100Ω resistors to restrict the amount of current flowing through the pins and allow the scoreboard to be lit enough to be seen from the player’s position.

The 14 pins include 7 pins from port E (E2, E3, E4, E5, E6, E7 and E8) and 7 pins from port F (F0, F1, F2, F3, F12, F13 and F14) that are configured to be output pins to control the scoreboards.

Difficulty Buttons

Image 17: Difficulty Button Schematic

Two buttons are used for easy level (Blue button) and hard level (Red button).

The two buttons are connected to 3.3V power supply and 1kΩ resistors to ground. The dividers between the buttons and the resistors are connected to input pins from the microcontroller.

The 2 GPIO pins are C8 for easy button and C9 for hard button, configured as input.

Rotary Motor Encoder

Image 18: Rotary Motor Encoder Schematic

The rotary encoder is embedded in the motor. It uses a 5V power supply.

A level shifter is used to convert 5V from the encoder to 3.3V so that the microcontroller can take as input through 2 EXTI pins. When the motor spins, the encoder records the encoder value, positive if clockwise and negative if counter clockwise. That function is used to control the position of the hoop when it traverses on the linear rail. 

The 2 GPIO pins used are C6 and B5, configured as EXTI.

Motor

Image 19: Motor Schematic

The motor is used to control the moving hoop. The schematic for the motor is very standard. 

The motor is driven by a L293B H-bridge with four 1N4001 diodes. The motor is driven in Drive-Break mode that uses three pins for control. The motor circuit uses 12V and 5V power supplies.

The 3 GPIO pins used are B0 configured as PWM mode, B12 and B13 configured as output.

Hand Wave Trigger

Image 20: Hand Wave Trigger Schematic

The hand wave trigger schematic is based on lab 4’s schematic for gummy bear sorting.

It uses a phototransistor, a LM324KN op-amp and a LM339AN comparator to output a high (3.3V) or a low (0V) depending if light is blocked from the phototransistor due to hand wave.

The GPIO pin used is C3, configured as input.

IR Proximity Sensor

Image 21: IR Proximity Sensor Schematic

The EK1254 IR sensor schematic is standard.

It is connected to 3.3V power supply and ground. The output of the sensor is connected to the microcontroller.

The GPIO pin used is F7 configured as input. The pin is used as an ADC converter to detect the ball going through the hoop.

Speaker

Image 22: Speaker Schematic

The speaker unit is connected to the microcontroller through a 690Ω resistor to reduce the volume of the sound.

The GPIO pin used is B2, configured as output.

Welcome LED strip

Image 23: Welcome LED Strip Schematic

The schematic for the Welcome LED strip uses an NPN transistor to control the voltage. The transistor base is connected to the microcontroller through a 100Ω resistor. The LED strip is connected to the transistor’s collector and a 12V power supply. The transistor’s emitter is grounded.

The GPIO pin used is B3, configured as output.

5. State Machine

State Machine Diagram

Image 29: State Diagram

State Machine Introduction

There are totally five states in our state machine. The first state will be WAIT. The WAIT state is waiting for an initial trigger, a hand wave. As soon as the hand wave is detected, the state will go to WELCOME and the welcome lights will be on to welcome the user. There are two buttons available in this state, easy or hard difficulty selected buttons. Either button is bushed will lead to the corresponding game state. However, it will waste too much power if the welcome light is always on while waiting for a button to be pushed. Thus, we make a watchdog to guard the system. The button’s waiting period will be thirty seconds. If no button is pressed in that period, the state will go back to WAIT. After the button is bushed, then it will go either EASY or HARD game state. The motor will move the hoop if the difficulty level is HARD. In the game states, the IR sensor will detect any objects passed it and a sound will be played after a detection, the score board will also be updated. The game state will automatically end after thirty seconds. Then it will go to the RESULT state. In this final state, the score will be displayed again and a final sound will be played. If the hoop was moved before and not in the center, the system will move the hoop back to the center. After all those works are done, the state will go to WAIT again, waiting for another new game. 

State Machine Table

InputCurrent StateNext StateOutput
Hand WaveWAITWELCOMELED Strip ON
Easy Button PushWELCOMEEASYGame Start
Easy Button PushWELCOMEHARDGameStart, Hoop Moves
Watchdog ExpiresWELCOMEWAITLED Strip OFF
Game Time ExpiresEASYRESULTFinal Sound
Game Time ExpiresHARDRESULTFinal Sound
All final Works DoneRESULTWAITReset All Works

6 thoughts on “Arcade Basketball Machine

  1. fantastic submit, very informative. I ponder why the other specialists of this sector do not notice this. You must continue your writing. I’m sure, you have a great readers’ base already!

  2. I am curious to find out what blog system you are using? I’m having some small security issues with my latest site and I’d like to find something more secure. Do you have any recommendations?

  3. I love your blog.. very nice colors & theme. Did you make this website yourself or did you hire someone to do it for you? Plz reply as I’m looking to construct my own blog and would like to find out where u got this from. thanks

  4. you are really a good webmaster. The website loading speed is incredible. It seems that you’re doing any unique trick. Moreover, The contents are masterwork. you’ve done a magnificent job on this topic!

  5. Excellent goods from you, man. I have keep in mind your stuff prior to and you are just extremely great. I actually like what you have obtained right here, really like what you’re stating and the way wherein you assert it. You’re making it entertaining and you still take care of to keep it wise. I can not wait to learn much more from you. That is really a wonderful site.

  6. I have observed that in digital camera models, extraordinary sensors help to focus automatically. Those kind of sensors associated with some video cameras change in in the area of contrast, while others start using a beam with infra-red (IR) light, especially in low light. Higher standards cameras occasionally use a blend of both systems and probably have Face Priority AF where the dslr camera can ‘See’ some sort of face while keeping focused only on that. Thanks for sharing your thinking on this web site.

Leave a Reply

Your email address will not be published. Required fields are marked *