Would this be a job for an IR Transmitter/Receiver?

Hi all

A buddy of mine and I recently built a foosball table. We decided it would be great if we could build an electric score keeper.

If we setup an IR transmitter / receiver in the goal post, and when the ball flys it and interrupts the signal that would send a message adding up the score. Pretty basic stuff, but would the IR sensors be fast enough to capture this information? Or is there another sensor I should be using for this type of work?

Thank you.

IR is more than fast enough for this use.

Weedpharma

You'll need to have a way of making sure the score doesn't increment many times while the ball is in the beam: the Arduino is likely to loop a bunch of times during that short period.

Have a look at this example, where the switch is only counted when it becomes pressed as opposed to is pressed: one count per press.

Edit: You may find Part 2 and Part 2 Revisited of my attachment to this thread of use.

JimboZA: You'll need to have a way of making sure the score doesn't increment many times while the ball is in the beam: the Arduino is likely to loop a bunch of times during that short period.

Have a look at this example, where the switch is only counted when it becomes pressed as opposed to is pressed: one count per press.

Edit: You may find Part 2 and Part 2 Revisited of my attachment to this thread of use.

I'd probably go a step further. Once a goal has been detected, don't start detecting again until the ball has been put back into play (the ball could bounce off the back of the net and a hand going in to retrieve it could also upset the score).

Maybe an RFID chip in the ball and some detectors under the relevant parts of the pitch could be used to detect that it's been brought back into play. Failing that, a simple push button.