Homemade Arduino Pinball Machine

Conversion of an old pinball playfield to an Arduino-driven, fully working pinball machine.

Oct 31, 2017

49939 views

61 respects

Components and supplies

1

IRL540N MOSFET

1

SparkFun MP3 Player Shield

1

Arduino Mega 2560

1

Push Buttons with microswitches

1

24V/14.6A Power Supply

1

IIC/I2C 1602 Lcd-display-modul

Project description

Code

Arduino controlled Pinball Machine Code

c_cpp

Allows the Arduino to control the game play of a home made pinball machine. Controls lights, sensors, voltage to coils, scoring, etc.

Downloadable files

MOSFET wiring for solenoid control

MOSFET wiring for solenoid control

MOSFET wiring for solenoid control

MOSFET wiring for solenoid control

Comments

Only logged in users can leave comments

Anonymous user

2 years ago

Hi! Great work on the machine! I am sort of new to Arduino, and have been sorting through your code. Could you explain something to me? :) If I look at the unten popbumper as an example, how do you make sure that the switch cannot be stuck, and thus burn the coil (or something else)? I have been trying to find a way without using 'delay' to have an output active for only a short while, after pressing a switch, whether the switch is held down or released. Thanks! :)

Frogger1108

2 years ago

Did you find a solution? I finished my secon machine and implemented a new routine that checks for the time each solenoid pin is HIGH. If any solendoid pin is HIGH for more than 2 seconds, all pins are set to LOW and the program shuts down to prevent any new activation. Works pretty good so far :) Did you have success with your project?

Frogger1108

2 years ago

Hi, Well, to be honest, I had one of the bumper switches stuck once and the best solution was to be fast with the main power button... The solution for this problem is one of the things on my "to do" list for the new pinball machine I'm currently working on. I've got a few ideas and I will check which one is the most feasible in terms of processor time since you can't afford too many delay commands. I also bought a couple of blow fuses which should also work in preventing a coil drawing too much. With those I will have to measure the draw of the individual coils to get the right size for the fuse. I'm sorry I don't have a solution already, my pinball projects have been delayed recently but I'm hopefull that I can start working on them again during august. If you find a solution please post it, I'd be happy to implement it. Kind regards

Anonymous user

2 years ago

Hi again. Being fast with the power button is not a viable option in the long run. We need to find a way for the output, to only stay on for something like 100ms after the switch is closed - whether it is held down or released. The output should go low. Weird that tone() has a duration setting, but digitalWrite doesn't. Yes, delay() is off limits :) I will let you know if I find something out.

Anonymous user

2 years ago

hi,The aztec & underwater turned out great!..I have a similar pinball project that im working on , i will get try get some photos up soon , did the coding take long -days , weeks ?thanks -bill

Frogger1108

2 years ago

Hi. The coding for the Aztec took quite a while, but once you build the different modules (bumpers, scoring, displays, etc.) it gets easier. the most time consuming part is of course testing the code on the machine itself :)

Anonymous user

2 years ago

Great project, and very well explained! I would really like from you to update this project with those improvements you identified during the development of this beautiful work... Maybe expecting to see a second 'improved' version from you :)

Frogger1108

2 years ago

I already have a second old playfield sitting in my basement, so I will definitely make a second pinball machine with all the improvements I discovered along the way. I will also include a second Arduino mega since I probably need even more pins and this way I can split the processor load for the different tasks. However, what I didn’t show was the time which is needed to get to the final product. The playfields and the components are really old, we’re talking about a production date of 1974…so the playfield and all coils, switches etc. had over 40 years to collect dust, rust and other stuff….Striping the playfield, cleaning it, removing old mylar and glue and resealing it with clear coat takes a lot of time and then there is the cleaning of old contacts and coils the de- and re-soldering of all components, rebuilding the entire playfield… I would estimate it will take me about half a year for the next one, but I will definitely make another project about it :)

Anonymous user

2 years ago

This project really reminds me of my childhood. https://cookie-clicker2.com/

Anonymous user

2 years ago

Awesome job. I’m new to all of this I recently bought a old EM pinball machine and when I opened it up I was shocked to find wires cut and w wiring mess. Two 16 relay modules by sain something as well as a salon board. Then in the top box another 16 relay. It played til I bumped machine and a wire must have arced now no flippers and no ball will play when hit start button. Help anyone please

Anonymous user

2 years ago

