So, I've been coding for many years, but am new to sensors and electronics. As a learning project I've decided to make a foosball game with automatic scoring count.
Basically what I need is a sensor which detects when the ball passes through the goal opening.
One way would be to lead the ball, when it is inside the goal pit, toward to a single optical (or pressure) sensor. But this gives some time lag, and also may fail if the ball bounces back out.
So ideally I would like it to detect exactly when something passes through the opening, perhaps also say something about its size.
Could this be done with a relatively simple (i.e. not too expensive) sensor set up? Would I need some kind of array, or can it be done with one or two sensors?
It looks like I'll have to build my own photogate. The ones already available does not cover a big enough area.
After a bit of pondering, this is what I've come up with:
By alternating which led is turned on rapidly, I can triangulate the position of any object inside the goal area based on the position of the shadows from each led:
With a known position I can also estimate the size of the object passing based on the size of the shadows.
A few questions remain though:
Will the arduino be fast enough to detect a ball passing through in a few milliseconds?
Does the IR leds radiate in a wide enough field to light up the entire sensor array?
Thanks again! Given that speed is not a problem and limited emission field I've come up with a modified approach:
Cycling through all the emitters gives an overdetermined linear system from the shadows. A more accurate position estimation should then be achievable, or what do you think?
With that many LEDs and photodiodes, you will probably need direct port manipulation to get the readout speed you need, rather than analogRead() (@100 us per conversion) or digitalRead() and digitalWrite().