arcade basketball++

Hey Guys and Gals,

I stumbled across the Arduino when looking for ways to improve my arcade basketball hoop.

http://www.digizon.net/index.php?main_page=product_info&cPath=29&products_id=462

The hoop itself is fine, but, since I have the older model, the hoop has a plastic lever/arm that gets depressed when a shot is made. The plastic arm sends a signal to the score unit, and 2 points are added to the score. This setup works fine in general, even with heavy use from kids and adults alike. However, the ball does get stuck in the net because of that lever, and shooting too quickly (or having a ball bounce on the rim while shooting another shot) can cause some shots to not get detected since the lever doesn't get a chance to reset. There has also been cases of when a ball bounces a bit too much, and awards extra points. While these are small gripes, I think I can do better, and i like building things :wink:

I do know they made a new version of this hoop with IR sensors, but all the reviews say how lousy they are at detecting made shots...so I figure I could make my own.

My plan is to use a few IR sensors (2 per hoop, for a total of 4 IR sensors) to detect the made shots. I would use some code wizardry to make sure only made shots get counted and when a made shot is detected, send a signal to the main controller just like the old lever would do. The good news is that the game uses rj11 wire to connect all the electronic pieces, so, getting the new sensors to interface with the main controller is easy, and its also convenient to reverse the modification.

So, to make this happen, I was planning on getting an Arduino MEGA 2560 R3, or a Arduino Due. Im not sure how much horsepower I need to make this new scoring detection system very fast, and very accurate, what do you guys think?

I was also looking at these sensors:

or

I'm not sure what one would be best for my purposes, but I know that i only want to see about 0->15cm, The hoop diameter is 1ft, but the ball itself is about 7" diameter, so I don't need the sensor to see far. I also need them to be able to detect things quickly, since people will be shooting at a fast rate, as well as not giving false positives.

If this project goes well, I may even try to replace or somehow interact with the main control unit to add high score saving, outputting the top player to an android device, different game types, and what ever else I can think of. But again, these are a maybe if I feel like it wont be to much of a headache to implement.

To give you a lil background about me, I am a software engineer by trade (i used to make games in C/C++, now I work on the fringe of the game industry, but I still love C/C++) so coding inst a problem. I also have experience designing small TTL circuits in college...but that was a long time ago :wink: I still have my copy of circuit maker on my home computer as well as my text books, so getting back into the hardware side of things shouldn't be too big of a problem.

With all that said, I'm looking for advice on the parts I plan on purchasing, any potential pitfalls, and and any other ideas and wisdom you guys can share.

Thanks 8)

i guess nobody has any experience doing what I'm trying to do? I find that hard to believe, but oh well.

Anyway, after taking some measurements, I see that the Sharp GP2D120XJ00F will be best for my needs. However, I still have some concerns that it may not do the job well enough, so I am also looking into ultra sonic sensor.

Im not sure how much horsepower I need to make this new scoring detection system very fast, and very accurate

Any old Arduino will do the job just loafing along :slight_smile: Analog readings occur 10,000/sec.

You should just try out the IR sensors and see what happens. I would use an oscilloscope for initial analysis but its not necessary. You will need to have a delay in the software after a ball is detected to avoid double counting.

thanks for the reply! I ordered an arduino mega, and 2 ultra sonic sensors since they were cheap. ($5 each) If they dont work, then I'll try the IR ones, but since they are $20 each, i hope I wont need them. If i have to get 4 of them, then thats $80 in sensors alone!

I think the ultrasonic sensors + the new ping code should get me...esp if the new-ping code works as well as I hope.
https://code.google.com/p/arduino-new-ping/

IR ones, but since they are $20 each

Dude! Like are these gold plated?

There are various IR sensors... Some expensive ones are microbolometers

Other are human motion detectors

Others care for IR remote controls

Others are just for detecting infrared light

I think you want to be in the cheap category! XD

Ray

so, i got my board and 2 sensors. I think one was DOA, but the other one works well. I'm not sure if i should get a replacement, or if I should pay for those IR ones... :~

Anyway, I took the levers off (the scoring mechanism on the hoop) and opened them up. I figured since its a simple system (hit the lever down, and send a signal the the main board) I thought i would find something like a button on a joystick. However, I found out that it uses an IR system, and when the lever is in the down position, it breaks the beam, and the score gets counted. Kinda ironic.

anyway, there are 2 wires to each sensor, the sender gets red and black, and the receiver gets green and yellow. If there were more than 4 wires, I would guess that one would be power, one would be ground, and one would be the signal, but with 2 wires, I'm not really sure how the main cpu gets the signal to score 2 points. Is there some sort of way that interrupting the beam stops the current? Or changes the current?

