Engineering Applications
Pinball!
This year we are being challenged to make a pinball machine for our culminating project for our Engineering Pathway.
Project Requirements
Above is the requirements list for our project!
STEAM!
This project will use all disciplines of STEAM!
Stop Light
First Draft
We set up the Rasberry Pi Pico using female wires to make a stoplight pattern.
Final Draft
We connected the Pico to a breakout board and stripped the wires to attach them.
LED Chaser Pattern
We programmed our Pico to consecutively light up the LED's on our breakout board into a chaser pattern. We used our serial monitors on the Mu Editor software to troubleshoot and get it working. GitHub Code Link
Pinball Research
Start Button
Our class got together at an arcade to research pinball machines and their components. This is the start button of the pinball machine, one of many mechanical core components involved in making it work. After pressing the start button, the ball enters the chamber for the launcher to be used, as well as starting all of the other electronics to be game-ready.
Ball Launcher
The Ball Launcher is one other main component to the pinball machine. It deploys a ball into a narrow chamber, against a spring-powered rod you pull back and release to launch the ball forward and into the actual game.
Target
The Target is a common component in pinball machines, registering when the ball comes in contact with it's face and reacting based on that. In this case, the box raised up after being hit, revealing more options for the ball to go. In most cases the target retreats under the game, indicating you gained points.
Bumper
The bumpers of the pinball machine are another primary component. It uses an electric current that the ball conducts upon contact, causing the bumper to reacting and launch the pinball away. A solenoid is used to cause the reaction and make the machine move.
Component Sketches
Launcher Sketch
I drew the Pinball Launcher in detail, demonstrating what it looks like and giving an idea of how it works.
Bumper Sketch
I drew the full Pinball Bumper schematic, including the solenoid and parts that go under the actual game.
Unique Components
3 Different Lighting Types
Scoreboard Buttons Working
We connected two buttons to our breakout board, wiring them to the Pico so when you press each one it changes the score value or ball count value on the LCD screen.
Below is my GitHub repository code.
9/13/23 OnShape Drawing in Engineering
Rectangles
We used the dimension tool, corner rectangles, and center point rectangles.
Rectangles & Circles
We used center point circles, corner rectangles, and the dimension tool.
Robot Sides
We used corner rectangles, the dimension tool, and the linear pattern tool.
Stairs
We used corner recntangles and the linear pattern tool, as well as extruded it into a drawing.
9/27/23 OnShape Drawing in Engineering
Pyramid
We used the corner rectangle tool, the dimension tool, and the linear pattern tool to extrude our sketch of a pyramid.
Donut
We used the center point circle tool, the dimension tool, and the line tool to extrude our sketches of a donut.
Cone (Bumper Prototype)
We used the line tool and the dimension tool to extrude our sketches of a cone.
Target / Target Body
We used the center point rectangle, trim, line, dimension, and linear pattern tool to design a sketch for our pinball targets.
Horseshoe
We used the line tool, center point circle, cut tool, and dimension tool to extrude the sketch of the horseshoe.
ET
We used the line tool, center point circle, cut tool, dimension tool, and sketch fillet tool to extrude the sketch of the part.
Bumper Research
Video #1
This video shows the method in which he allowed the current to connect when the ball hits, giving me an idea on how to make the bumper react to ball contact.
Video #2
This graphic gives a detailed demonstration on how a proper bumper functions and all of the components going into it.
Video #3
This is a 3D printer bumper, designed similarly to how ours will function. I can use this as a basis to inspiree my design and shape.
What is the function of a bumper/flipper?
Bumpers are a key component of pinball machines, acting as a target to gain points upon contact with the ball. They use a cone-shaped part connected to a solenoid to push down the ball and launch it away when the ball hits, with the ball acting as a conductor and completing the circuit making the solenoid react.
Describe in your own words, once your bumper/flipper is installed, how you will consider it to be successful.
It will be successful when the bumper reacts to every time the ball hits, as well as the score increasing.
As of this year, one of the expectations of your engineering knowledge is that you can develop your own set of constraints. Use the target constraints as a guide. Develop a comprehensive list of project constraints for your flipper/bumper (10-20 requirements).
What is the “switch” that controls the mechanism? Describe it. Add an image of one.
Two conductors that act as an open circuit until the ball connects, triggering the solenoid and closing the circuit.
What is the electromechanical component that creates the movement?
Solenoid.
Bumper Sketch
The ball makes contact with the downward cone and the base plate at the same time, completeing the current and triggering the solenoid to react and bump the ball away.
Final Pinball Machine
Full Functionality
These videos demonstrate the full functionality, playability, and aethetics of our completed pinball machine.
Bumpers
The pinball bumpers activate upon being struck by the ball, launching it away and increasing points. They are designed to look like green shells from Mario.
Targets
The targets are connected to the neopixel strips, activating the LEDs and triggering a score increase an.
Flippers
Pinball flippers activate upon the buttons being pressed, allowing the player to launch the balls away from the ball return. They are designed to look like the Pirahna Plants from Mario.
Launcher
The launcher initiates the pinball game and puts the ball in play.
Neopixel LED
Neopixel LED strips that light up when certain mechanical components are activated.
Scoreboard
An LCD screen that displays the score, with the amount of points altering based on which mechanical device is activated.
Servo
A rotating Bullet Bill from Mario that is attached to a servo motor, pushing the ball.
Unique Mechanical Component
A gyrating brick design that is attached to a servo motor, blocking the ball.
Final Code Dropdown
import board
import digitalio
import time
import busio
import neopixel
from digitalio import DigitalInOut, Direction, Pull
from adafruit_motor import servo
import pwmio
score_button=digitalio.DigitalInOut(board.GP5)
score_button.direction = digitalio.Direction.INPUT
score_button.pull = digitalio.Pull.UP
ball_count_button=digitalio.DigitalInOut(board.GP9)
ball_count_button.direction = digitalio.Direction.INPUT
ball_count_button.pull = digitalio.Pull.UP
score_buttonb=digitalio.DigitalInOut(board.GP18)
score_buttonb.direction = digitalio.Direction.INPUT
score_buttonb.pull = digitalio.Pull.UP
score_buttonc=digitalio.DigitalInOut(board.GP10)
score_buttonc.direction = digitalio.Direction.INPUT
score_buttonc.pull = digitalio.Pull.UP
from lcd.lcd import LCD
from lcd.i2c_pcf8574_interface import I2CPCF8574Interface
ball_count_button.value
score_button.value
score_buttonb.value
score_buttonc.value
score = 0
ball_count = 3
i2c = busio.I2C(board.GP1, board.GP0)
# Talk to the LCD at I2C address 0x27.
lcd = LCD(I2CPCF8574Interface(i2c, 0x27), num_rows=2, num_cols=20)
lcd.set_backlight(True)
RED = (225, 0, 0)
BLUE = (0, 150, 230)
BLACK = ( 0, 0, 0) # 0% of all colors (turns the LED off)
led_strip1_pin = board.GP19
led_strip1_num_pixels = 5
led_strip1 = neopixel.NeoPixel(led_strip1_pin, led_strip1_num_pixels, brightness=0.3, auto_write=True)
led_strip1.fill(BLACK)
led_strip1.show()
led_strip2_pin = board.GP4
led_strip2_num_pixels = 5
led_strip2 = neopixel.NeoPixel(led_strip2_pin, led_strip2_num_pixels, brightness=0.3, auto_write=True)
led_strip2.fill(BLACK)
led_strip2.show()
led_strip3_pin = board.GP6
led_strip3_num_pixels = 5
led_strip3 = neopixel.NeoPixel(led_strip3_pin, led_strip3_num_pixels, brightness=0.3, auto_write=True)
led_strip3.fill(BLACK)
led_strip3.show()
led_strip4_pin = board.GP7
led_strip4_num_pixels = 5
led_strip4 = neopixel.NeoPixel(led_strip4_pin, led_strip4_num_pixels, brightness=0.3, auto_write=True)
led_strip4.fill(BLACK)
led_strip4.show()
led_strip5_pin = board.GP8
led_strip5_num_pixels = 5
led_strip5 = neopixel.NeoPixel(led_strip5_pin, led_strip5_num_pixels, brightness=0.3, auto_write=True)
led_strip5.fill(BLACK)
led_strip5.show()
flipper1_solenoid = DigitalInOut(board.GP2)
flipper1_solenoid.direction = Direction.OUTPUT
flipper1_solenoid.value = False
flipper1_button = DigitalInOut(board.GP12)
flipper1_button.direction = Direction.INPUT
flipper1_button.pull = Pull.UP
flipper2_solenoid = DigitalInOut(board.GP21)
flipper2_solenoid.direction = Direction.OUTPUT
flipper2_solenoid.value = False
flipper2_button = DigitalInOut(board.GP13)
flipper2_button.direction = Direction.INPUT
flipper2_button.pull = Pull.UP
flipperb_solenoid = DigitalInOut(board.GP16)
flipperb_solenoid.direction = Direction.OUTPUT
flipperb_solenoid.value = False
flipperb_button = DigitalInOut(board.GP15)
flipperb_button.direction = Direction.INPUT
flipperb_button.pull = Pull.UP
flipperb2_solenoid = DigitalInOut(board.GP11)
flipperb2_solenoid.direction = Direction.OUTPUT
flipperb2_solenoid.value = False
flipperb2_button = DigitalInOut(board.GP14)
flipperb2_button.direction = Direction.INPUT
flipperb2_button.pull = Pull.UP
pwm = pwmio.PWMOut(board.GP17, duty_cycle=2 ** 15, frequency=50)
pwm = pwmio.PWMOut(board.GP20, duty_cycle=2 ** 15, frequency=50)
my_servo = servo.Servo(pwm)
servo2 = servo.Servo(pwm)
my_servo.angle = 0
servo2.angle = 0
while True:
#lcd.clear()
lcd.set_cursor_pos(0,1)
lcd.print("Ball Count")
lcd.set_cursor_pos(0,12)
lcd.print("#:")
lcd.print(str(ball_count))
lcd.set_cursor_pos(1, 1)
lcd.print("Score: ")
lcd.print(str(score))
#lcd.clear()
time.sleep(.001)
#lcd.clear()
if score_button.value == True:
print("button not pressed")
led_strip1.fill(BLACK)
led_strip1.show()
if score_buttonb.value == True:
print("button not pressed")
led_strip2.fill(BLACK)
led_strip2.show()
if score_buttonc.value == True:
print("button not pressed")
led_strip3.fill(BLACK)
led_strip3.show()
if score_buttonb.value == False:
score = score+45000
if ball_count_button.value == False:
ball_count= ball_count-1
if score_buttonc.value == False:
print("scorebuttonc pressed")
score = score+20000
led_strip3.fill(BLUE)
led_strip3.show()
time.sleep(.001)
if score_buttonb.value == False:
print("scorebuttonb pressed")
led_strip2.fill(BLUE)
led_strip2.show()
if score_button.value == False:
score = score+30000
print("scorebutton pressed")
print("led 1 is on")
led_strip1.fill(BLUE)
led_strip1.show()
time.sleep(.001)
if (flipper1_button.value == True):
flipper1_solenoid.value = False
led_strip4.fill(BLACK)
led_strip4.show()
else:
# The button is pulled to ground, so the switch is pressed
flipper1_solenoid.value = True
led_strip4.fill(BLUE)
led_strip4.show()
if (flipper2_button.value == True):
flipper2_solenoid.value = False
led_strip5.fill(BLACK)
led_strip5.show()
else:
# The button is pulled to ground, so the switch is pressed
flipper2_solenoid.value = True
led_strip5.fill(BLUE)
led_strip5.show()
if (flipperb_button.value == True):
flipperb_solenoid.value = False
else:
# The button is pulled to ground, so the switch is pressed
flipperb_solenoid.value = True
score = score+50000
if (flipperb2_button.value == True):
flipperb2_solenoid.value = False
else:
# The button is pulled to ground, so the switch is pressed
flipperb2_solenoid.value = True
score = score+75000
for angle in range(0, 180, 5): # 0 - 180 degrees, 5 degrees at a time.
my_servo.angle = angle
for angle in range(180, 0, -5): # 180 - 0 degrees, 5 degrees at a time.
my_servo.angle = angle
for angle in range(0, 180, 5): # 0 - 180 degrees, 5 degrees at a time.
servo2.angle = angle
for angle in range(-180, 0, -5): # 180 - 0 degrees, 5 degrees at a time.
servo2.angle = angle
# if score_buttonb.value == False:
# score = score+45000
# if score_buttonc.value == False:
# score = score+20000
# if ball_count_button.value == False:
#ball_count= ball_count-1
Finished closeup of the top
We designed ball guides that carry the ball carefully throughout the board, ensuring it can hit every obstacle.
Finished closeup of the bottom
We designed various mounts and pieces to hold the mechanical components, triple checking them to make sure they are flawless.
Project Reflection
1) This project has been very different in a multitude of aspects. First, it was incredibly innovative, forcing us to take particularly more initiative and use our critical thinking skills. Second, it was very hands on, with us having to manually design/fabricate/build every part and component in the machine. Lastly, it required a lot of creativity. Although the mechanical components are the most important part, we had to maintain an aesthetic / constistent theme throughout our entire project.
2) Very relieving. Although I enjoyed the process, having it finally done took a huge weight off my shoulders due to the deadline and rigorous work.
3) The visual appeal and overall functionality of my project are my favorite parts. It doesn't have any major flaws, and the Super Mario theme is really prevalent throughout the entire machine.