Time of Flight Sensor Interface Design
A time of flight sensor measures the delay between a light pulse leaving an emitter and its return to a detector, and converts that delay into a distance. The delay for a metre is about six and a half nanoseconds, so the whole design is a study in short intervals and in rejecting the light that arrives from everywhere else.
The Measurement Principle
Light travels about thirty centimetres in a nanosecond, and the round trip doubles that, so a resolution of a centimetre corresponds to a timing resolution of about sixty seven picoseconds. That is the number the electronics has to deliver.
Direct measurement counts the interval with a very fast time to digital converter. Indirect measurement, which is more common in integrated sensors, modulates the light and measures the phase of the returned signal, which is a slower but much cheaper way to get the same information.
Both methods are limited by the energy in the pulse and by the ambient light, and both produce a histogram of arrival times rather than a single number. The distance is estimated from the histogram, and the quality of that estimate depends on how it is processed.
The Emitter and Its Driver
The emitter is a laser or an LED operating in the near infrared, chosen because silicon detectors respond well there and because the light is invisible. A vertical cavity laser with a narrow beam allows a small spot and a long range, while an LED is wider and cheaper.
The driver has to deliver a short, high current pulse, often several amps for a few nanoseconds. That means a low inductance loop, a fast switch and a capacitor close to the emitter, and the loop area is what limits the achievable pulse width.
Eye safety sets the maximum optical power, and the relevant standard is based on the energy in a pulse as well as on the average power. A short pulse allows a higher peak power, which is why these systems pulse rather than run continuously.

The photodiode front end
The photodiode has to have a low capacitance and a short transit time, so it is small and often operated with a reverse bias. Its active area is a compromise between the light it collects and the capacitance it presents.
A transimpedance amplifier converts the photocurrent to a voltage, and its bandwidth determines the shape of the pulse it can reproduce. A wider bandwidth preserves the arrival time and admits more noise, and the choice is made from the timing accuracy required.
Some systems use a single photon avalanche detector instead, which produces a digital pulse for each detected photon. That gives the best timing resolution and requires a bias above the breakdown voltage, with the temperature and the quench circuit carefully controlled.
ambient light and Its Rejection
ambient light produces a standing photocurrent that does not carry distance information and consumes the dynamic range of the front end. In sunlight the photocurrent from the background can be thousands of times larger than the returned pulse.
A narrow optical band pass filter in front of the detector removes most of the visible background while passing the infrared emitter band. The filter is the single most cost effective measure, and its bandwidth determines how much of the sun’s spectrum reaches the detector.
Differential measurement in time removes the rest. The received signal is sampled just before the pulse and again during it, and the difference is taken, which cancels a slowly varying background. The same idea in the digital domain is the subtraction of a baseline histogram.

Building the histogram
The histogram is the distribution of arrival times accumulated over many pulses. Each pulse contributes a count in one time bin, and the distance is the position of the peak, which is a far more robust estimate than the timing of a single pulse.
The bin width sets both the resolution and the energy required per bin. A bin of fifty picoseconds needs far more pulses to build a peak than a bin of five hundred, which is the trade between accuracy and measurement rate.
The background appears as a uniform floor across the histogram, and the returned pulse as a local excess. Finding the excess above a threshold, or fitting the known pulse shape, is the detection step, and its setting determines how far the sensor can see.
timing resolution and Systematic Errors
timing resolution is limited by the jitter of the detector, the amplifier noise and the resolution of the time to digital converter. A jitter of a hundred picoseconds translates into about a centimetre and a half of distance noise even with a perfect signal.
Systematic errors are separate from the noise. The delay through the emitter driver, the detector and the cables is a fixed offset that has to be calibrated out, and it drifts with temperature. A reference path inside the package measures the offset and corrects it.
The pulse shape also introduces a bias, because the returned pulse is broader than the emitted one and its reference point shifts with the strength of the return. A calibrated curve of distance against amplitude corrects for the effect in a good implementation.
Layout and Optical Considerations
Keep the emitter loop small and the detector input short, and place them so that light from the emitter cannot reach the detector except by reflection from the target. A crosstalk path inside the sensor creates a fixed echo at a short distance that masks a real object.
In a module the two are separated by a baffle that absorbs the light that would otherwise travel directly. The baffle material should be black and matt, and the surface around the detector should be treated the same way.
The supply of the emitter driver must be well decoupled because the pulse current is large. The decoupling capacitor is placed at the driver, and its loop to the emitter and the switch is the same loop that sets the pulse width. The principles behind containing such a fast loop are set out in our guide to EMI suppression design principles.
Verification and Common Faults
Verify the sensor against a target at a measured distance, in the dark and under the brightest light it will meet. The difference between the two readings shows the effectiveness of the ambient rejection.
A reading that is short by a fixed amount at every distance points to an offset in the timing chain, while one that is short by a proportion of the distance points to a scale error in the clock. The two are corrected separately.
A reading that is noisy only on a shiny or a dark target is caused by the strength of the return rather than by the electronics. The amplitude compensation curve and the histogram threshold are the parameters to check. The release checks that keep these boards consistent are collected in our PCB design release checklist, and the assembly points in judging PCB quality.
FAQ
How accurate can a time of flight sensor be? A centimetre is achievable with a good histogram and amplitude compensation. Below that the jitter of the detector and the width of the pulse dominate.
Why is my reading short in sunlight? The background photocurrent is using the dynamic range of the front end. Add a narrow band pass filter and use differential sampling.
What limits the range? The energy that reaches the detector. Range falls as the square of distance, so doubling the range needs about four times the optical power.



