Hi everyone, I want to use distance sensors in Lego EV3 to read the distance and to be used in the programme.

However, I can't have any value read in Scratch, I wanted to do a program like: when the distance <30, sth will happen.

I have no problem with connecting scratch to EV3. My scratch can connect to EV3, and the sensors are working properly as when I go to port view in EV3, the distance is constantly measured.

The only problem is scratch can't make use of the value, please help.



Can anyone help?


can anyone answer me/>?


I can report the same problem. Tried two different distance sensors that normally work well - but Scratch doesn't read any values from them.


Hi @kenchoi316,
it might be a problem specific to NXT sensors. They are compatible with the EV3 platform itself, but Scratch 3.0 seems to have a problem reading the signals of those slightly older sensors.
After two NXT distance and color/brightness sensors did not work with Scratch (see above post), I bought a EV3 color sensor that now works flawlessly on Scratch 3.0.


what does the distance and brightness mean?
i dont have a mind storm


go here if you need help


I have exactly the same problem. This is the ir distance sensor -
P-brick has the latest firmware 1.09H


Late response, but for me this is a problem with using port view on the brick.

Sensor outputs (distance and brightness) are fine on the port view (on the brick screen) but are intermittent/zero in Scratch - no use for controlling code. Turn off port view on the brick and the values are updated real time in scratch - (select the check next to the distance and brightness blocks to see real-time values).


hello I have another question about how you can use other sensors


Some examples of using the distance sensor. Maybe it will be useful to someone: