4

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?

3
  • This question is a bit confusing - you're using which programming software and putting this on which brick? NXT or EV3?
    – Timtech
    Commented Oct 17, 2013 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
    Commented Oct 17, 2013 at 23:39
  • Page 29 of link says 1300 to 2300 and that brighter is less than darker.
    – dfrevert
    Commented Oct 17, 2013 at 23:50

3 Answers 3

3

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

3
  • Nice video. What are the typical raw sensor readings that you get?
    – dfrevert
    Commented Oct 22, 2013 at 1:48
  • We usually see around 2200 for black and 1300 for white.
    – Lego Works
    Commented Oct 22, 2013 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
    Commented Oct 22, 2013 at 14:07
2

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

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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