The proper description which sounds very impressive is “Time of Flight (ToF) Laser ranging Sensor” – really? Well, let’s see what it can do. AliExpress sell these for around £5.30 ($7.23) with free postage.
Attached to +5v, ground, SDA and SCL on an Arduino UNO (which means I don’t have to worry about pullup pins for I2c and it just happened to be sitting on my desk at the time) you could start by grabbing the Adafruit library and adding that to an Arduino setup. Read on…
Simply plug the device in – well, no, firstly solder the lead on – making sure the lead pins are on the side of the regulator – NOT the chip itself – so in the photo above, the leads want to come out of the BACK.
Plug it in – load up the software and monitor on your serial connection. Really it is that simple.
Most of the time the board sends back (several times a second) “out of range” – until you put your hand or other item in front of the sensor.
I works – and works reliably. Every tried using ultrasonics in a room to control lights – only to find the lights turn off every time you sit still and concentrate for a while. Well, no movement needed with this chip.
I got my ruler out and used a little white plastic box I had handy as the obstruction.
Up to 50mm away the unit is rubbish (when I say that it knew the item was a few mm away but no-where near accurate) – but as you get further away, the accuracy is reasonable. At 200mm it was registering 203mm, at 800mm it was starting to lose the plot even with something large than my hand… with something bigger like a wall it seemed to be ok up to 900mm.
So if you want something to detect that you are sitting at your desk – or maybe catch the cats coming through the catflap – this does indeed seem to be a nice little board. Within range I saw no apparent errors of any significance.
The Adafruit example had 100ms gap between readings and so I took that down to 10mm. Still no errors.
Taking a brief look at the Adafruit library it looks like you can change the address of the unit internally and perform calibration. For my purposes the standard example works just fine.