Log in

View Full Version : Photoelectric sensor wiring


implosionprez
15-02-2011, 00:43
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?

gcschmit
15-02-2011, 01:06
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 Begin.vi.

implosionprez
15-02-2011, 01:22
We aren't using Labview. We're using C++. How should we be testing to see if they are sending signal back?

Stimpy1901
15-02-2011, 02:05
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)

mikets
15-02-2011, 06:41
For wiring the light sensors, please refer to this thread.
http://www.chiefdelphi.com/forums/showthread.php?t=88548

krudeboy51
15-02-2011, 06:57
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

RyanN
15-02-2011, 08:09
Your wiring appears to be correct.

ATH1RSTYM00SE
15-02-2011, 20:37
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

krudeboy51
22-02-2011, 23:00
IS IT MANDATORY TO USE THE LINE SENSORS?

RyanN
23-02-2011, 07:55
IS IT MANDATORY TO USE THE LINE SENSORS?

No? What gave you that idea?