I'm really building a sort of Rube Goldberg machine that students will assemble in order to guide a falling ball down through a series of gates/openings, where I need to detect when they're successful in making it through one of the gates. My plan is to hook each gate up a Raspberry Pi in some way, though I'm not 100% sure what components I should/could use.
Are there any electrical components/breakout boards/ideas I could use to detect large marbles falling through a gate/pass? I've been debating on using a phototransistor and some LEDs to detect when the LED light is interrupted, thus signalling the passing of the ball, but I didn't know if there was a better and simpler solution. Maybe some sort of gate that won't mess with the marble's trajectory? A light or motion sensor? Something that can quickly detect the marble's presence? Some sort of trip wire?
For reference, here are the magnetic marbles that I'm using. I'm using a Pi Zero too.