Lego motion sensor 9583 and Scratch

Last week, with rulers in hands we looked up the motion sensor 9583. Tests consisted of a bulldozer approach to the sensor and verifying how the value of the distance depends on the actual distance measured with a ruler.

While the bulldozer was approaching the sensor, the variable value decreased from 100 to 1 unit. The maximum distance detected by the sensor is 30cm (value of the variable - 100). The minimum distance is 10cm (value of the variable - 1). The distance variable is not linear - approaching the object to the sensor first variable is decreasing very slowly. The closer this variable sensor begins to decrease more rapidly.

Mikołaj has found the sound service in scratch. Very quickly he came up with an idea to build an alarm controlling through the sensor to the entrance of his room.