Forward Until Dark NXT Light Sensors NXT Light


















- Slides: 18

Forward Until Dark

NXT Light Sensors

NXT Light Sensors • How does the Light Sensor detect brightness? • The Light Sensor shines a red light on the surface below it and reports how much of that light is reflected back. A bright surface will reflect a lot of light and give a high reading. A dark surface will reflect less light and give a low reading.

Forward Until Dark Program

Establishing The Threshold • On the NXT – Select the View Mode – Select Reflected Light – Select Port 3 • Position the robot over the surface to be read by the light sensor as shown in the next two slides

Establishing The Light Threshold

Establishing The Dark Threshold

Calculating The Threshold

Motor Block One Details

Light Sensor Block Two Details

Motor Block Three Details

Test Your Robot

Forward Until Light

Forward Until Light Sensor Block Two Details Wait for the Light Sensor on Port 3 to get a Light reading Light = Light Sensor value>Threshold value

Test Your Robot

Calculating Thresholds Quiz Would the robot classify the following Light Sensor readings as Light or Dark? a. Sensor = 15 with Threshold = 40 b. Sensor = 55 with Threshold = 40 c. Sensor = 49 with Threshold = 56 d. Sensor = 15 with Dark = 10 and Light = 30 e. Sensor = 55 with Dark = 43 and Light = 62

Calculating Thresholds Quiz Answers a. Sensor = 15 with Threshold = 40 Sensor value is less than Threshold therefore it is dark b. Sensor = 55 with Threshold = 40 Sensor value is greater than Threshold therefore it is light c. Sensor = 49 with Threshold = 56 Sensor value is less than Threshold therefore it is dark

Calculating Thresholds Quiz Answers d. Sensor = 15 with Dark = 10 and Light = 30 The threshold is (10+30)/2=20 The Sensor Value is less than Threshold, therefore it is Dark. Intuitively - the Sensor value is closer to Dark than Light, therefore it is dark e. Sensor = 55 with Dark = 43 and Light = 62 The threshold is (43+62)/2=52 The Sensor Value is greater than Threshold, therefore it is Light. Intuitively - the Sensor value is closer to light than dark. Therefore it is light.