instructables Smart Pinball Instructions
- June 9, 2024
- instructables
Table of Contents
instructables Smart Pinball
Smart Pinball by Pblomme
Ever since i was a kid, I’ve always liked playing with pinball machines. We
had a little one when I was younger and I spent hours playing with that thing.
So when my teachers gave us this assignment to make an ‘enchanted object’ and
they give a tip to make something fun, I instantly thought of a pinball
machine.
So, in this instructable I’ll walk you through this journey I took to make
my version of an awesome pinball machine! Supplies:
Components:
- Raspberry Pi (€ 39,99) x1
- Raspberry T-cobbler (€ 3,95) x1
- usb-c power supply 3,3V (€ 9,99) x1
- Wood plate (€ 9,45) x1
- LDR (€ 3,93) x1
- Force sensitive resistor (€ 7,95) x1
- Infrared sensor (€ 2,09) x1
- Wooden sticks (€ 6,87) x1
- Box of colored rubber bands (€ 2,39) x1
- LCD-screen (€ 8,86) x1
- Black marble (€ 0,20) x1
- Neon stickers (€ 9,99) x1
- Cables (€ 6,99) x1
- Servo Motor (€ 2,10) x1
The Smart Pinball machine is a DIY pinball machine that can be built using Raspberry Pi and various components. The pinball machine has sensors, a servo motor, an LCD screen, and a database to store dat a. The following are the supplies and tools required to make the Smart Pinball machine:
Supplies
- Raspberry Pi (39.99) x1
- Raspberry T-cobbler (3.95) x1
- USB-C power supply 3.3V (9.99) x1
- Wood plate (9.45) x1
- LDR (3.93) x1
- Force-sensitive resistor (7.95) x1
- Infrared sensor (2.09) x1
- Wooden sticks (6.87) x1
- Box of colored rubber bands (2.39) x1
- LCD-screen (8.86) x1
- Black marble (0.20) x1
- Neon stickers (9.99) x1
- Cables (6.99) x1
- Servo Motor (2.10) x1
Tools
- Glue gun
- Jigsaw
- A drill
- Wood glue
Usage Instructions
- Connecting Everything: Follow the instructions provided in the PDF files to connect all the sensors, servo motor, and LCD-screen using cables. Ensure that all the components are connected correctly and securely.
- Setting Up the Database: Install MariaDB on your Raspberry Pi and connect MySQL Workbench to it. Then, run the SQL file provided to create a database to store all the game data. The database contains two important tables, one for the players and the other for the sensor data.
- Setting Up Sensors and Site: Follow the instructions provided in the PDF to set up the sensors and site for the pinball machine.
- Making the Physical Game: the Box: Follow the instructions provided in the PDF to create a wooden box for the pinball machine.
- Combining Everything: Combine all the components of the pinball machine as per the instructions provided in the PDF.
Step 1: Connecting Everything
In the pdf’s below you can find what and how you can connect all the sensors,
the servo motor, and the LCD screen. Some of the components are set on the
breadboard on the pdf, but you should connect everything with cables. What’s
needed to later place everything in the box?
Download: https://www.instructables.com/ORIG/FHF/1MQM/L4IGPP2Z/FHF1MQML4IGPP2Z.pdf
Download: https://www.instructables.com/ORIG/FFH/ZZ83/L4IGPP38/FFHZZ83L4IGPP38.pdf
Step 2: Setting Up the Database
For this project, you need a database to store all the data you’ll receive
from the game. For this, I made a database in MySQL workbench. Make sure you
have MariaDB installed on your raspberry-pi and connect MySQL workbench to
your pi. There you can run sqlle you can find under here to get the database.
the important tables in the database are for the people playing and the sensor
data stored in the table ‘spel’. That saves when the game starts and ends, the
amount of times you hit the hotzone and time played. This all is used to get
the scoreboard of the 10 best games played.
Step 3: Setting Up Sensors and Site
In the Github Library you can nd all the code you need to make the sensors and
motor work. You can also nd all the code to make the website work and interact
with the game.
A little info about the code:
The game starts when the ball rolls next to the ldr, so it gets darker. The
ldr detects this and starts the game. You can change the intensity of the ldr
to perfectly r your lighting situation. I put it on 950, because that worked
well where I built it, but it could be different for you. You get points for
every second that you keep the ball ‘alive’. When you hit the pressure sensor,
aka, the hot zone, you get extra points and the servomotor stops turning for a
bit. When you eventually lose, the ball rolls next to IR-sensor and that’s how
the game knows when you lose.
Step 4: Making the Phisical Game: the Box
The first step of making the game, is making the box itself. I based my design
of of this video. Only i used wood instead of cardboard and made the end a
little higher, so it could not the lcd-screen. I was lucky, because i had a
friend with a woodcutting machine, but it is possible to cut out the shapes
using a jigsaw.
Begin by cutting out the sides, the back, the front and the main ground plate.
Before connecting everything, make a hole in the back for the lcd screen. Now
connect everything with nails or wood glue. Make sure you have an edge of
atleast one centimeter on the sides. After that, its tome to drill some holes!
You need a couple holes in the shape of a triangle to put the sticks in and
some holes for the motor and the sensors. On the sticks, put about 3 rubber
bands each, so the ball can bounce or of it. Make sure you have some big holes
at the end of the box to put al of the power cables and other cables through.
The last and hardest part to make, is the mechanism for the ippers. In theory,
it is not that difficult. The sticks you press turn a block and a rubber band
pushes that block back. On that block there is a stick with the upper on the
end of that. Make sure that the sticks on the side are really well glued on
the blocks, so they don’t fall o.
Step 5: Combining Everything
After the box is done, we can begin putting everything together. You can
attach the raspberry-pi in the middle with some small screws. Just make sure
you don’t put them in too deep, otherwise they’re going to stick out of the
plate at the top. You can just remove the protective layer of the breadboards
and just stick them into the box. Put the ldr in the side on the left of the
box, just after the launching mechanism. You can put the pressure sensor where
ever you like. I put it in front of one the triangles. You might have to make
another hole at the front to slide the IR-sensor into. It has to be sideways
to see the ball. The hole you made for the lcd screen should be the perfect
size for you to just push it in. For the motor, you can stick a little stick
to it, using the glue gun. Put the stick through the hole you made for it and
glue a little piece of wood to the stick. After all of that is done, you can
top it o by sticking some nice stickers on it!
References
- Yours for the making - Instructables
- Pblomme's Profile - Instructables
- Smart Pinball : 5 Steps - Instructables
- How to Install MariaDB on Raspberry Pi? (MySQL Server) – RaspberryTips
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>