Connecting a Passive Light Sensor
Changing the Light Sensor's position
In the default setup of the Lego robot, the light sensor is positioned to fulfill its active role: reading light values from the ground. In this section, we want it to read the light that is traveling through the air. So, we're going to move it from its usual position to attach it to the side of the robot. In addition, we're going to attach a second light sensor to the other side of the robot (this is important for reasons of navigation).
Connecting the Light Sensor
To connect each light sensor you will need three jumper wires, an NXT to breadboard connector, an NXT connector wire, and of course, a LEGO light sensor.
Like the touch sensor and most other sensors, the light sensor has to be connected to the ground and the power supply, through the VBUS and GRND pins on the NXT breadboard converter. Unlike the touch sensor, however, the light sensor needs to be connected to the analog, not digital, port on the DFRobot motor shield. For the sake of convenience, we'll put a wire from AN IN to analog 0 for the left sensor and analog 1 for the right sensor.