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.

  • 1
    \$\begingroup\$ If the balls are magnetic, a reed switch is a better bet. It also comes down to how fast the ball moves through the gate/pass so that the reed switch can actually register it followed by the Raspberry Pi. \$\endgroup\$ – user183368 Mar 26 '18 at 5:52
  • 1
    \$\begingroup\$ bi-polar hall sensor ics. cheap and easy \$\endgroup\$ – Henry Crun Mar 26 '18 at 7:02
  • 4
    \$\begingroup\$ IR photogates are very common in student physics labs, typically for timing but you could use them for simple event detection, too. I recall they worked well for a marble rolling down the central groove of a plastic ruler. A simple MCU or Arduino-class system is going to be a much better match for this than a raspberry pi. \$\endgroup\$ – Chris Stratton Mar 26 '18 at 7:05
  • 1
    \$\begingroup\$ This looks like a cross-post of raspberrypi.stackexchange.com/questions/81831/… \$\endgroup\$ – Dmitry Grigoryev Mar 26 '18 at 13:24
  • \$\begingroup\$ It is indeed a cross post, I didn't know which site would be the best place to ask about this \$\endgroup\$ – Ampp3 Mar 29 '18 at 2:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.