Monday, November 11, 2013

Lightsensors

Overview

Today I'm going to experiment with the old and new light-sensors on my EV3 brick. I'll do, roughly, the same exercise as I've previously done in this post on another blog, to see if I can recreate that result in the leJOS-EV3 framework.

Initial test

First off I'll simply try to read the light-intensity values from an array of differently colored LEGO-blocks. I've decided to slide the blocks along below the sensor, so I can leave it fixed and untouched between color-switches.

Without Floodlight


NXT-Light
NXT-Color
EV3-Color
Old NXT-Light Readings
White
0,4422
,8436
0,17
31
Yellow
0,4237
,8436
0,15
29
Red
0,3973
...
0,11
30
Turquoise
0,3426
Sensor borken?
0,065
22
Green
0,3143


0,04
23
Purple
0,3758


0,09
29
Blue
0,3495


0,07
25
Light-grey
0,3534


0,075
25
Dark-grey
0,3074


0,035
23
Black
0,2547


0,02
18
Diff from White to Black
1:1,74
??
1:8,5
1:1,72

Different values, but the same deviation from white to black for the two NXT-Light readings. The interesting part is, that the deviation for ambient-light of the EV3-Color sensor, is actually quite a bit better. I'm a bit put off but the lack of accuracy on the sensor-reportings, though.

Now with the floodlight (red LED-light) enabled:
Floodlight (red)


NXT-Light
EV3-Color
Old NXT-Light readings
White
0,6376
0,665
60
Yellow
0,6259
0,59
60
Red
0,6122
0,41
54
Turquoise
0,4462
0,075
33
Green
0,4911
0,05
37
Purple
0,5574
0,21
47
Blue
0,5057
0,05
33
Light-grey
0,5595
0,22
48
Dark-grey
0,5116
0,11
42
Black
0,4813
0,04
35
Diff from White to Black
1:1,32
1:16,625
1:1,71

Here, the EV3-Color sensor actually performs much better at detecting the difference of White and Black. Most of the tested colors are between 0.11 and 0.4, though. This leaves most of the colors in with a fairly small deviation of 1:2,75 (which is still a lot better then the old sensor).
Suspected difference: Old lightsensor is approximately 4 mm closer to the surface I'm reading, at a distance of 5 mm, whereas the new sensor is at 9 mm distance.


EV3 Color Sensor
NXT Light Sensor









Now for a test where I'll ensure that the distance from the sensor-head is equal (5mm)...
EV3-Color

Without Floodlight
Floodlight (red)
White
0,11
1,05
Yellow
0,07
0,97
Red
0,05
0,66
Turquoise
0,04
0,13
Green
0,02
0,095
Purple
0,05
0,34
Blue
0,04
0,14
Light-grey
0,04
0,41
Dark-grey
0,02
0,21
Black
0,01
0,19
Diff from White to Black
1:11
1:5,53


Hmm, even worse... Now the scale is broken for the White value, which can only be defined as BAD. I checked up on the implementation-notes in-code: Values should be in the range [0.0;1.0], so I suspect these readings may be misleading :\

No comments:

Post a Comment