Introduction: Basketball Machine

During quarantine time, I spend most of my time watching youtube and playing video games. Later I notice that the blue-ray has damaged my eye. So then I decided to make a basketball machine for me to play. To make the basketball machine harder, I added a clapboard that may block my shot. With this machine, I wish that I would spend less time playing with my phone.

Step 1: Material

Arduino Leonardo

Long Jumper Wires Male to Female

Short Jumper Wires Male to Male

Tape/ Clay

Green LED Light

Red LED Light

Ultrasonic sensor

Micro Arduino Servo Motor SG90

Arduino Resistor

Two 38cm*10cm Cardboard

One 39cm*10cm Cardboard

One 45cm*20cm Cardboard

One 38cm*20cm*45cm Cardboard

Breadboard / Welding Gun

Step 2: Code

Code

You may change the degree of blocker and the time of the blocker by changing the numbers behind the "Servo Pin". You could change the code to make sure that the level fits your skill ability.

Step 3: The Circuit

1. Plug in all the wires in the pins declared for the coding part.

2. Be aware of the positive and negative electrode or else the components might break (positive electrode: 5V, negative electrode: GND).

3. Begin with the LED light, put your LED light onto a jumping wire. Plug the longer leg on the LED light on to D`pin; the short leg onto the breadboard connect to the Arduino Resister to the negative.

4. Later with Servo Motor, attach the Servo Motor with three jumping wires, that plug the black line to the negative, the red to the positive, and white to D`pin.

5. Last, Ultrasonic sensor. Look closely, there where 4 different places to plug with the sensor. First, plug the 5V onto the positive on, then plug the Tri and Echo on to D`pin. Last, plug the GND on to negative.

Step 4: Assemble the Components

In this step, you're going to learn about how to put all your cardboard together to make the machine.

1. There is already two-piece of cardboard attached to the board ( On the side ). Stick one cardboard (38cm*10cm) on each side. Then fold it in after.

2. After, place the 39cm*10cm Cardboard in the middle of the two sides. Make sure to form a slope for the box, so then the ball could roll down.

3. Later, put your Arduino into the box. Make two small holes for the LED light, and carve a small hole in the middle of the slope for the Ultrasonic sensor the detect the ball.

4. Last, attach your Servo Motor with the bak of your box, so it forms the blocking tension.

Step 5: How It Works

The machine works as you throw your ball into the box. The Ultrasonic sensor will detect your ball and changes the light of LED to tell whether you score or not. On the other hand, Servo Motor also makes to player harder to get the ball in, which makes the game more fun.