Photoelectric sensor wiring

Our photoelectric sensors don’t work. The lights light up, and change when something is moved underneath the sensors, but they don’t send signal, to track the line. Right now we have them wired so that brown and blue are power from the PDB, and white is plugged in to the DSC, and black is plugged in to nothing. Where should white be plugged in on the Digital I/O of the DSC, pin 1, 2, or 3? Is this wired correctly?

The white wire needs to be connected to the signal pin (farthest from the edge of the DSC) on a digitial channel on the DSC. I’m not sure how you are testing if a signal is being sent or not. If you are using the sample line following code in LabVIEW, I think you may also need to open the DIO channel and store its refnum in

We aren’t using Labview. We’re using C++. How should we be testing to see if they are sending signal back?

Not quite sure about Windriver this year because we are using Java, but it should be similar.

Does Windriver have a LineTrackerProject sample like Java does? If so, it may be good to review that code.

Below is the code using Java, which should be very similar to C++:

 DigitalInput left; // initializes digital input for line tracking sensors (be sure to include DigitalInput library)

 left = new DigitalInput(1);  //assigns the signal based on the port you use

//in auto or teleop:

 System.out.println(left.get());//in windriver, you would probably use cout or printf, but the left.get() should give you true or false.
//this should print to the console and be sure this is in some loop or you will only get it once (or use iterative template)

For wiring the light sensors, please refer to this thread.

To test whether your sensors are working, you can add a printf statement to your code regarding your sensors and download it to the robot. Then on windriver, open up target console (I think) and enable the robot, wave the sensors over something that makes the sensor lights go orange and yellow, or green. If the target console reads a value of 1 or zero- green then its wired correctly

Your wiring appears to be correct.

Sorry, im new to chief delphi and can’t exactly find what forum im looking for but do any teams from new jersey, preferably northern have an extra pair of light sensors that we can have? We need to conduct tests and on multiple bots and we are being told that if we order we won’t get them until 2-3 weeks from now


No? What gave you that idea?