FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting up Photoelectric Sensors

Hello,

     I am the Head Programmer and Electrician from team 3325 and i can't quite figure out how to wire the RightSight PHOTOSWITCH Photoeletric Sensors. Please any advice would be great.

0 Kudos
Message 1 of 16
(26,253 Views)

Howdy!


The RightSight sensor should have four wires coming off it as follows:

  • Blue: Negative (NEG)
  • Brown: Positive (POS)
  • White: Dark Out (DO)
  • Black: Light Out (LO)


The POS and NEG lines provide power to the sensor.  The DO and LO are digital signals (true or false) which represent whether the sensor is seeing light or dark (tape or no-tape).  Since the sensor will only be reading light OR dark, the signals on DO and LO will always be opposite of each other.  Only one of the DO or LO lines is really needed to represent the state of the sensor.

To connect the sensor to the digital sidecar wire it as follows:

  • Blue -> ( - )
  • Brown -> PWR
  • White or Black -> SIG

Example line follower code is available when you create a new LabVIEW FRC cRIO Robot Project and select the option to create "Robot Framework with Game Code".  The example routine is found in the Autonomous Independent VI.  Note: You will need to have the LabVIEW Update installed to have this example game code.

You may also find this tutorial about the line following sensors useful.

-Barron

Barron
Applications Engineering
National Instruments
Message 2 of 16
(6,176 Views)

Hi there,

The datasheet specifies the voltage for these sensors at 10.8V to 30V.  I believe the side car digital I/O PWR pins provide 5V.  Does the sensor still work if powered from the Digital I/O pins?  I wired one last night but connected the brown wire to 12V from the power distribution board and it seemed to work just fine.  It would be a lot easier to wire the brown wire to the digital I/O, but does it work?

David A.

0 Kudos
Message 3 of 16
(6,176 Views)

Hi David,

I apologize for overlooking the sensor's power requirements in my previous post.  You are correct that the sensor is designed to be powered by 10.3V-30V.  The power lines (POS and NEG) should be connected to the power distribution board to provide 12V as you described.

I have not tried powering the line follower sensor from the 5V supply on the digital side car.  I have my doubts that it will work.

-Barron

Barron
Applications Engineering
National Instruments
0 Kudos
Message 4 of 16
(6,176 Views)

Since the photoelectric sensor's require 10.8 v, the only FRC legal way to power them are the 12v connections on the power distribution board. I would be supprised if 5v would power it.

"Lockheed" Joe
Testing Blog"
0 Kudos
Message 5 of 16
(6,176 Views)

Hi,

Question, these sensors are rigged to sink (internal switch/transistor switches on/off connection to ground). Where does the high reference come from? I read in the 9403 docs that the digital inputs have pulldown resistors on them. Do we have to add an external pullup resistor to these sensors? To go along with that, do we have to run an extra ground to tie the digital and 12V ground together at the connection to the switch? Or do these grounds get tied together somewhere in the sidecar module? We took some measurements and it appears that the two grounds are isolated from each other.

Has anyone just hooked one of thes up to 12 volts and one of the sidecar digital inputs and seen how it behaves?

Thanks,

John

team 3157

0 Kudos
Message 6 of 16
(6,176 Views)

Hmmm... that is interesting. I'm pretty sure that the digital inputs in the side-car are pulled up.  We've wired limit switches counting on the pull-up resistor at the digital input for the last couple of years, and it has worked as expected.  I don't know if the pull-up is in the side-car or in the NI module, but I'm pretty sure there is already a pull-up.

On Thursday we wired one of the light sensors like this:

BROWN - 12V from power distribution board.

BLUE - ground from power distribution board.

WHITE - digital input on side-car, "sig" only.

We did not tie the two grounds together.

It seemed to work as expected.  We could see the digital input from the code in LabVIEW change between 0 and 1 as we made the sensor "see" something.

I chose to use the ground on the power distribution board because I don't know what the ground pins on the sidecar are rated for.  I'm still not sure this is the intended way to connect these sensor, but this method works.

David    

0 Kudos
Message 7 of 16
(6,176 Views)

Thanks for all the help, a tech at NI was kind enough to ask around the developers and call me back on how to set it up and code it.

0 Kudos
Message 8 of 16
(6,176 Views)

Mathew,

What is the recommend way of wiring them according to the folks at NI?

Thanks,

Chad

0 Kudos
Message 9 of 16
(6,176 Views)

darist wrote:

On Thursday we wired one of the light sensors like this:

BROWN - 12V from power distribution board.

BLUE - ground from power distribution board.

WHITE - digital input on side-car, "sig" only.

We did not tie the two grounds together.

It seemed to work as expected.  We could see the digital input from the code in LabVIEW change between 0 and 1 as we made the sensor "see" something.

This is how we wired our sensors also.

0 Kudos
Message 10 of 16
(6,176 Views)