DIY Pinball Machine (Instructable Incomplete & Basic)
by JarneDemoen in Circuits > Raspberry Pi
639 Views, 4 Favorites, 0 Comments
DIY Pinball Machine (Instructable Incomplete & Basic)
Hello, I'm Jarne Demoen, student MCT at Howest Kortrijk, Belgium. At the end of the year we get to make something with all kinds of sensors and actuators. I decided to create my childhood favorite, a pinball machine. Note, i'm not very handy so the woodwork is nothing special ;)
Get All the Components
For this project i have used the following:
- Solenoids (3x) (12V DC))to launch the ball and to activate the flippers
- Microswitches (3x) to function as 'targets'. You try to hit the switches with the ball
- TCRT5000 module (7x): this module can detect when something passes by. 1 will be used to detect whether the ball is in or out the game (behind the flippers or not). The other 6 are used to detect whether the ball has passed by a certain point or not to score points.
- Servo motor: When you're on your last life, the servo motor moves so the ball will go another way when it has passed the flippers. If you have more than 1 life, the ball will go to the direction of the launch.
- LCD screen to show my private ip (to connect with the server) and to show the score
- RFID sensor to identify the player
Wiring
I have powered the solenoids on 20V and not 12V DC so it will give enough power. But as you kwow 20V and a raspberry pi does not match very well so you will need a universal adapter of 20V and 3A and a TIP transistor.
The LCD is connected with a shiftregister to save GPIO pins. I need a lot of pins for my TCRT5000's and microswitches.
Programming
Programming the solenoids is not difficult at all. You define your GPIO pin as an output and you set them HIGH for 0.1 seconds and then low again. To detect whether a microswitch is hit, you use an event detect.
For the RFID you can follow these steps: https://codingworld.io/project/rfid-grundlagen
To control the servo motor, you have to use PWM and change duty cycle.
The TCRT5000 is a bit more difficult. At first I used an event detect but the distance between the sensor and the ball was too big so I had to use the analog outputs of the TCRT5000's. These analog outputs have to be connected with a MCP3008. Finally, you have to look which value corresponds with the passing of the ball. This is a bit difficult at times because the lighting in the room can change throughout the day as well.
Creating the Pinball Machine
I tought it would be easy to have the pinball machine lasercutted. At first, I drew the construction in Siemens Solid Edge, than you will have to export your files to a dxf in order to edit it with Adobe illustrator. I let it cut 3 times (2 times 4mm and 1 time 5mm). Than you can attach the pieces together.
Database
This is the design of the database I have made. You can have mulitple users, players and you're able to make your own gamemode which can be done with the corresponding responsive website that I made.