Really nice project and well explained. I also want to bulit a pinball machine with my Arduino. My first idea was to connect the bumpers in parallel without an arduino...but your way is much better. I have some questions about the wirring and the MOSFET schematics. Am I right that I have to connect e.g solenoidPin_BumperLinks as PIN 7 as shown in the schematics? Do I need plus and minus from the 24volt power supply or I just need plus? Why do I need the Resistor R1? For the leaf switches e.g Bumper_Links I have to do a seperate wiring with the Arduino pins 5v and ground,right? Thanking you in anticipation and sorry for harassing you ;-)

Frogger1108

2 years ago

Could you show me a picture of your wiring? The only thing the 2 solenoids should have in common is the + side of you board, the Mosfet source (pin3) of all Mosfets should be connected to the common - and the Mosfet drain (pin2) to different pins on the arduino and to - via the 10k resistor. So in theory no Mosfet should be activated unless you open the respective Mosfet with the Arduino.

Frogger1108

2 years ago

Hi Pinballer300 No worries, pinball questions are always welcome :) If you want to use a MOSFET I'll assume you'll also use the LR540N since it's pretty cheap and reliable. If you want to use a different one make sure to check the schematics, some MOSFETS have a different GATE DRAIN SOURCE layout. The LR540N has the GATE on pin 1, followed by the DRAIN on pin 2 and the SOURCE on pin 3. This defines you're wiring, as the name suggests the GATE controls the flow of electricity which is the job of the Arduino so pin 1 is connected to your Arduino pin of choice which you want to use to control the solenoid. Pin 2 is the DRAIN which is connected to the negative side of your solenoid and the SOURCE is connected to your common ground (including your power supply for the mosfet AND the arduino ground). The positive side of your 24v power supply is only connected to the solenoid positive side. The 2 resistors serve different purposes, the one between the ground and the arduino (the "lower" one in the schematic) grounds the pin so it's not floating, use a 10K resistor. The second one between the Arduino and the Mosfet protects your Arduino pin and prevents the Mosfet from drawing too much current, Arduinos can only supply 40ma and once the Mosfet is turned "ON" it may draw more than that...or not, that is why many schematics skip that one. But since resistors are cheap and arduino pins are precious you should use one, a 470 ohm one worked fine for me. The Bumper wiring is completely independent from the Mosfet circuit, it’s basically a simple button/sensor read only switch. You connect it like any other input, 5v from the Arduino on one side and the other side to the input pin of your choice (with a resistor of course to prevent floating if you don’t use the internal ones). Test both circuits independently from each other, if you test the Mosfet circuit with the real pinball machine make sure to have the power off button for the 24V in reach, the coil will burn up pretty fast if current is constantly supplied :) In my next project I will adress this, a blow fuse between the solenoids and the power supply should work fine.

Anonymous user

2 years ago

wow ,this is a great project https://cyberflixapk.fun/cyberflix-tv-apk-download/

Anonymous user

2 years ago

Hey, it´s me again. I made the wiring exactly like you told me. It worked for one solenoid, thanks again! Now I want to repeat it with all solenoids. My problem is that, when I connect them with my breadboard I use one common ground and one pin for grounding ( I use the + and - row on a regular breadboard for the common ground and the other one for the 10k resistors). Now everytime, when the button switch circuit is detecting an Input all solenoids "kicking" , doesn´t matter which switch gets closed. For sure only the concerning solenoid should kick if the convenient switch gets pressed. Do I have to use different pins for the 10k resistor or do you have any hint what I can do? Thanks in advance Pinballer300

Anonymous user

2 years ago

Wow, thank you very very much for that detailed and fast answer. No I understand the circuit way better :-) Keep on doing your projects, thumbs up!

Anonymous user

2 years ago

Oh no, now I see my mistake... I forgot to connect the 10k resistors to - Now it works perfectly for every solenoid. Thumbs up.

Anonymous user

2 years ago

you helped me to do a project, thank you https://vivatvapk.co/download/

Anonymous user

2 years ago

Very nice combination of using both old and new equipment. Well explained and thought out. Congratulations.

Anonymous user

2 years ago

This is a great project and well done. I am a beginner and am trying to build a pinball arduino as well. I have been following your project for help and got your schematic. I looked at your schematic but it only showed the Uno attached to the Power plug. Is there more pages or schematics for all the wiring? Thank you.

Anonymous user

2 years ago

Thank u.. this is very much useful https://gbwhatsapp.fun/gb-whatsapp-apk-download/

Anonymous user

2 years ago

already have a second old playfield sitting in my basement, so I will definitely make a second pinball machine with all the improvements I discovered along the way. I will also include a second Arduino mega since I probably need even more pins and this way I can split the processor load for the different tasks. However, what I didn’t show was the time which is needed to get to the final product. The playfields and the components are really old, we’re talking about a production date of 1974…so the playfield and all coils, switches etc. had over 40 years to collect dust, rust and other stuff….Striping the playfield, cleaning it, removing old mylar and glue and resealing it with clear coat takes a lot of time and then there is the cleaning of old contacts and coils the de- and re-soldering of all components, rebuilding the entire playfield… I would estimate it will take me about half a year for the next one, but I will definitely make another project about it https://dltutuapp.com/ https://9apps.ooo/ https://showbox.run/

