Ball Balancing Robot Uses New TOF Sensor

By now, you’ve most likely have seen or even played with an ultrasonic distance sensor. They work by emitting a sound, and then listening for the “ping” to return. The sensor can then tell how far an object is away by calculating the time in between. With sound waves traveling at 343.2 meters per second (768 mph), it’s no small task to measure the short time it takes for the sound to be emitted, then hit something a few feet away, and return. Now, imagine trying to do that with light.

Light in comparison moves at a whopping 299,792,458 meters per second (or about 671 million miles per hour). You’re going to have to have a pretty fast finger on a stopwatch to measure the time it takes for light to bounce back from an object a few inches away.

[Paul Bristow] is doing just that with the use of a new Time of Flight (ToF) sensor called the TeraRanger One. Developed in cooperation with CERN, this sensor uses a very narrow beam of light (listed as +/- 2 degrees) to accurately measure the position of an object to a resolution of 5mm, with distances up to 14 meters away. It boasts an impressive update rate of >1000 samples a second, and is very micro-controller friendly with UART, I2C, SPI, and PWM output.

[Paul] and his fellow hackers at the Post Tenebras Lab Hackerspace in Geneva got their hands on this sensor, and in a short time had a ball balancing robot up and running. The crude program is not running a PID controller, so the results seen in the video after the break aren’t that impressive. Also, the sensor isn’t exactly cheap at about $180 USD. Despite that, it will be interesting to see what applications these sensors will be used for. If you have any ideas, leave them in the comments below.

24 thoughts on “Ball Balancing Robot Uses New TOF Sensor

      1. No, conventional optical distance sensors don’t use the speed of light. Some just use the amount of reflected light to “estimate” distance. Others use a a CCD line array and trigonometry to measure distance.

  1. If there is an output from the TOF sensor then I would think you could attach the sensor to a blind person’s walking stick with output feedback via headphones to the blind person to provide feedback on obstacles in the walking path.
    With training the person would be able to visualise the area in front and detect danger for moving obstacles and stationary obstacles as well.

    1. They’ve done similar things with ultrasonic sensors and haptic feedback. Though it would be of benefit to be able to discern distanced accurately up to 14 metres away, unless that much “detail” was distracting.

      1. I’ve worked with Daniel Kish, who does this. Very impressive guy – walking with him through a parking lot while he echolocated around obstacles like posts was really something to see.

    1. The only advantage of the TeraRanger seems to be it’s higher update rate but I don’t think that’s important for most of the intended use cases. It would be interesting to see a 1:1 comparsion of both especially under difficult conditions (direct sunlight, low-reflective surfaces etc.)

    2. On the Sparkfun-Websites, where they offer their own type of TOF-Sensor Module (, a staff-member mentioned this LIDAR pulselight3D Compontent with the following words:

      >We have the LIDAR Lite, but it may not be great outdoors. Outdoor laser rangefinders suitable for automobiles are still in the thousand’s of dollar price range. If you just need obstable detection there is a radar unit from delphi here. I think it was $800 last time I got one (life before SparkFun). Pretty cool but maybe not what you want.
      (link to delphi on the linked page in the comments)

      1. Thanks! I didn’t realize SparkFun had them! However, the comment says they may not work great outdoors but the accompanying video and demo states that they DO work well outdoors. Hm.

      2. The VL6180 has a 25 degree light cone where the TeraRangerOne claims 2 degrees. The VL6180 also has a 10cm range with what looks to be sub mm resolution. The TeraRangerOne claims 14m with 5mm resolution. I want to try both.

  2. I have some pulsed laser diodes I was planning to use for a TOF project, but it got bogged with the measurement aspect. If there is any practical applications information data online, it is buried under mountains of useless abstractified physics speak and wiki articles. Has anyone been able to figure this out?

  3. After this article I searched around the web and found that there is apparently a TOF sensor in the LG G3 for autofocus. So I looked at a teardown and it seems to be located in the back assembly. This assembly can be bought as a replacement for only around $33: (This is the first one I found. There are probably cheaper sources)

    Might get the time to reverse engineer the sensor later this year. However, if anyone wants to beat me on hacking that sensor, be my guest ;)

  4. I’d love to do something with this in stunt robotics. Yeah, ultrasonic sensors could work, and I guess with the response time of motors the speed of the sensor may be moot, but it’s a neat technology, albeit pricey.

Leave a Reply

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