Beam Break Sensor

I’ve thought of buying a set of these to detect how many balls we have indexed. How would I be able to implement these to our robot? I think I have an idea of how the code would work but how exactly would I wire them to the RoboRIO?

Plug the reciever’s +, -, and signal wires into one of the RoboRIO’s DIO ports. In order to interact with it from software, use a WPILib DigitalInput object.

Hmm. Thanks! I assumed it would be a digital input but was not sure how exactly to plug it into the port. Would I solder it to a PWM cable?

That’s an acceptable solution. Another option is to crimp the wires and put them directly into a 3x1 header.

We’re using the same sensors. What I did was use a PWM Y-splitter so that both sides could run off the same power and ground and it would only occupy a single DIO port.

For code, FYI, we’re using 3 of them. BB1 detects a cell in the intake, BB2 lets us know we’ve successfully indexed a cell in and BB3 detects when our storage is full. Couldn’t justify using enough to get a BB8 though :wink: We use a state-machine to control the action of our belts. When launching, we intend to do something similar, but using BB3 as the index detector and a different set of states.

Late to the game, as usual…I notice these 5mm beam break sensors are out of stock. Adafruit still has 3mm in stock, but they only work to 10" range, and we have a 20" wide ball path that needs detecting.

I wonder if I could adapt the sensors off a garage door? Hmmm…

Any other ideas?

Check amazon. I got ours off of there.


Thanks, I did see that they were listed on amazon, just not a big fan of 3rd or 4th party storefronts.

1 Like