# What type of sensor to detect if an object passes through?

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?

• Typical hobbyst wil do this with IR sensor, arduino and some mathematics Commented Sep 23, 2019 at 8:34
• 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. Commented Sep 23, 2019 at 13:53
• 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. Commented Sep 23, 2019 at 13:55