Take the 2-minute tour ×
LEGO® Answers is a question and answer site for LEGO® and building block enthusiasts. It's 100% free, no registration required.

EV3 software does not support the Light Sensor. It does support the Color Sensor.

The solution is to use the Raw Sensor Block.

What is "normal" for raw sensor block readings?

I'm getting readings between 450 and 700, with brighter readings at the lower end of the range. I expected brighter to be the larger number. Is there an expected range of values?

Is it because the software is running on an NXT brick?

share|improve this question
    
This question is a bit confusing - you're using which programming software and putting this on which brick? NXT or EV3? –  Timtech Oct 17 '13 at 15:13
    
EV3 software on my laptop. NXT hardware (brick). The only way to use the NXT Light sensor is with a Raw Sensor block. –  dfrevert Oct 17 '13 at 23:39
    
Page 29 of link says 1300 to 2300 and that brighter is less than darker. –  dfrevert Oct 17 '13 at 23:50

3 Answers 3

up vote 2 down vote accepted

My FLL team wrote a light sensor myblock that converts the raw value to a number between 0 and 100. They run it on the EV3 so they can use their existing NXT light sensors. It should work on the NXT brick as well. Here is the video they posted to explain how it works.

http://youtu.be/I7Bqvk-uMLk

share|improve this answer
    
Nice video. What are the typical raw sensor readings that you get? –  dfrevert Oct 22 '13 at 1:48
    
We usually see around 2200 for black and 1300 for white. –  Lego Works Oct 22 '13 at 12:14
1  
I just tested our light sensors on the NXT and get raw value readings of around 590 for black and 350 for white. Our light sensor myblocks work the same on the NXT as they do on the EV3 and convert the values to numbers between 0 and 100. We found that adding a Round block set to nearest at the end of the light sensor myblock equation helps when using this on the NXT. It didn't like the decimal numbers for some reason. Hope this helps. –  Lego Works Oct 22 '13 at 14:07

You can consider this the "official" answer based on the EV3 firmware source code.

This file is used for scaling the values that you see in "Port View" on the EV3 brick itself.

The NXT Light Sensor is defined in these two lines:

2 0 NXT-REFLECT 1 1 3 0 2 119 0x32 3372.0 445.0 0 100 0.0 100.0 20 0 pct
2 1 NXT-AMBIENT 1 1 3 0 2 119 0x30 3411.0 633.0 0 100 0.0 100.0 20 0 pct

This means that in NXT-REFLECT mode (LED is on), a raw value of 445 = 0% and a raw value of 3372 = 100%. In NXT-AMBIENT mode (LED is off), a raw value of 633 = 0% and a raw value of 3411 = 100%.

To change to NXT-AMBIENT mode, you might be able to use the NXT Sound Sensor block. Select the port that is connected to the light sensor and set the mode to "dBa".

share|improve this answer

Is it because the software is running on an NXT brick?

YES, The raw value range of light and sound sensor is 0~1024 on NXT.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.