(Topic ID: 103850)

DIY: Time your balls

By lyonsden

9 years ago


Topic Heartbeat

Topic Stats

  • 45 posts
  • 10 Pinsiders participating
  • Latest reply 9 years ago by lyonsden
  • Topic is favorited by 19 Pinsiders

You

Linked Games

Topic Gallery

View topic image gallery

Arduino-TZ-TV.JPG
IMG_3493.JPG
IMG_3492.JPG
IMG_3490.JPG
IMG_3491.JPG
surewhynotlol.png
content.jpg
IMG_3481.JPG
IMG_3476.JPG
IMG_3474.JPG
IMG_3473.JPG
IMG_3464.JPG
IMG_3463.JPG
IMG_3461.JPG
IMG_3462.JPG
IMG_3460.JPG

You're currently viewing posts by Pinsider lyonsden.
Click here to go back to viewing the entire thread.

#1 9 years ago

We've read the posts and heard the stories. Legendary huge balls that never drain. 5 min, 10 min, 30 min -- the stories make those balls last forever. But do you really believe them? Now, with only a little bit of work, you can demand big-ball proof.

Or, as in my case, discover how much you really suck. Did my ball in IM really last 15 seconds? Yep.

This DIY guide will walk you through building a ball timer with an 8 digit LED display that you can mount right by the drain. So as you watch your balls drain, you can learn how much you rock (or suck).

This uses an Arduino and the program:
Starts the timer on ball launch
Stops on ball drain with a 10 second countdown so you can checkout your time before the timer starts again.
Has a debounce delay to tolerate multiball

IMG_3472.JPGIMG_3472.JPG

Note: This video sucks. It is ridiculously hard to play IM with one hand while watching the ball though an iPhone's camera.

#2 9 years ago

The parts list:

Arduino Uno (Knock-off used in this tutorial: DCcduino Uno)

8-Bit 7 Segment Red LED Display: ebay.com link: itm

Connector, 0.1" Plug, 5 Pin (Part Number: CP100-05-LR: https://www.greatplainselectronics.com/products.asp?cat=69)

Crimp Contact, 0.1" (5x) (Part Number: 08-52-0123: https://www.greatplainselectronics.com/products.asp?cat=73)

Connector, 0.1" Header (Part Number: CH100-40T-0.318: https://www.greatplainselectronics.com/products.asp?cat=154)

22 gauge wire I like: ebay.com link: itm
for harnesses and solid core works well when connecting to arduino header

Connector, Plug, 3-Pin, 0.093" ( Part Number: 03-09-2032 https://www.greatplainselectronics.com/proddetail.asp?prod=03-09-2032)

Crimp Contact, 0.093", Pin (Part Number: 02-09-2118 https://www.greatplainselectronics.com/products.asp?cat=89)

Male 2.1mm Cable Plug: ebay.com link: itm

Aligator clips

1k ohm resistor

200 ohm resistor

Heat shrink tubing

