Connecting a Passive Light Sensor

From ROBOTC API Guide
< Tutorials‎ | Arduino Projects/Mobile Robotics/Lego
Revision as of 18:55, 7 August 2012 by Pgp90 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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).

The new light sensor configuration
The new light sensor configuration
The new light sensor configuration

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.

The parts needed for 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.

The breadboard wiring for a Lego light sensor passive setup
The shield setup for a Lego light sensor passive setup
Virtual Breadboard long view for a Lego light sensor passive setup
Virtual Breadboard for a Lego light sensor passive setup
A Schematic for a Lego light sensor passive setup

Notepad.gif NOTE: Be sure not to forget to wire the Lego motors as well as the light sensor itself. All the applications of the light sensor in this section require the use of both motors.