Our team got a RIghtSight photoswitch (P.N. 42EF-D2MPAK-F4) from FIRST Choice but we are having some trouble wiring it to the roboRIO. We wired it up with power and ground to the VRM and signal to a DIO port on the roboRIO, but the RIO always returns true when we query the sensor, regardless of the sensor’s actual status. Does anyone have any idea what we might be doing wrong?
Adam, Team 1329
I don’t have a switch to verify, but I recall that I wired it directly through the PDP. I think the VRM is okay as long as it is 12V. I think then you had the option of wiring either of the two remaining wires to a DIO pin.
I guess other thing I’d check is software and the adjustment screw. I think the LED light on the photoswitch also changes to indicate when it is sensing too.
I wired up a normal limit switch to the same DIO port and used the same code and it worked as expected, so I don’t think it’s a software or RIO issue. We calibrated the photoswitch, and the led on it does light up as it senses the tape. Is there some extra wiring we need to do to make the RIO read it properly?
It’s possible you need a pull-up resistor, even though the RoboRIO already has them built in. Try connecting the +5V and SIG pins on the DIO port with a 10k+ Ω resistor.
It turns out we did need a few resistors to get it working, we used the solution from this post and it works great now.