Line Sensors

Our team is trying to wire up the line sensors and get them to work. My main question is how do you wire the line sensors? I have already tried looking at the other threads but I am awful with technical speak. I was wondering if anybody has found a diagram or made a diagram that very clearly shows how to wire these. Thank You for any and all help.:confused:

You should find 4 wires coming out of the line/light sensor cable. If you read the data sheet inside, you’ll see what each wire is for. In short, you give it supply voltage and ground on the appropriate wires (black for ground, brown? for supply), and the other two wires give you a complimentary output on NPN transistors that works with the digital I/O pins on the digital sidecar. (Don’t quote me on the wire colors, check that datasheet.)

That means you should see 01 or 10 for the light and dark conditions (which is which depends on how you plug them into the sidecar, and how you write your program). If you ever see 00 or 11 you’ve got a fault of some sort. You should be able to do the entire hook up with 2 of the many 3 wire cables that came in the kit, a soldering iron, and some heat shrink tubing.

The sensors we received in our KOP actually have the wiring diagram printed on the back of each sensor. On ours, Blue and Brown go to the 12V PDB. Black and white are signal. Found out that if you hook up the power wires backwards, it doesn’t hurt the sensor, it just does not work. :ahh:

Connect the white and black wires to a DIO port on the sidecar. Each sensor acts like a simple switch. As a switch, the signal wires must connect to the outside two pins of a DIO port. (One sensor per DIO port). And since it is just a switch (on / off ) it doesn’t matter which color (black or white) goes to which of the two pins on the DIO port.

That’s it – no resistors, transistors or anything else are needed. We bench tested this yesterday with an additional six feet of copper wire and it worked fine. We next need to test it under different lighting conditions to see what, if anything, might be needed or helpful to increase range and reliability.

One last thought. I’ve seen some talk about connecting cables to reduce overall wiring. If you take that path, be sure to leave yourself some way to quickly replace a sensor in case of accidental damage. Just remember, old Murphy is always sitting in the first row at every regional event. Yep, Murphy is a big fan of FRC. :yikes:

Have fun!


We found that since the two signal wires (white and black) are just logically oposite that only wiring one was required. Just be sure you keep it consistent between the sensors you used otherwise your code will be more difficult to follow.

In our initial tests yesterday we tracked white masking tape on a grey floor and later duct tape on a white floor so between those we had to adjust our code to flip the value we got since the contrast was backwards.

Ok thanks for these they are all really helpful and good luck to your teams!

We also found that the voltage swing in ours was not enough to swing the DIO port, as the white wire went from 0.4v to 0.7v. To fix this, we just boosted it with a power line to the white wire terminal through a 150k resistor. So, assuming the blue and brown wires are already connected to 12v, we ran the negative pin on the DIO to the negative (blue) wire, the PWR pin on the DIO through a 150k resistor and to the white wire, and the white wire returned to the Signal pin. It gave us far more consistent results. It could detect the retroreflective tape eight feet away.

Why would you want it to do that? At 8 feet the cone of the beam would be far too wide to be useful wouldn’t it? The lines on the floor are the normal white gaffers tape if I remember correctly. 2 inches seems to be more of a reasonable distance don’t you think?

Well, yeah, we aren’t going to use it at eight feet, we’ll be using it for the gaffer’s tape. However, we all thought it was pretty cool that it could do that.

That suggests your Digital Sidecar is not functioning properly. What is the voltage on its signal pin when nothing is connected to it? It should be 5 volts. The resistor you’ve added just duplicates what the DS is supposed to have present already.

It could detect the retroreflective tape eight feet away.

While that’s impressive, it might confuse others reading this thread. Keep in mind that the gaffer’s tape on the floor is not retroreflective.

I guess the real question I have is why did you need the 150k resistor? We hooked ours up to a cardboard box on last years robot. We were able to see the signal without changing a thing. I would check your Sidecard to make sure it’s working properly.

Just for the record the manual states the line on the floor is GRAY gaffer’s tape. I’m suprised they didn’t use white but there you have it.

I am thinking that the DSC is not receiving power from the PD. When the DSC is connected to the Crio module, but +12v is not applied from the PD, some of the power LEDs do come on through leakage in the module. They do not, however, provide a pullup voltage for digital inputs. The first indication of a problem here is the failure of the robot signal light.

Hm, interesting. This may be it, because when I powered it off a bench supply, the swing was 0 to 10v, and went to the .4-.7 swing once we had wired it to the 'bot. I’ll have to go poke around with a tester tomorrow. Thanks!

True, this will work to detect light and dark. But, remember there are three states: light, dark, and fault. For example, how would you tell between “logical high” and “the sensor isn’t working”…they both would give you +V on the DIO pin.

I’d say Al’s on the money here. The DSC is deceptive, as it will light up when you plug it into the cRIO, but it’s not fully functional. Make sure you’re attached to the power distribution board via the DSC’s wago connector, and check the +6V light on the DSC. If it isn’t lit, you don’t have pullup.

Also, I’d suspect that 0.4-0.7V observation was an artifact of the internals of the ADC and the NPN transistor that’s driving the light sensor signal line.

Not something I had considered but a good point. I’ll bring this up with the electrical/programming team and see what they want to do.

Just for reference here is the difference, visually, between a powered vs. an unpowered DSC.

Does anyone know where to get more of these light sensors? The “Get more here” sends you to the general Rockwell Automation website…

any ideas?