Anonymous user

2 years ago

This project really reminds me of my childhood. https://cookie-clicker2.com/

Anonymous user

4 years ago

Awesome job. I’m new to all of this I recently bought a old EM pinball machine and when I opened it up I was shocked to find wires cut and w wiring mess. Two 16 relay modules by sain something as well as a salon board. Then in the top box another 16 relay. It played til I bumped machine and a wire must have arced now no flippers and no ball will play when hit start button. Help anyone please

Anonymous user

4 years ago

This helps a lot https://typhoon-tv.com/typhoon-tv-apk-download/

Anonymous user

5 years ago

hi,The aztec & underwater turned out great!..I have a similar pinball project that im working on , i will get try get some photos up soon , did the coding take long -days , weeks ?thanks -bill

Frogger1108

2 years ago

Hi. The coding for the Aztec took quite a while, but once you build the different modules (bumpers, scoring, displays, etc.) it gets easier. the most time consuming part is of course testing the code on the machine itself :)

Anonymous user

6 years ago

This is a great project and well done. I am a beginner and am trying to build a pinball arduino as well. I have been following your project for help and got your schematic. I looked at your schematic but it only showed the Uno attached to the Power plug. Is there more pages or schematics for all the wiring? Thank you.

Anonymous user

2 years ago

Thank u.. this is very much useful https://gbwhatsapp.fun/gb-whatsapp-apk-download/

Anonymous user

6 years ago

already have a second old playfield sitting in my basement, so I will definitely make a second pinball machine with all the improvements I discovered along the way. I will also include a second Arduino mega since I probably need even more pins and this way I can split the processor load for the different tasks. However, what I didn’t show was the time which is needed to get to the final product. The playfields and the components are really old, we’re talking about a production date of 1974…so the playfield and all coils, switches etc. had over 40 years to collect dust, rust and other stuff….Striping the playfield, cleaning it, removing old mylar and glue and resealing it with clear coat takes a lot of time and then there is the cleaning of old contacts and coils the de- and re-soldering of all components, rebuilding the entire playfield… I would estimate it will take me about half a year for the next one, but I will definitely make another project about it https://dltutuapp.com/ https://9apps.ooo/ https://showbox.run/

Anonymous user

6 years ago

Hi! Great work on the machine! I am sort of new to Arduino, and have been sorting through your code. Could you explain something to me? :) If I look at the unten popbumper as an example, how do you make sure that the switch cannot be stuck, and thus burn the coil (or something else)? I have been trying to find a way without using 'delay' to have an output active for only a short while, after pressing a switch, whether the switch is held down or released. Thanks! :)

Frogger1108

2 years ago

Hi, Well, to be honest, I had one of the bumper switches stuck once and the best solution was to be fast with the main power button... The solution for this problem is one of the things on my "to do" list for the new pinball machine I'm currently working on. I've got a few ideas and I will check which one is the most feasible in terms of processor time since you can't afford too many delay commands. I also bought a couple of blow fuses which should also work in preventing a coil drawing too much. With those I will have to measure the draw of the individual coils to get the right size for the fuse. I'm sorry I don't have a solution already, my pinball projects have been delayed recently but I'm hopefull that I can start working on them again during august. If you find a solution please post it, I'd be happy to implement it. Kind regards

Frogger1108

2 years ago

Did you find a solution? I finished my secon machine and implemented a new routine that checks for the time each solenoid pin is HIGH. If any solendoid pin is HIGH for more than 2 seconds, all pins are set to LOW and the program shuts down to prevent any new activation. Works pretty good so far :) Did you have success with your project?

Anonymous user

2 years ago

Hi again. Being fast with the power button is not a viable option in the long run. We need to find a way for the output, to only stay on for something like 100ms after the switch is closed - whether it is held down or released. The output should go low. Weird that tone() has a duration setting, but digitalWrite doesn't. Yes, delay() is off limits :) I will let you know if I find something out.

Pinballer300

7 years ago

Really nice project and well explained. I also want to bulit a pinball machine with my Arduino. My first idea was to connect the bumpers in parallel without an arduino...but your way is much better. I have some questions about the wirring and the MOSFET schematics. Am I right that I have to connect e.g solenoidPin_BumperLinks as PIN 7 as shown in the schematics? Do I need plus and minus from the 24volt power supply or I just need plus? Why do I need the Resistor R1? For the leaf switches e.g Bumper_Links I have to do a seperate wiring with the Arduino pins 5v and ground,right? Thanking you in anticipation and sorry for harassing you ;-)