can anybody take a guess how this thing works? Also, is there a way to use the arduino to read whats going on? Maybe if i get a spare phone cord, and get each lil wire and connect it to the arduino input pins...?
If not that is there a way to test continuity without stripping the wires, or ungluing the IR sensors? I would love to keep these un-molested incase i need to return this back to "stock"

Sorry for so many questions!
Thanx in advance and all the advice given so far.

Measure the voltages in both states, light path open and blocked. The sender should be unchanged. The receiver will alternate +V hi/low. Most likely a simple opto-interrupt circuit. If you are lucky it is already converted to logic levels.

Thanks for the info! Am i able measure the voltage states without stripping the wires?

after doing some research, I may just stick to the HC-SR04 sensors. Not only are they cheaper, but the minimal range (about 2cm) is better for my project than the minimal range for the Sharp GP2D12 (about 4in)

Maybe a hybrid approach will work..but seeing as i got 10 HC-SR04 for about $17 shipped (on ebay) i may just give up on the IR sensors unless ultrasonic ones dont work as well as I hope...seeing as there will be 4 of them for my project.

anyway, here is some info i found on the IR sensors that maybe others will find useful:

long time no see!

I gotten busy a lil after starting this project (i had my first kid, started working far away, etc) but now I have a lil time and motivation to do this. I was at my old HS, and saw that they have a shooting machine. This thing counts your made shots, funnels all shots (made or missed) in its giant basket, and fires a pass at you ever interval. I saw that it only had 1 sensor right under the rim, so I figured I can copy their method. The thing is, the big ball catcher prevents shots from triggering the sensor unless the ball goes thru the net. I dont have this luxury, but I will try it anyway. Its the easiest to implement, and if works will have the cleanest install results. With this info, I went home and I saw that some infrared distance sensors were cheaper than the last time i checked, so i bought 2. The sonic sensors were too bulky, and I couldn't figure out a good way to mount them and keep them from getting beat up like i can with the smaller infrared sensors.

So, today, i sat down and set some goals.

  1. get the arduino to recognize a button press from an arcade button. I used the button example as a base, and added the blink code. The idea is to turn on the led when i press the button, and turn it off when the button is released. The led would light up as soon as i pressed the button, but it wouldn't turn off right away. It was like there was some sort of delay. (i would rapidly press the button, and the serial output would eventually show me what i did) In the end, it wasn't important.

  2. I had to figure out how the game takes input to score. It turns out that out of the 4 RJ11 wires, only 2 are needed. The way the system works is that there is an infrared light emitter and receiver. the lever blocks the path. Once the lever is depressed, the light can pass thru, and once the light is blocked again (the lever sprung back into place) the game score 2 points. To simulate this, i just had to change "connect" the red and black wires, then disconnect them.

  3. i first used my arcade button and a bread board to "connect and disconnect" the red and black wires (i was scoring points with the push of a button 8) ) then i made a sketch for arduino to do it for me. Again, I took the blink code as a base, and added another pin that was constantly on, and ever second, i would cut the signal for one wire, causing the game to score the points.

Now that is done, I just have to wait until the sensors come in. In the mean time, I have been kicking around the idea that I want to have the arduino talk to my android device, so i can store high scores and what not. I see there are a few methods to do this, one is bluetooth and the other is serial via usb. My cheap and old device doesn't have bluetooth, so, I'm left with serial output option. I'll have to figure if my cheap android device can even do what i want tho, lol

[edit] i also would like to intercept the BCD info (the score and maybe time remaining) an ideas on how to do this? The BCD display has 3 digits, the the back has 10 pins (5 on top 5 on bottom) so, im sure each pin is one bit. i guess i need to get to soldering... :X

i finished it! It works fairly well, but not perfect. I had this somewhat complicated sketch to count baskets; it was supposed to not count nearly made baskets, identify if the net was block the sensor (since im only using one sensor) and some other things....it didn't work! lol :stuck_out_tongue: (it may actually work, i made some bone head errors in that sketch I caught after the fact)

However, I went to a simple system, and it worked much better. The simple sketch gets about 85-95% of the shots correct. There are clearly times when shots go in and they are not counted, and times where near misses and in and out misses get counted. I'll have to keep trying new things in the future, but for now it works. good enough. There may not be much i can do since I'm only using one sensor, but i think arcade basketball hoops at actual arcades only have one sensor too. Ill just have to see how the big boys do things, but for now I'm happy.

Take a look:
http://kablammyman.webs.com/arcadeHoops.html