New Part Day: Time Of Flight Sensors

Every robotics project out there, it seems, needs a way to detect if it’s smashing into a wall repeatedly, acting like the brainless automaton it actually is. The Roomba has wall sensors, just about every robot kit has some way of detecting obstacles its running into, and for ‘wall-following robots’, detecting objects is all they do.

While the earliest of these robots used a piece of wire and a metal contact to act like a switch for these object detectors, ultrasonic sensors – the kind you can buy on eBay for a few bucks – have replaced this clever wire spring switch. Now there’s a new sensor for the same job – the VL6180 – and it measures the speed of light.

The sensors that are used for object and collision detection now use either ultrasonic or infrared light. They’re susceptible to noise, and if you’re doing anything automated, you really don’t want rogue measurements. A time of flight sensor clocks out photons and records how long it takes them to return at 299,792,458 meters per second. It’s less sensitive to noise, and if you can believe this SparkFun demo of this sensor, extremely accurate

This is not the first Time of Flight distance sensor on the market; earlier this week we saw a project use a sensor called the TeraRanger One. This sensor costs €150.00. The VL6180 sensor costs about $6 in quantity one from the usual suspects, and breakout boards with the proper level converters and regulators can be found for about $25. More expensive sensors have a greater range, naturally; the VL6180 is limited to somewhere between 10cm (on paper) and 25cm (in practice). But this is cheap, and it measures the time of flight of pulses of light. That’s just cool.

30 thoughts on “New Part Day: Time Of Flight Sensors

    1. Given the amount of errors stated in the datasheet, using it to measure the speed of light wouldn’t be useful.

      range is only around 100mm!

      Noise(Maximum standard deviation of 100 measurements) – – 2.0 mm
      Range offset error(2) – – 13 mm
      Temperature dependent drift (3) –15 mm
      Voltage dependent drift (4) — 5 mm

      Not a very good excuse for HaD’s lack of qualty.

      1. Sparkfun themself had some slight issues with the correct range. They first sold them as 50cm range detectors and then later changed that to 10cm and then 25cm with a working setup. So yeah, I stay with my maxbotix ultrasonic sensors for now…

          1. There is a register called FIRMWARE_RESULT_SCALER, read/write, with values from 1-16X. But range appears to be limited to less than the absolute maximum of 100mm in practice, by the strength of the reflected laser signal vs. ambient light. The laser appears to lack focusing optics, with a 25° emission angle. And the datasheet mentions:

            “The laser output will remain within Class 1 limits as long as the STMicroelectronics recommended device settings are used and the operating conditions specified in this datasheet are respected. The laser output power must not be increased by any means and no optics should be used with the intention of focusing the laser beam.”

            Hmm… So if remaining Class 1 for the consumer masses isn’t an issue, can focusing optics be used to push closer to 100mm in practice? Are there some undocumented settings or conditions by which the laser power can be increased?

      2. The temperature spec requires a temp sensor and math. Voltage drift… good power supply? Does range offset mean it needs initial calibration? I can’t grok the noise spec… would averaging work? Might be able to make a good sensor board out of it with a few parts.

    1. A lot of people do close-up shots, which phone sensors are very good at once it can get a focus, but I get you. There’s only so much space in a phone, and I don’t think this should have made the parts list.

    2. That’s exactly how that post came to be. When I read that they put a TOF sensor in the phone, I assumed it had to have a greater range to be useful for actual AF use. Why else would they have added that part to the phone?
      Then I found out more about the sensor and was pretty disappointed by the (for such an application) severly limited range.

  1. Sort of related to this article, Keyence makes some time of flight sensors however their design difference is a very fast sample rate, I can’t remember the exact figure, but I want to say it was in the GHz range where as other sensors which are less accurate has a very slow (Hz) sampling rate.

    1. Seems like the 2mm noise error (measured at 100mm) would be discouraging for this application, but I wonder how the noise error changes when measured at a smaller distance, lets say 10mm. If it scales linearly, then it would be .2mm noise error at 10mm, which is still too much for tramming the bed. Someone correct me if I’m wrong.

  2. Anyone notice that this is a SPAD sensor? (single-photon avalanche diode). It detects single freakin’ photons! If only there was a low-level way of accessing data…… anyone care to reverse-engineer this gem? :)

  3. They’re not that accurate ~10cm real world. They don’t measure the time taken either they use the phase difference in the received signal. It’s actually the silicon that limits this which is pretty interesting, need clock speeds that allow for timers in the poco second range to get better accuracy and this is beyond the capability of silicon. Great bits of kit though if you can get away with 10cm

    1. I have not read the related patents, but I think they probably run two asynchornous timers and pulse out light on A and trigger on B and when the edge phases measure the same (or some other gating principle), they take the count from one and convert it to range. Very similar to how the DIY UWB radar works, just more focused.

    2. Actually if we assume that there’s about 7 bits of range. back of the envelope calculation would tell that you need a timer with tens of femtoseconds of clock period, (i.e frequency in Terahertz’s). Come on HaD, you are better than this.

    3. Using phase measurement alone would only allow distance measurement up to the wavelength of the emitted light – in this case, 850nm. Not to say phase measurement isn’t used, but it would have to be combined with time measurement as well.

      1. It’s a phase measurement of a signal imposed on the laser carrier wave. The really tricky part is separating out the return signal photons from all the other photons blasting around. I looked this sort of thing up for a laser distance meter from Bosch. Those reach to 100 feet, with a minimum of 18 inches or so. Bosch makes some that go farther, but this one was inexpensive and a nice gift.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.