Double sided mounting tape (http://www.amazon.com/Scotch-Exterior-Mounting-1-Inch-60-Inch/dp/B00004Z4BV/ref=sr_1_9)

IMG_3372.JPGIMG_3372.JPG
IMG_3362.JPGIMG_3362.JPG
IMG_3356.JPGIMG_3356.JPG
IMG_3359.JPGIMG_3359.JPG

IMG_3456.JPGIMG_3456.JPG
IMG_3458.JPGIMG_3458.JPG
IMG_3455.JPGIMG_3455.JPG

#4 9 years ago

Tools:

Soldering iron
Solder
Wire cutter
Crimper
Heat gun
Magic helping hands
Computer and USB cable (programming the Arduino)

IMG_3484.JPGIMG_3484.JPG

#5 9 years ago

Step zero: Load the Sketch on the Arduino

Link to sketch: https://github.com/elyons/pinball/blob/master/time_your_balls/time_your_balls.ino
Okay, learning how to load a sketch is beyond the scope of this tutorial. Getting started with the Arduino is pretty easy, and there are already some excellent sources to get you going:

1. Get started http://arduino.cc/en/Guide/HomePage

2. You'll need to load an external library for writing to the LED display
A: How to: http://arduino.cc/en/Guide/Libraries
B: LedControl Library: http://www.wayoda.org/arduino/ledcontrol/index.html#Download
Note: This library needs to be edited before it can be used with your Arduino

LedControl.h

24,25c24

< //#include <WConstants.h>

< #include <Arduino.h>

---

> #include <WConstants.h>

-----------=======================----------------------

LedControl.cpp

21c21

< #include "Arduino.h"

---

> #include "WProgram.h"

Screen Shot 2014-09-21 at 7.02.21 AM.pngScreen Shot 2014-09-21 at 7.02.21 AM.png

#6 9 years ago

Step one: Power harness

1. Cut 2x 22 gauge wire (2' each)

2. Use "Crimp Contact, 0.093", Pin" and pin each cable

3. Push what will be the negative wire into the top hole of "Connector, Plug, 3-Pin, 0.093" " (pointed top)

4. Push what will be the positive wire into the center hold of "Connector, Plug, 3-Pin, 0.093" " (5V accessory power)

5. Cut and place heat shrink tubing onto wires

6. Solder positive and negative of "Male 2.1mm Cable Plug" to 3-pin connector plug wires
Note: Negative is outside; positive is inside

7. Place heat shrink tubing over solder joint, heat, and shrink

IMG_3458.JPGIMG_3458.JPG
IMG_3459.JPGIMG_3459.JPG

#8 9 years ago

Step two: LED Display Harness

1. Cut 5x 22 gauge wire (1-2' each)

2. Use "Crimp Contact, 0.1" " and pin each cable

3. Push crimp contacts into "Connector, 0.1" Plug, 5 Pin"

4. Solder other end of wires to "Connector, 0.1" Header"
Note: The wires will run in a set of three to one side of the Arduino, and a set of two to the other side of the arduino

IMG_3456.JPGIMG_3456.JPG
IMG_3457.JPGIMG_3457.JPG

#9 9 years ago

Step Three: Switch Digital Read Harness

1. Cut 4" of 22 gauge wire (use solid core); cut 2' of 22 gauge wire
Note: 4" wire will be used as a pull down between the ground and your sensing pin on the Arduino
Note: 2' wire will be used to connect to trough micro switch

2. Solder 1k ohm resistor to one side of 4" wire
Note: I doubled back the wire on the end of the resistor to give it more girth so it stays in the arduino pin-in better

3. Strip other side of 4" wire to connect into Arduino

4. Strip middle of 4" wire

5. Solder 2' wire to middle of 4" wire

6. Protect solder joint with heat shrink tubing

7. Attach alligator clip to other end of 2' wire (to connect to trough microswitch)
IMG_3356.JPGIMG_3356.JPG
IMG_3379.JPGIMG_3379.JPG

#10 9 years ago

Step Four: Switch Pull Up Harness

1. Cut 2' of 22 gauge wire (use solid core)

2. Solder 200 ohm resistor to one side

3. Attach alligator clip to other end (to connect to trough microswitch)

IMG_3359.JPGIMG_3359.JPG

#11 9 years ago

Step Five: Wire up!

I'll detail the wiring and plugs below, but you'll now need to connect:

1. The LED Display Harness to the Arduino and the LED Display

2. The Switch Digital Read Harness to the Arduino and one side of the trough switch

3. The Switch Pull Up Harness to the Arduino and one side of the trough switch

4. The Power Harness to the Arduino and the accessory plug in the pinball cabinet (located near the right-front)

IMG_3389.JPGIMG_3389.JPG
IMG_3448.JPGIMG_3448.JPG

#12 9 years ago

Wiring the LED Display Harness:

1. Plug LED display harness into LED display
Note: make sure you are connecting to the "data in" side
Note: you can bend the header pins if you want the wires to come off at an angle

2. From the other side of the harness, split the header pins so that the two wires for power (VCC) and ground (GND) are in a pair. Connect those to the 5V and GND of the Arduino

3. Connect the other header pin harness (three pins) to digital header plugs 2, 3, 4 on the Arduino
Note: Make sure that the pin going into Arduino 4 is connected to the data in (DIN) of the digital LED
Note: You can change which pins are used in the Arduino Sketch

Note: In the photos below, the Switch harness are also plugged in:
Pin5: Digital read in from the Switch Digital Read Harness
GND: Pull down for the Switch Digital Read Harness
5V: Switch Pull Up Harness

IMG_3457.JPGIMG_3457.JPG
IMG_3455.JPGIMG_3455.JPG
IMG_3452.JPGIMG_3452.JPG

#13 9 years ago

Wiring the Switch Digital Read Harness:

1. Connect the side with the resistor to the free ground (GND) on the Arduino (next to the GND used in the LED Display Harness)

2. Connect the side without the resistor to digital header plug 5 on the Arduino (next to pins 2,3,4 used in the LED Display Harness)

3. The alligator clip will be used to connect to trough microswitch

Note: See above for photos of where these are plugged into the Arduino

IMG_3379.JPGIMG_3379.JPG

#14 9 years ago

Wiring the Switch Pull Up Harness:

1. Connect the wire with the resistor to Arduino header plug 5V

2. The alligator clip will be used to connect to trough microswitch

Note: See above for photos of where this is plugged into the Arduino
IMG_3359.JPGIMG_3359.JPG

#16 9 years ago

Power Harness:

1. Plug "Male 2.1mm Cable Plug" into the Arduino

2. Plug "Connector, Plug, 3-Pin, 0.093" " into accessory plug on pinball machine
Note: located near the right side of the door in the cabinet
IMG_3458.JPGIMG_3458.JPG

Note: this picture shows the USB plug (left) and 2.1mm power plug (right). Also, this Arduino died in the making of this project. If you run too much current through one, it will start to smoke. I pulled the main chip (Atmega) and tried to replace it with a working one. No dice.
IMG_3486.JPGIMG_3486.JPG

#17 9 years ago

Step six: connect to ball trough microswitch

1. Find the left-most trough microswitch.
2. Connect the Switch Pull Up Harness' alligator clip to the right side of the switch
3. Connect the Switch Digital Read Harness' alligator clip to the left side of the switch

Note: In case you are curious to know how this works (or how I think it works), the pinball switch matrix is sending pulses along the switch current. When the switch is closed, the switch matrix periodically grounds (completed the circuit) and the Arduino sense a LOW state from the Switch Digital Read Harness. This is "noisy" as the switch matrix is pulsing fast. Very fast. So over some period of time, the Arduino sense many LOW states and many HIGH states.

When a ball leaves the trough, the switch is open. The Switch Pull Up Harness is supplying power across the switch and the Switch Digital Read Harness will read only HIGH (mostly).

Based on the Arduino code, the Arduino is recording those states over .5 seconds and then checking to see how many LOWs it has recorded. This number goes up very quickly when the ball is in the trough and depressing the microswitch, and very slowly when the ball leaves the trough and the microswitch is not depressed. If you check out the Arduino Sketch, you'll see that there are some arbitrary numbers that I've set combined with some heuristics to determine the state of trough (ball in or ball out). Overall, it works, but sometimes it takes a little while for things to get working (perhaps due to need for electricity to flow downhill? I really don't know.) Even then, it does screw up occasionally. This is because the switch does ground when the ball is out of the trough due to (I think) other switches being activated (in the column/row).

A bit more on the resistors/pull up and pull down. There is a balance here. You need to supply some voltage across the switch for the arduino to sense when the switch is open, but not so much that it activates the entire column of switches. The pull down is needed to keep the digital read-in in a LOW state, but not so much that it cancels the pull-up. After trying many combinations with the resistors I had on hand (empirical science), the 1000ohm pull down / 200ohm pull up worked. Your results may vary, but post them here and add to the pool of knowledge.

More about pinball switch matrices: http://www.pinballnews.com/learn/matrix.html

IMG_3479.JPGIMG_3479.JPG
IMG_3476.JPGIMG_3476.JPG

#18 9 years ago

Step seven: test

Test, test, test.

With everything hooked up, check to see if the timer works.

1. Turn on the machine.
2. If the LED display does not start, try pressing the restart button on the Arduino. I have (as have others) noticed that some LED displays do not initialize properly when the Arduino is powered from an external source (as opposed to being powered from the USB cable plugged into a computer.) Mine was behaving that way. I have added a couple of additional initialization steps in the code that counter acted this. If it still doesn't initialize after using the reset button, try powering with a USB cable. If it still doesn't initialize, try breadboarding the display (see photo and post/PM for more information).
3. When the LED display starts, the code has a 10 second countdown before it will sense if a ball is out of the trough. This will be a flashing 9, 8, 7, 6, etc on the left-most digit of the display. This countdown is also triggered when the ball drains and the time stops so you can check your time before the next plunge. I've also added code that requires the timer having passed 10 seconds before the countdown is initiated in case you get a house ball and the ball saver kicks in and auto-plunges your next ball. That's right, I care about such things.
4. Go to switch test. Make sure that a column/row of switches is not being activated by the pull-up. Connect/disconnect the alligator clip to test.
5. Manually eject a ball and see if the timer starts (use your hand to kick a ball from the ball eject coil)
6. If the timer does start (wait 5 seconds the first time), then either there isn't power from the pull-up, or the pull-down is too strong. Time to play with resistors and a multimeter.
7. After the timer has started, wait 10-15 seconds and drain the ball. See if the timer stops (may take a couple of seconds the first time) and the countdown on the timer starts (flashing number in the left-most digit). If it doesn't, then you may have too much power coming from the pull-up (doubtful). Post your stuff here and we'll figure it out.

Other problems: post them to this thread!
IMG_3389.JPGIMG_3389.JPG
IMG_3448.JPGIMG_3448.JPG

#19 9 years ago

Breadboard: Great way to test!

So things aren't working, or you want to get things set up before making the harness. Break out a breadboard and have some fun. It is easy to connect the display to a breadboard, then run wires to your Arduino. This was the basic setup I used while developing the timer code before I started to tackle the whole "how to detect the state of a pinball switch" problem.

IMG_3488.JPGIMG_3488.JPG
IMG_3487.JPGIMG_3487.JPG
IMG_3489.JPGIMG_3489.JPG

#20 9 years ago

Step eight: Mount the hardware

1. Take off the apron

2. Cut some double sided mounting tape and stick to the back of the Ardunio. (Note: I used two pieces stacked on top of one another to get enough thickness to get beyond the soldered pins on the back of the Arduino

3. Mount Arduino to the underside of the apron (position right!)

4. Bend the LED display's header pins so the plug comes off at a 45 degree angle. This will help feed the wires to the "top" (bottom side of the apron) of the ball drain and keep them out of the way of draining balls.

5. Cut some double sided mounting tape and stick to the side of the LED display.

6. Mount the LED display to the side of the apron where the ball drains. Position it high and close to the drain so it won't interfere with draining balls. The wires will run up to the inside-bottom of the apron.

7. Tape wires to underside of the apron to keep them out of the way.

8. Conveniently, there is a hole in the right side of the playfield under the apron where you can run wires. Run the Switch and Power wires through that hole.

9. Connect everything and reattach the apron.
IMG_3460.JPGIMG_3460.JPG
IMG_3462.JPGIMG_3462.JPG
IMG_3461.JPGIMG_3461.JPG
IMG_3463.JPGIMG_3463.JPG
IMG_3464.JPGIMG_3464.JPG
IMG_3473.JPGIMG_3473.JPG
IMG_3474.JPGIMG_3474.JPG
IMG_3476.JPGIMG_3476.JPG
IMG_3481.JPGIMG_3481.JPG

#23 9 years ago

Final thoughts:
First off, I can't believe that even after all the careful note taking, photos, and writing, I spent another two hours posting this. That's about the same time (probably more) as it takes to make the wiring harnesses for this project. Unlike my previous DIY, I am not taking as many detailed photos of how to make the wiring harnesses. Refer to those if you want detailed photos and descriptions (as well as tips and tricks).

The motivation behind this was having an LED display and thinking up something fun to do with it that involved a pinball machine. Also, I wanted to dig into sensing switch states. I think the project turned out pretty well.

Overall, the wiring for this project isn't too bad. The worst part was figuring out the heuristics and logic for detecting the switch state, and the fact that the LED wasn't initializing correctly when powered from an external source (non-USB). I've only installed/test this on IM, but it should work for any Stern with ball trough microswitches. Moving to another manufacturer with microswitches should work, but the code for scanning the state of the microswitch may need to change depending on the switch matrix scanning rate. Opto troughs should be easier, but I haven't dug into that.

Finally, every time I post a DIY people ask for pre-assembled kits. In the past I've said 'no' as there are great vendors selling similar products, but this time I'll say 'maybe' since no one is selling something similar. A few of us pinsiders (prosedsp, copperpot, and me) have banded together to make Professor Pinball. We are working on the IM chase lights right now, but feel free to PM that account (prof_pinball). We'll gauge interest in these timers and perhaps make a batch (after the IM chase lights).

#24 9 years ago
Quoted from copperpot:

Instructions Unclear, how much milli-watt do I need to drop ohm on the amp voltage again? And what do I do with the alligator clips once I don't want them on the ball trough anymore?
-Wes

Complete gibberish! Must be dead pirate talk. I am glad that I've named you as part of the prof_pinball team.

#25 9 years ago
Quoted from Aurich:

Very cool, Iron Man is the perfect game for it.
So here's a thought about mounting it: What if you put it in the right hand instruction card spot, run the wires down through the apron. Then we could design an instruction card with a design that had a rectangular hole in the middle that would frame the counter. Could make it look pretty integrated with the game.

This is an excellent idea. I didn't want to cut my apron (yet), but I really like the idea of a custom instruction card! With the red LEDs and the IM artwork, something cool could easily be made (by someone with art talent, that is.)

#26 9 years ago
Quoted from FrederikFrost:

Cool! Alot of effort though... You can wear a watch?

What is this 'watch' of which you speak? I haven't seen one in years. . . but I do miss my casio from grade school.
content.jpgcontent.jpg

#27 9 years ago
Quoted from Captive_Ball:

For the lazy and/or unabled....would you consider selling these?

PM prof_pinball and we'll see how much interest there is.

#30 9 years ago
Quoted from rai:

I like to look at the audits to see the average ball times or game times.
Sorry didn't read the entire thread doe this count till the last ball drains as when you get multi ball during play?

Averages are good for averages, but you don't see how well you did on a particular good (or bad) ball. This times each ball in play. Also, it handles multiball fine so the timer doesn't stop until the last ball drains.

#32 9 years ago
Quoted from Aurich:

Right, the advantage of this idea is you don't have to cut your apron, there are holes under where the instruction card goes that could hold the wires, you could rig some kind of mount in the depression there for the display that wasn't permanent, and the only cutting would the instruction card.
If you figure out how to make that work and can send me the template for the card I can do some kind of artwork for it.

I think the LED Display is too thick for mount on top of the apron without cutting. It is about 3/4" tall (there are some side photos of it that show it is about 1/2 the height of a flipper. However, I'll check it out and take a photo.

#35 9 years ago
Quoted from Aurich:

Right, the advantage of this idea is you don't have to cut your apron, there are holes under where the instruction card goes that could hold the wires, you could rig some kind of mount in the depression there for the display that wasn't permanent, and the only cutting would the instruction card.
If you figure out how to make that work and can send me the template for the card I can do some kind of artwork for it.

It looks almost perfect, except that is where the mounting bolts are for the apron.
 nice place to fit the LED display if it weren't for that bolt/nut nice place to fit the LED display if it weren't for that bolt/nut
With the nut in place, the display sits too highWith the nut in place, the display sits too high
But the indentation is a perfect fitBut the indentation is a perfect fit
About 1/4 inch poking outAbout 1/4 inch poking out

#37 9 years ago
Quoted from copperpot:

Dude, cutoff those header pins standoffs and solder them directly to the board You'll buy yourself the space you need... I think... Relocate the capacitor while you are at it... 90% of the way there.
-Wes

Smart man; great idea.

#39 9 years ago
Quoted from RyanClaytor:

This is awesome! Great work, lyonsden. Just out of curiosity, did I miss a total price for all the materials (sorta skimmed some of it). If not, would love to know.
Best,
Ryan Claytor
Elephant Eater Comics
http://www.ElephantEater.com

I didn't put a price on this one -- BOM is mostly the LED display ($4) and the Arduino ($10-20). Having the other parts on hand helps, otherwise those will add up. I'm guessing around $20-30.

#41 9 years ago
Quoted from Thor-NL:

Sweet!! Respect lyonsden
Definatly going to give this a go for one of my B/W, with those detailed instructions all hard work is done. Thank you!
(sorta reproduced Ed Cheung's TV-mod for TZ with an Arduino )

Arduino-TZ-TV.JPG 128 KB

Thanks Thor! Post yours with the Video playback. That looks sweet!

1 week later
#42 9 years ago

Just curious, anyone else make one of these yet? Would like to hear how it was worked for other people.

#44 9 years ago
Quoted from swampfire:

Favorited. This would make a great tournament goal - see who can get the longest ball on IM without cradling. We could even get fancier with it and add a cradle timer. Cradle longer than 2-3 seconds and you're disqualified. Loud buzzer sound.

The cradle warning is an excellent idea!

Promoted items from Pinside Marketplace and Pinside Shops!
From: $ 99.99
Cabinet - Other
Lighted Pinball Mods
 
6,500 (OBO)
Machine - For Sale
Dixon, CA
$ 99.99
Lighting - Other
Lighted Pinball Mods
 
$ 20.00
Playfield - Protection
Pinhead mods
 
$ 64.00
Lighting - Under Cabinet
Lermods
 
$ 58.00
Playfield - Toys/Add-ons
Lermods
 
From: $ 25.00
Cabinet - Other
Rocket City Pinball
 
$ 11.95
Playfield - Toys/Add-ons
ULEKstore
 
$ 78.00
Playfield - Toys/Add-ons
Lermods
 
$ 44.99
Cabinet - Shooter Rods
Pinball Shark
 
$ 200.00
Lighting - Interactive
Professor Pinball
 
$ 44.99
Cabinet - Shooter Rods
Pinball Shark
 
$ 12.50
Playfield - Decals
Pinball Invasion
 
$ 54.99
Cabinet - Shooter Rods
Lighted Pinball Mods
 
$ 10.00
Cabinet - Other
Filament Printing
 
$ 30.00
Playfield - Other
YouBentMyWookie
 
$ 40.00
Playfield - Protection
Duke Pinball
 
$ 79.99
Cabinet - Armor And Blades
PinGraffix Pinside Shop
 
$ 46.00
Playfield - Toys/Add-ons
Lermods
 
$ 87.00
Playfield - Toys/Add-ons
Lermods
 
$ 24.95
5,000
Machine - For Sale
Dunkirk, MD

You're currently viewing posts by Pinsider lyonsden.
Click here to go back to viewing the entire thread.

Reply

Wanna join the discussion? Please sign in to reply to this topic.

Hey there! Welcome to Pinside!

Donate to Pinside

Great to see you're enjoying Pinside! Did you know Pinside is able to run without any 3rd-party banners or ads, thanks to the support from our visitors? Please consider a donation to Pinside and get anext to your username to show for it! Or better yet, subscribe to Pinside+!


This page was printed from https://pinside.com/pinball/forum/topic/diy-time-your-balls?tu=lyonsden and we tried optimising it for printing. Some page elements may have been deliberately hidden.

Scan the QR code on the left to jump to the URL this document was printed from.