What is a Time of Flight Sensor and How does a ToF Sensor work?
Have you heard of time of flight also known as ToF being used in your phones, cameras, etc but do not know what are they used for and how it works?
Through this guide, you will learn all about ToF sensors and cameras from
- What is a Time of Flight Sensor?
- How does a Time of Flight Sensor work?
- Benefits of using Time of Flight Sensor
- Limitations of ToF
- Time of Flight Sensors Example
What is a Time of Flight (ToF) Sensor?
So, what exactly is a time of flight camera? Is it a camera that captures a plane flight? Is it related to anything with planes or aircraft? Well, it is actually pretty far off!
ToF is the measurement of the time taken by an object, particle, or wave to travel a distance. Do you know a bat’s sonar system works? The time of flight system is similar to that!
There are various types of Time of Flight sensors out there but mostly being Time of Flight cameras and laser scanners that uses a technology called Lidar (Light detection and ranging) to measure the depth of various points in an image by illuminating with infrared light. A little info about Lidar if you do not know, is a remote sensing method that uses light in the form of a pulsed laser to measure ranges.
To learn more about Lidar, you can check out our guide on What is a LiDAR Sensor? – Technology, Uses, Projects to find out more.
Data generated and captured with ToF sensors are very useful as they can provide pedestrian detection, authenticate users based on facial features, environment mapping using SLAM (simultaneous localization and mapping) algorithms, and many more.
What is SLAM? To learn more about SLAMTEC, you can check out our guide on SLAMTEC, RPLIDAR, Mapper and SLAMware to find out more.
The system is actually widely used in robots, self-driving vehicles, and now even your mobile devices. To give you a few examples, if you are using the Huawei P30 Pro, Oppo RX17 Pro, and LG G8 ThinQ, your phone has a ToF camera!
How does a Time of Flight Sensor work?
Now that we got a brief idea of what a Time of Flight Sensor is, how does it work exactly?
ToF sensors use a tiny laser to fire out infrared light where the light produced will bounce off any object and return to the sensor. Based on the time difference between the emission of the light and its return to the sensor after being reflected by an object, the sensor is able to measure the distance between the object and the sensor. Today we will be going through 2 ways that ToF uses travel-time to determine distance and depth which are:
- Using Timed Pulses
- Using Phase Shift of an Amplitude Modulated Wave
Using Timed Pulses
For example, it works by firstly illuminating the target with laser light and measuring the reflected light with a scanner where the distance of the object is deduced using the speed of light to calculate the distance traveled accurately. In addition, the differences in laser return times and wavelengths are then used to make precise digital 3D representations and surface characteristics of the target and visually map out its individual features.
As you can see above, that is the process where the laser light is first emitted and bounced off an object back to the sensor. With the laser return time, ToF cameras are able to measure the exact distance in a short time given the speed at which light travels. (ToF is translated into the distance) Here is the formula which analysts use to arrive at the precise distance of the object:
(Speed of light x Time of flight) / 2
As you can see, a timer will start during the exit of the light and when the return light is received by the receiver, the time is returned by the timer. When the two times are subtracted, the “time of flight” of the light is obtained, and the speed of light is constant, so the distance can be easily calculated using the formula above. With this, all points on the object’s surface can be determined
Using Phase Shift of an Amplitude Modulated Wave
Next, ToF can also use continuous waves to detect the phase shift of the reflected light to determine depth and distance.
By modulating the amplitude, it creates a light source of a sinusoidal form with a known frequency which allows a detector to be able to determine the phase shift of the reflected light by using the formula:
where c is the speed of light (c=3×108 m/s), λ is one wavelength (λ=15 m), and ƒ is the frequency, each point on the scene can be easily calculated by the sensor to find out the depth.
And all these are happening very fast as we are working with the speed of light. Can you imagine how precise and fast the sensor is able to measure? Let me give you an example, as light travels 300,000km per second, if an object is 5m away from you, the time difference between the light leaving the camera and returning is roughly 33 nanoseconds which are equal to only 0.000000033 seconds! Wow! Not to mention, data captured will be for each and every pixel in the image which gives you precise 3D digital representations.
No matter which principle you use, providing a light source capable of illuminating the entire scene allows the sensor to determine the depth of all points. The results of this give you a range map where each pixel encodes the distance to the corresponding point on the scene. Here is an example of what a ToF range map looks like:
Now we know ToF works, why is it good? Why should you use it? What benefits do they have? No worries as here are some advantages to using a ToF sensor:
Benefits of using Time of Flight Sensor
Precise and Fast Measurements
Compared to other distance sensors like ultrasonic or laser, Time of flight sensors is able to compose a 3D image of a scene very quickly. For example, ToF cameras are able to do that in just one shot. Not only that, ToF sensors are able to accurately detect objects in a short time and are unaffected by humidity, air pressure, and temperature making them suitable for outdoor and indoor use.
As ToF sensors use lasers, they are able to measure long distances and ranges with great precision too. For example, our RPLiDAR S1 Portable ToF Laser Scanner Kit has a range of 40m! Due to this, ToF sensors are flexible as they can be able to detect near and far objects of various shapes and sizes.
It is also flexible in a scene as you are able to customize the optics of your system for optimal performance where you can select emitter and receiver types and lensing to obtain your desired field of view.
Worried that lasers coming out from your ToF sensor may harm your eyes? No worries! As many ToF sensors now use low-power infrared laser light as their light source and drive it by modulated pulse. Sensors reach Class 1 Laser Safety Standard which ensures their safety to human eyes.
Compared to other 3D depth range scanning technology like structured light camera systems or laser range finders, ToF sensors are relatively much cheaper when compared to them.
Despite all these limitations, ToF is still pretty reliable and a very quick way to capture 3D information.
Limitations of ToF
Even though ToF has many benefits, it has limitations too. Some limitations of ToF include:
In the event that very bright surfaces are located very near your ToF sensor, they can scatter too much light into your receiver and create artifacts and unwanted reflections as your ToF sensor only requires light that has been reflected just once for measurement.
When using your ToF sensor on corners and concave shapes, they may cause unwanted reflections as light may be reflected multiple times which distorts measurement.
When using a ToF camera in the great outdoors with bright sunlight can make outdoor use difficult. This is due to the high intensity of the sunlight can cause a quick saturation of the sensor pixels where actual light reflected off an object cannot be detected.
Time of Flight Sensors Examples
So far you know what a time of flight sensors is, what they are used for, how they work, and their advantages and limitations, you are pretty knowledgeable on ToF sensors now!
Interested in using ToF sensors in your projects? Here are some of my personal favorites which I think will be perfect for your projects! You can use them for various applications like factory automation, building automation, appliances, etc.
Let us look at the first ToF sensor:
RPLiDAR A1M8-R6 360 Degree Laser Scanner Kit – 12M Range
- RPLIDAR A1 is a low-cost 360-degree 2D laser scanner (LIDAR) solution developed by SLAMTEC. The system can perform a 360degree scan within a 6meter range. The produced 2D point cloud data can be used in mapping, localization, and object/environment modeling.
- RPLIDAR A1’s scanning frequency reached 5.5 Hz when sampling 360 points each round. And it can be configured up to 10 Hz maximum.
- RPLIDAR A1 is basically a laser triangulation measurement system. It can work excellently in all kinds of indoor environments and outdoor environments without sunlight. For your convenience, we made a table comparing different RPLiDARs so you can easily pick one that suits your project!
RPLiDAR S2 Low Cost 360 Degree Laser Range Scanner – 30M Range
- RPLIDAR S2 is a new generation of low-cost two-dimensional laser ranging radar, which can perform a 360-degree Omni-directional laser ranging scan within a 30-meter radius of a two-dimensional plane, and generate a flat point cloud map of the space in which it is located information. It can be used in practical applications such as map surveying and positioning and navigation.
- RPLIDAR S2 adopts laser time-of-flight ranging technology, coupled with the high-speed laser acquisition and processing mechanism developed by SLAMTEC, which can perform 32,000 ranging actions per second. It uses non-contact energy and signal transmission technology, overcomes the life limitation of traditional lidar, and can operate reliably and stably for a long time.
DepthEye S2 -H67° x V51° VGA ToF Camera with Sony IMX556PLR DepthSense
- The IMX556 is a fully integrated optical Time-of-Flight (ToF) camera sensor. The sensor features 640 x 480 (VGA) time-of-flight pixels based on the DepthSense® pixel technology. Combined with a modulated light source, this sensor is capable of measuring distance and reflectivity with VGA resolution, and the detection distance can reach 0.5m ~ 4m.
- It’s a back-illuminated ToF image sensor with a high signal-to-noise ratio, full [email protected] fps(4phase/frame), and pixel binning readout function. It also features independent flipping and mirroring and a built-in temperature sensor.
- It’s ideal in various scenes such as robot obstacle avoidance, volume measurement, object recognition, etc.
HPS-3D160-U Solid-State LiDAR
- HPS-3D160 is a new generation high-performance solid-state LiDAR sensor based on the principle of ToF, with an optimized lighting system and low distortion infrared optical lens, measuring distance up to 12m on a 90% reflective rate white target. Flexible customize ROI setting function, Simple-HDR, Auto-HDR, and Super-HDR mode, make HPS-3D160 widely used in all reflectivity scenes.
- The embedded high-performance processor, and advanced data process, filter, and compensation algorithm, enable very stable and simultaneous measure data output. Full solid structure, industrial IP67 waterproof design, and strong aerospace aluminum housing allow the HPS-3D160 to be used in a variety of complex environments
- It’s ideal in 3D modeling, and 3D movement recognition, also widely used in industrial safety area protection, proximity protection, and safety surveillance.
TFmini S LiDAR module – Short-Range ToF LIDAR Range Finder
- TFmini S LiDAR module – Short-Range ToF LIDAR Range Finder is a distance sensor of LIDAR which can emit near-infrared rays and measure the phase difference between the emitting ray and reflected ray to calculate the distance through ToF.
- It is hard to give an accurate distance between transparent objects like water or glass due to the LIDAR principle. However, it is still sensitive in measuring the moving object and calculating the distance in real-time.
- This distance sensor leaves I2C and UART interface for developers and you can simply plug TFmini through the TTL to USB converter to the PC and get the distance data on your computer.
- As for the software, there is a test software upper computer software of TFmini that you can download to observe the distance changing when the object is moving in real-time.
- Check out its datasheet for more information.
Another option for the distance sensor: TFmini Plus – ToF LIDAR Range Finder
Grove – Time of Flight Distance Sensor(VL53L0X)
Looking for a small, cost-effective ToF sensor? Introducing the VL53L0X.
- A high speed, high accuracy, and long-range ToF distance sensor based on VL53L0X which is a new generation Time-of-Flight (ToF) laser-ranging module housed in the smallest package on the market today, providing accurate distance measurement whatever the target reflectances.
- It can measure absolute distances up to 2m, setting a new benchmark in ranging performance levels, and opening the door to various new applications.
- The VL53L0X integrates a leading-edge SPAD array (Single Photon Avalanche Diodes) and embeds ST’s second-generation Flight SenseTM patented technology.
- The VL53L0X’s 940 nm VCSEL emitter (Vertical-Cavity Surface-Emitting Laser), is totally invisible to the human eye, coupled with internal physical infrared filters, which enables longer ranging distances, higher immunity to ambient light, and better robustness to cover glass optical crosstalk.
Slamtec Mapper M1M1 ToF Laser Scanner Kit – 20M Range
Looking for a ToF laser scanner? Check this sensor out!
- The Slamtec Mapper has two models with a detection range of 20m and 40m. It can easily map for home scenes or commercial, light industrial scenes. The following picture shows the M1M1 map function with a 134 meters * 111 meters underground parking lot. In the handheld mode, the built-in 9 degrees freedom inertial navigation system of the M1M1 can eliminate the bumps and shake caused by walking and exert super high map construction performance.
- It is more than a laser range scanner, the M1M1 features high-quality mapping and real-time localization or navigation function. This means it can easily map your home or office. Actually, it supports both indoors and outdoors mapping and supports large working scenarios over 100,000 m². It is a perfect laser scanner for robot localization and navigation, environment surveying and mapping, etc.
- The M1M1 can detect up to 20 meters with the 5cm resolution and the re-localization accuracy is less than 0.02m. Such high-performance is thanks to the SLAMTEC third-generation SLAM engine. On top of that, SLAMTEC M1M1 is quite easy to use, there is no need for any external dependency, just connect it to your computer via the USB cable, and it will work then. What’s more, the M1M1 comes with SLAMTEC full cross-platform SDK and tools for both mobile phones and PC. Get one now and make your own map!
Here is a video of it in action:
- Require more range? Check out the RPLiDAR S1 Portable ToF Laser Scanner Kit with a 40m range!
Opene8008B – QVGA Time-of-Flight Sensor Evaluation Kit
Looking for a ToF camera? This will be perfect for you!
- Opene8008B – QVGA Time-of-Flight Sensor Evaluation Kit is a high-resolution ToF camera to get depth images.
- It is assembled with Opene8008B – QVGA ToF chip which can reach the resolution of 320×240 and all necessary hardware to operate Opene8008B including both the camera lens and illumination. It can be connected to a PC for real-time visualization and recording of depth map data.
- For most of the ToF cameras, their maximum operation range is about 5~7m, but this ToF camera can reach up to 10m. Besides, the FPS performance of the camera is 120 at max, so the images would be very coherent under the ToF sensor.
Want to find out more about the VL53L0X and how to get started with it with the Arduino? Check out our guide!
Time of flight sensors can be utilized in a range of applications. From 3D mapping, industrial automation, obstacle detection, autonomous vehicles, agriculture, robotics, indoor navigation, gesture recognition, object scanning, measure volumes, and surveillance to even augmented reality! Applications of the ToF technology are endless.
What are your thoughts on ToF sensors? What will you use it for? Let us know in the comments down below!