(Sorry for my bad English)

Hello guys, I need your help since I have no idea about electronic stuff. I have a table soccer and want to install motion sensors in the goals, so whenever the ball passes through the goal line, the computer counts 1 goal. The ball's diameter is aprox. 4 cm (1,6 inches). Since I can´t access the inside of the ball return cup (where the ball goes after it passes through the goal,) I can‘t install the goal counter there. So it really has to be placed in the goal.

I have the following questions regarding this project:

  1. What kind of sensor do I need for this? Keep in mind it has to be a sensor that doesn't disturbe the goal, when a player shoots I obviously don't want the sensor to block the ball. So it has to be pretty small and/or thin.

  2. Are there maybe any foldable or flexible sensors for this?

  3. What hardware is the best option for this matter: Rasperry Pi, Arduino or maybe others?

  4. Since my table soccer has a glass plate on top to prevent the ball from escaping the field, could I place some kind of laser motion sensor right one milimeter (0,03 inches) before the goal? Like a barrier that consists of multiple lasers in a row which point down through the glass and detect if an object passes through? Is this possible?

  5. It'd be pretty awesome also, if I could calculate the speed of the ball once it passes through the goal line in km/h or m/s (like in tennis for example.) Is this possible?

  • 3
    \$\begingroup\$ Typical hobbyst wil do this with IR sensor, arduino and some mathematics \$\endgroup\$
    – Mitu Raj
    Commented Sep 23, 2019 at 8:34
  • \$\begingroup\$ 5: yes, you need to know the size of the ball (make that a constant in your code), and how long it blocks them beam for. \$\endgroup\$
    – Chris H
    Commented Sep 23, 2019 at 13:53
  • \$\begingroup\$ Is the surface dark blue/green/black? Is the ball white? With a filtered photodiode (or >1) and a line-projecting red laser you might be able to get enough contrast to use reflective sensing. \$\endgroup\$
    – Chris H
    Commented Sep 23, 2019 at 13:55

1 Answer 1


Solution 1: For simplicity and cost IR sensor + Arduino would be a good sensor. This solution has some cons: you would need a line of sensors, to observe whole line of goal. Also, a pair (IR light emitter and a receiver) needs to occupy left and right pole of goal (or bottom-top lines of the goal). Weakness of this system is here: When ball crosses the goal line partially, and it doesn't land in the goal completely the sensor will trigger (I'm not sure if situation like partial-ball-in-goal happens in table soccer, just stipulating).
To sort it out you can place sensors deeper in the goal, or apply two lines of sensors, one at the very front of the goal, and other deeper, about ball diameter inside the goal (here you can calculate ball speed in the moment of goal).

Solution2: Arduino + IR proximity sensor. Easier to implement, less invasive, but may be problematic with accuracy.

Solution 3: Use Raspberry Pi plus camera and picture recognition framework (like OpenCV). It may seem a little bit more expensive, but there is no need of installing as many sensors as previous solutions.

The list is not complete, I am sure there will be much more ideas. These above come as first.
Good luck with your project!

  • \$\begingroup\$ Does the ball ever pass through the goal above the surface? If it's never in flight, a single sensor pair would work. \$\endgroup\$
    – Chris H
    Commented Sep 23, 2019 at 13:52
  • \$\begingroup\$ Logic written on the basis of single sensor pair will fail if it is a goal line save \$\endgroup\$ Commented Sep 24, 2019 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.