Project Ideation
At first, my idea was to make a 1 vs 1 game where two players could compete. But since I did not have enough parts, I changed it into a 1 player pinball-style game.
I liked this new idea because it is fun and interactive, and it still shows how the electronics and design work together. I was inspired by pinball machines and arcade games, where the goal is to score points and stop the ball from falling.
For the CAD part of the project, I designed the moving player mechanism made of the gear, rack, and 3D-printed bearing holder. The design made sure the stepper motor’s rotation turned into smooth linear movement, and that the rack stayed in place without slipping.
I used Fusion 360 to model the gear, rack, and holder, and Rack Gear Generator by Niklas Pöllönen to create the rack profile. A 3D printer was used to make the parts, with the 688ZZ bearing STL from GrabCAD as a reference. The parts were fastened with M3 screws and nuts.
The process included sketching the rack-and-pinion layout, modeling the gear to fit the stepper motor speed, generating and adjusting the rack, and creating the bearing holder inspired by Silkplast tape rolls. After printing and testing, the mechanism was refined and then combined with the electronics: the solenoid to shoot the ball, IR sensors to detect goals and losses, and an LCD to show the score and game status.
Autodesk Fusion
We had a quota of plywood sheets 3mm which I designed the chassis and components of in Autodesk fusion. We also had PLA filament which the complex objects were made of.
Orange PLA Filament
Plywood sheets
M3 screw & nut
I used autodesk fusion 360 to design the whole project. it’s made of 3 main parts:
the moving player that shoots the ball,
the playground where the ball rolls and goals are placed
and the controller with joystick and button.
the playground has a built-in tunnel so the ball always comes back to the player. the moving player uses a rack and pinion mechanism that pushes the solenoid to shoot the ball. i used gears and 3d printed parts to fix the rack in place and make it stable.
First let's get the useless stuff out of the way:
screenshots of all sketches in fully defined (expect one cuz fusion magic)
Magic line can't do anything about 🦦
This project has been tinkered with alot so not a single sketch holds any important info
like for example this simple piece is made out of 4 sketches
none of them will hold any descent info on its own
so will only include components pictures
THEE MAGIC LINE
The Moving Player That Shoots the Ball
This part is the main player mechanism. It uses a rack and pinion design, where the stepper motor’s rotation is changed into linear movement. This allows the player piece to slide left and right.
To keep the rack steady, I designed and 3D-printed support parts that hold it in place and stop it from slipping off while the game is being played.
The Moving Player That Shoots the Ball
This system was made of two main parts: the gear & rack, and the 3D-printed bearing holder. Together, they allow the stepper motor to move the player left and right.
1- Gear & Rack Design
The gear is fixed to the stepper motor shaft. When the motor turns, the gear teeth push against the rack to create smooth linear motion.
The rack is a straight bar with teeth that match the gear. As the gear rotates, the rack slides left or right. This converts the motor’s rotation into the player’s movement.
2- 3D-Printed Bearing Holder
To keep the rack in place, I designed and printed bearing holders. These holders guide the rack and stop it from slipping or lifting during play, making the movement stable and reliable.
Gear and Rack Design
To make the gear, I asked ChatGPT to help calculate the dimensions. I gave the motor speed (around 14 RPM, very slow) and explained that I needed a larger gear, at least 50 mm in diameter, to move the player left and right faster. Using those numbers, I was able to design a gear that fit my needs.
For the rack, I followed the same process. I used an external tool called Rack Gear Generator Niklas Pöllönen to create the rack profile that matches the gear. This let me generate a rack with the right teeth spacing so it would mesh smoothly with the gear.
These images are from failed attempts, I went back for a 3mm gear thickness and 50 teeth gear later
To finish the rack I added wings to the left and right that were at least as long as the rack itself
also added teeth to the top to fix the solenoid to it later
all of this to do this
3D-Printed Bearing Holder
To design the bearing holder, I first downloaded an STL model of the bearing I was using, the 688ZZ Bearing by Leon Yip from GrabCAD. This gave me the exact size to model around.
For inspiration, I looked at Silkplast medical tape rolls. They are made from three pieces: the roll in the center and two side parts that press in and hold it together. They stay in place with small tabs that grip the inside cylinder.
I adapted this idea for my design. The bearing holder has three main parts:
A center section for the bearing.
Two side supports to keep it pressed in place.
Hollow sections where screws and nuts go through, so the whole mechanism can be tightened securely from both sides.
This design kept the rack stable and prevented it from slipping while still being easy to assemble.
Now the rest of the shapes
Inner wall:
Inner wall was made to put the stepper motor on it, it has 2 t-slots in the bottom to connect it to the floor of the design, as well as finger tabs and t-slots to connect it to the front of the design
front plate:
the front of the project, it has 2 slots at the top as well as 3 rectangular cuts at an inclination to hold the "failure ball road" in place
it has 2 holes to retrieve the ball as well as an lcd screen
failure ball road:
when the player fails to hit the ball, it falls down this path and exits from the front
bot plates are made to connect the bearing connectors and hold the shape together from the sides
small connection piece to hold the top plate with fail inclination piece
2- the playground where the ball rolls and goals are placed:
Playground top plate:
has 3 holes which the ball will drop into them to score goals. held from behind and the sides by t-slots
Left Playground plate:
has holes to expose power switches and arduino usb port for programming
held from the top with t-slots and bottom with finger tabs
Left Playground plate:
has holes to expose power switches and arduino usb port for programming
held from the top with t-slots and bottom with finger tabs
Tunnel to guide the ball
made out of 3 pieces and held to the top plate using t-slots
this part was specially hard as the t-slots are rotated in y-axis then in x-axis
to have a down hill approach to return the ball to the user
3- Last piece is the joystick box:
A simple box made of finger joints with holes for a joystick and a push bottom
After completing the CAD design in Fusion 360, I moved to fabrication to turn the 3D model into real parts using digital tools and basic materials.
Softwares used:
- Autodesk Fusion: For CAD modeling of the gear, rack, and holder.
- Ultimaker Cura: For slicing 3D printing files.
- Deepnest.io to arrange .dxf files for laser cutting for max efficiency
- LightBurn to communicate with the machine
Autodesk Fusion
Machines and tools used:
- Ender 3 Pro 3D printer: For printing the mechanical parts.
- El Malky ML64 Laser Cutter: For cutting plywood panels for the base and supports.
- Hand tools: Hammer, screwdriver, and pliers for assembly.
Materials used:
- Plywood sheets: Base and support structure.
- PLA filament: 3D-printed gear, rack, and holder.
- Nails and M3 screws: To fasten wood and printed parts.
- Arduino components: Stepper motor, solenoid, IR sensors, LCD, LEDs, buzzer, buttons.
Orange PLA Filament
Plywood sheets
M3 screw & nut
Fabrication steps:
1. Exported CAD files and sliced parts in Cura.
2. 3D printed the gear, rack, and holder in PLA.
3. Laser cut plywood base and supports.
4. Assembled wood with nails and attached printed parts with screws.
5. Mounted electronics into the structure.
6. Integrated mechanics with electronics to finish the prototype.
Final 3d printed pieces
first prototype was slim and got broken up easily
Second version was made bulkier to withstand the movement also added wings so I could fix it to the chassis with screws
old vs new
Deepnest.io was used to order .dxf files to use least amount of wood
now the whole project fits inside 2 50x30cm sheets of plywood
importing files into lightburn and picking 70% for power and 10% for speed.
Software used:
Arduino IDE to test components
Fritzing to make diagrams
JF-0826B
IR-Module
Relay-Module
Buzzer 5v
Breadboard
HW-504
Arduino Uno
12v DC adapter
Female Power Connector
LCD Screen (I2C 16x2)
LED
1N-4007 Diode
L7805CV (Step Down)
ON/OFF Power Switch
M/M F/M Wires
Push Button
28BYJ-48 + ULN2003 Driver
Wiring Details:
1. Stepper Motor (28BYJ-48 + ULN2003 Driver):
IN1 → Digital Pin 8 Arduino Uno
IN2 → Digital Pin 10 Arduino Uno
IN3 → Digital Pin 9 Arduino Uno
IN4 → Digital Pin 11 Arduino Uno
VCC (Driver board) → +5V rail on breadboard
GND (Driver board) → GND rail on breadboard
2. Solenoid (via 12V Relay Module):
Relay IN → Digital Pin 12 Arduino Uno
Relay VCC → +5V rail on breadboard
Relay GND → GND rail on breadboard
Relay COM → +12V from adapter
Relay NO → Solenoid +ve terminal
Solenoid -ve terminal → GND (12V power supply)
3. IR Sensors (x2):
VCC → +5V rail (from regulator)
GND → GND rail
OUT (Goal sensor) → Digital Pin 3 Arduino Uno
OUT (Fail sensor) → Digital Pin 4 Arduino Uno
4. Joystick (X-axis only):
VRx → Analog Pin A1 Arduino Uno
VCC → +5V rail (from regulator)
GND → GND rail
5. LCD Screen (I2C 16x2):
SDA → A4 Arduino Uno
SCL → A5 Arduino Uno
VCC → +5V rail (from regulator)
GND → GND rail
6. LEDs (x3 for movement + status):
Left LED → Digital Pin 6 Arduino Uno
Right LED → Digital Pin 5 Arduino Uno
Center LED → Digital Pin 1 Arduino Uno (⚠ TX pin)
All LED cathodes → GND rail
7. Buzzer:
Positive → Digital Pin 13 Arduino Uno
Negative → GND rail
8. Voltage Regulator (L7805CV):
IN → +12V from adapter
GND → Common GND (shared with Arduino, sensors, and relay)
OUT → +5V rail (used by Arduino Uno, stepper driver, LCD, IR sensors, LEDs, joystick, buzzer, and relay)
Inputs & Outputs Components
Input Components:
Joystick (A1): Controls stepper motor direction (left/right).
Button (Pin 12 via relay input): Triggers solenoid to shoot.
R Sensor (Pin 3): Detects a goal scored.
IR Sensor (Pin 4): Detects ball falling → game over.
Output Components:
Stepper Motor (Pins 8,9,10,11 via ULN2003): Moves rack-and-pinion slider.
Solenoid (via relay on Pin 12 + flyback diode): Safely launches the ball.
LCD Screen (I2C on A4, A5): Displays score and game state.
LEDs (Pins 5,6,1): Show movement and solenoid activity.
Buzzer (Pin 13): Gives sound alerts for goals and failures.
Testing motor and joystick
Adapter: 12V 2A DC adapter (main power supply).
Voltage Regulator (L7805CV): Steps 12V down to 5V for the Arduino Uno and all 5V components (IR sensors, LCD, LEDs, buzzer, relay input).
Direct 12V Line: Powers the solenoid through the relay.
Reason for Selection:
The 12V adapter was chosen because it can provide enough current for the solenoid while still being compatible with the L7805CV regulator, which supplies stable 5V for the control electronics.
Software use:
Arduino IDE for coding
ChatGPT: turn the code lines into HTML code for journal
Prompt to make html code:
make this test code into HTML Don't change anything in it, make it dark themed and highlight important info like Arduino IDE would
make sure the unique syntax have certain colors like Arduino IDE
{code goes here}
The code is constructed from functions to make it easier to understand
First 20 lines are the all the necessary libraries and defines what each pin on the Arduino is connected to.
For setup() and loop() everything is made out of functions with comments so following them is easier
First 3 functions help initialize everything and setup important variables
necessary Buttons are setup as INPUT_PULLUP to avoid noise and false postives
LCD displays "Game Started" and the game starts
handleJoystick():
this function is responsible for taking input from the joystick and mapping it to a speed variable so the motor could use it and move from left to right
while testing i found extra issues with the dead zone, so I added and if condition (line 101) that ignores any input less than 400 (positive or negative)
After the motor gets the order to move, another function checks which direction its moving in and turns on the corresponding LED to indicate movement
Next function to cover is handleSolenoidButton()
Its a simple function that checks if the solenoid button is pushed and turns on the solenoid through sending power into the relay
the solenoid stays ON as long as the button is pressed in
after than we check our IR sensors for input
if the goal sensor sends a message we go to scoreGoal() function
same with gameFailed
if neither then we continue
ScoreGoal function increases the score by 20 and also displays the new score and a message on the screen
while also calling another function to make led lights blink and buzzer to turn on
gameFailed also does the samething but also sets isGameOver to true
which will cause the loop to break due to this condition in the start of every loop
After the game fail screen shows
we show the player there score and wait for them to press the solenoid button to start a new game
If he presses the button the score is set to 0 and the isGameOver back to false and the screen displays everything like a fresh game again
To start off we going to be building up to get same result as in this video
the player being able to move left and right
Starting with the rack:
I grabbed the 3d printed pieces and put the bearing gears in them, they are held together by the tightness of the part as well as being free to rotate in there place
following these steps we finish puting in the stepper and screwing it into the base
After that grab the front plate and insert these components into it
and we almost done
now we need to put these 2 parts together and that's it
Now put the rack we made before into this new part
and for testing try to move it around and see if it feels smooth
Next up we trying to make the playground
it should look something like this
Its a simple box with t-slots at the top and finger tabs at the bottom
the important part is the tunnel that returns the ball
its held to the top using t-slots and it goes in at an angle
now for the electronics
The playground floor got holes to screw in parts like arduino uno, relay module and motor driver
the breadbord could be held inplace using double tape
working on main power components
put the power jack and the ON/OFF button to the side, I couldn't solder on most of these so I sued crocodile wires to hook components together
Also using tape to write what each wire makes things easier to track
double check everything before closing the box as debugging is really difficulty in this tight space
aaaaand its done
This project was a really nice journey. I faced many problems, but each one taught me something new and helped me improve. I also made good friends during the process and had fun working and learning together. In the end, I’m happy with what I built and proud of the things I learned along the way.
1. Choosing the Right Mechanism
One of the first challenges was deciding what mechanical system to use for moving the player. After thinking about options and discussing with my instructor, we considered:
Rack and pinion
Screw-and-nut system
Scotch yoke mechanism
In the end, we settled on a rack-and-pinion system because it was simple, reliable, and easier to fabricate with the parts available.
Rack and pinion
Screw-and-nut system
Scotch yoke mechanism
2. Very Slow Stepper Motor
Another big issue was the stepper motor I had — it was extremely slow (around 14–20 RPM). To make the slider move faster, I needed a large gear to compensate. With ChatGPT’s help, I calculated the values and tested different sizes. Eventually, I went with a 50 mm diameter gear. Going bigger would have made the system lose too much torque.
To increase the speed I used AccelStepper.h library as well as followed the tips in this video.
3. Gear-to-Motor Shaft Connection
Getting the gear to fit on the motor shaft was tricky. At first it was either too loose (slipping) or too tight (risk of damage). I didn’t want to glue it permanently. After several tests and adjustments to the hole diameter, I got the perfect fit — tight enough to stay in place, but still removable.
4. Torque and Rack Friction
Sometimes the stepper motor struggled to push the rack, either due to torque limitations or because the teeth were sticking. To fix this, I experimented with lubrication and surprisingly found that normal bar soap worked very well to reduce friction between the rack and gear teeth. This made the system smoother and more reliable.
5. Keeping the Rack in Place
Another issue was the rack slipping out of alignment. My solution was to use a bearing-based holder, which I 3D printed. The bearing keeps the rack pressed in place while still allowing smooth movement. I explained this design earlier in the fabrication section.
As well as putting 2 3mm gears on top of each other to make a 6mm width gear.
6. IR Sensor False Triggers
The IR sensors were unreliable at first — they either gave false positives or failed to detect the ball. After experimenting, I found that aiming the white LED directly at the target object and slightly bending the black receiver LED away improved performance. This adjustment made the IR modules much more accurate, only sending a HIGH signal when an object was really detected.
To be honest and also put it in the nicest way possible, I would probably start fresh and do a proper project instead of this version. A lot of last-minute changes made the idea feel a bit weak compared to what I wanted. If I could go back, I’d stick with my original plan of making it a 1v1 game, which I think would have been much more fun and engaging.