Floorball dribble trainer

I got an idea from a friend of mine to build a plate for training floorball dribbling skills. It would have say 6 spots with lights and sensors. The lights would show where to move the ball. The sensor would recognise when the ball is on the spot. The plate would be some 20 mm plywood. On top of it a sheet of clear 6 mm polycarbonate (plexi).
Four bright leds would form one spot. In the middle of them a phototransistor.


Indoors, when the ball is on the top of the spot, the light from the leds reflects against the ball and the transistor reacts to that.
In bright sunlight, it might work the other way around. The transistor senses the sun light until the ball shades the light.
I'm about to do a prototype with only one spot, but I wanted to check with all you bright minded people, if you have any suggestions for improvement. Would IR work better both indoors and outdoors?

It may be a good idea to use an IR light modulation technique to make the system more interference resistant - this applies to all IR remotes.

Actually the very opposite!

If the area is well lit, you need only the phototransistors, no LEDs and no IR!

Well, yes. I guess in any light condition the phototransistors are everything needed. No idea to train in the dark. So if the phototransistor only detects a drop in the ambient light, that could be enough. But then again, if the phototransistor is connected to an analog pin, I could read say 1023 in bright sunlight and 600 when the ball is covering the hole of the transistor. And indoors with not so good light, I might get 550 without shade and 120 with the ball shading the transistor. This would not be a problem, if I continuously read the analog pins. I might want 8 spots. But during the main loop, I don't need to scan all 8 transistors, only the next chosen pin, where the player needs to move the ball.
So in the setup, I could just scan all 8 transistors to get their initial values from the ambient light.
But I still want the lights to show the spot where to move the ball. This kind of turns the issue upside down. Will that light disturb when the transistor should detect the ball shading the ambient light?

No, because the LED will be turned off while you read the phototransistors.

And you will be continuously recalibrating all the sensors, not just in setup(). The player's movement will cause shadows; you wish to look for a fast change which equally quickly reverts, to detect the ball impact.

I think I just move the led lights apart from the transistor. The four leds could form a 50*50 mm square and the transistor is in the middle. That way the ball wouldn't reflect much of the led light to the transistor. To keep it simple.
Whether the system recognises the ball or just the player's stick makes no difference. I won't put effort in checking for cheating, although that could be fun, too. The sole purpose for the device is to help in training. The player only competes with themselves.

No, it is far simpler than that. You just turn the LEDs off when you want to read from the phototransistor. Their proximity is of no concern whatsoever.

Any other concern implies that you do not comprehend the time intervals involved here. The process of reading the phototransistor takes of the order of a millisecond (it may be appropriate to call analogRead twice for each phototransistor to stabilise the ADC) and switching the LEDs off for such a period will simply not be perceived.

You're probably right. I have no idea yet how my program will look like, but it will most sure have a loop with non halting details. A part of the loop is about turning leds off, reading the phototransistor and setting a status flag accordingly, turning the leds on, then continuing the loop with other stuff like timer display update, checking if user wants to interrupt the program, finally dealing with the status flag.

Sounds like you have the right concepts. :+1: