EV3 to roborio

I would like to know how to connect an EV3 (light sensor) connector to analog input on roborio. What does the physical connection look like?

You’re asking about the NXT light sensor, not the EV3 color sensor, correct? They may look similar but connect quite differently.

The Lego downloads site has documentation (schematics) under the “Hardware Developer Kit”. This document shows how the brick side is connected.

Assuming you’re talking about the NXT light sensor, it looks like the pinout of the light sensor is:
Pin 1 - Analog Current Output
Pin 2 - Ground
Pin 3 - Ground
Pin 4 - Vcc (+5V)
Pin 5 - LED control (+5V on, 0V off)
Pin 6 - Not Used

Since it’s an analog current output rather than an analog voltage output, you’ll need a resistor (e.g. 10Kohm) from Pin 1 to 5V to generate a voltage that the roboRIO can read.

Oh, sorry about the misunderstanding, I was talking about the color sensor.

The color sensor isn’t analog, it’s UART. Pinout is:
Pin 1 - Ground
Pin 2 - Not Used
Pin 3 - Ground
Pin 4 - Vcc (+5V)
Pin 5 - UART sensor RX (controller TX)
Pin 6 - UART sensor TX (controller RX)

The UART is 5V signaling, not RS-232, so it can’t be hooked up to the RS-232 port on the RoboRIO without a converter. The RoboRIO does have 5V-tolerant raw UART lines on the MXP connector so that’s an option.

Here’s some documentation on the protocol: https://sourceforge.net/p/lejos/wiki/UART%20Sensor%20Protocol/

I also found this library which should be able to be relatively easily ported: https://github.com/lawrie/EV3_Dexter_Industries_Sensors/blob/master/EV3_arduino/EV3UARTSensor/EV3UARTSensor.cpp