Pinballer300

2 years ago

Oh no, now I see my mistake... I forgot to connect the 10k resistors to - Now it works perfectly for every solenoid. Thumbs up.

Frogger1108

2 years ago

Could you show me a picture of your wiring? The only thing the 2 solenoids should have in common is the + side of you board, the Mosfet source (pin3) of all Mosfets should be connected to the common - and the Mosfet drain (pin2) to different pins on the arduino and to - via the 10k resistor. So in theory no Mosfet should be activated unless you open the respective Mosfet with the Arduino.

Frogger1108

2 years ago

Hi Pinballer300 No worries, pinball questions are always welcome :) If you want to use a MOSFET I'll assume you'll also use the LR540N since it's pretty cheap and reliable. If you want to use a different one make sure to check the schematics, some MOSFETS have a different GATE DRAIN SOURCE layout. The LR540N has the GATE on pin 1, followed by the DRAIN on pin 2 and the SOURCE on pin 3. This defines you're wiring, as the name suggests the GATE controls the flow of electricity which is the job of the Arduino so pin 1 is connected to your Arduino pin of choice which you want to use to control the solenoid. Pin 2 is the DRAIN which is connected to the negative side of your solenoid and the SOURCE is connected to your common ground (including your power supply for the mosfet AND the arduino ground). The positive side of your 24v power supply is only connected to the solenoid positive side. The 2 resistors serve different purposes, the one between the ground and the arduino (the "lower" one in the schematic) grounds the pin so it's not floating, use a 10K resistor. The second one between the Arduino and the Mosfet protects your Arduino pin and prevents the Mosfet from drawing too much current, Arduinos can only supply 40ma and once the Mosfet is turned "ON" it may draw more than that...or not, that is why many schematics skip that one. But since resistors are cheap and arduino pins are precious you should use one, a 470 ohm one worked fine for me. The Bumper wiring is completely independent from the Mosfet circuit, it’s basically a simple button/sensor read only switch. You connect it like any other input, 5v from the Arduino on one side and the other side to the input pin of your choice (with a resistor of course to prevent floating if you don’t use the internal ones). Test both circuits independently from each other, if you test the Mosfet circuit with the real pinball machine make sure to have the power off button for the 24V in reach, the coil will burn up pretty fast if current is constantly supplied :) In my next project I will adress this, a blow fuse between the solenoids and the power supply should work fine.

Anonymous user

2 years ago

wow ,this is a great project https://cyberflixapk.fun/cyberflix-tv-apk-download/

Pinballer300

2 years ago

Hey, it´s me again. I made the wiring exactly like you told me. It worked for one solenoid, thanks again! Now I want to repeat it with all solenoids. My problem is that, when I connect them with my breadboard I use one common ground and one pin for grounding ( I use the + and - row on a regular breadboard for the common ground and the other one for the 10k resistors). Now everytime, when the button switch circuit is detecting an Input all solenoids "kicking" , doesn´t matter which switch gets closed. For sure only the concerning solenoid should kick if the convenient switch gets pressed. Do I have to use different pins for the 10k resistor or do you have any hint what I can do? Thanks in advance Pinballer300

Pinballer300

2 years ago

Wow, thank you very very much for that detailed and fast answer. No I understand the circuit way better :-) Keep on doing your projects, thumbs up!

Anonymous user

2 years ago

you helped me to do a project, thank you https://vivatvapk.co/download/

proyectos330

7 years ago

Great project, and very well explained! I would really like from you to update this project with those improvements you identified during the development of this beautiful work... Maybe expecting to see a second 'improved' version from you :)

Frogger1108

2 years ago

I already have a second old playfield sitting in my basement, so I will definitely make a second pinball machine with all the improvements I discovered along the way. I will also include a second Arduino mega since I probably need even more pins and this way I can split the processor load for the different tasks. However, what I didn’t show was the time which is needed to get to the final product. The playfields and the components are really old, we’re talking about a production date of 1974…so the playfield and all coils, switches etc. had over 40 years to collect dust, rust and other stuff….Striping the playfield, cleaning it, removing old mylar and glue and resealing it with clear coat takes a lot of time and then there is the cleaning of old contacts and coils the de- and re-soldering of all components, rebuilding the entire playfield… I would estimate it will take me about half a year for the next one, but I will definitely make another project about it :)

Anonymous user

7 years ago

Very nice combination of using both old and new equipment. Well explained and thought out. Congratulations.