B.Sc. thesis · University of Stuttgart · sole author · Sep 2025
Optical position sensing — from circuit to test rig
Comparing infrared and time-of-flight sensing for a floating steel ball.
Maglev systems and pick-and-place robots need an object’s vertical position quickly and to the millimetre. The institute’s original sensor, a halogen lamp and a solar cell, reacts slowly because of the lamp’s thermal inertia and draws about 30 W. I built an infrared photodiode system and compared it with two time-of-flight sensors.
My contribution
Sole author, from parts to measurements.
I designed and hand-soldered the sensor boards, integrated the ToF readout, and carried out the comparative measurements.
Sensor boards
Chose the IR LEDs and photodiodes, calculated the expected photocurrent and simulated the receiver chain in LTspice. Laid out two boards in KiCad and soldered them by hand: an LED driver with five IR LEDs, and a receiver with a photodiode strip and a four-stage amplifier and filter chain.
ToF readout
Firmware for the VL6180X and VL53L0X sensors on an Arduino Mega, and a Python interface for logging.
Measurements
Ran every comparison on the same rig against the same height gauge: linearity, accuracy, response time and robustness.


How I approached it
Define, build, test, decide.
Every system was judged on the same criteria, on the same rig and against the same reference.
This is “Measure, don’t guess” from my homepage, in practice.
Define
Four criteria for every system: linearity, accuracy, response time, and robustness to room light and reflections.
Build
Before laying out any board, I calculated the expected photocurrent and simulated the receiver chain in LTspice. I put the photodiodes on a separate plug-in board so that taller parts on the main board could not shade them, then laid out and hand-soldered both boards in KiCad and wrote firmware for the ToF sensors.
Test
One rig, a height gauge (±0.01 mm) as reference and the same calibration steps for each system. Runs with and without room light and with a 50 Hz lamp as interference; response time from step responses on an oscilloscope.
Decide
Robustness tests under three conditions (ball alone, lamp alone, both) showed that reflections from the metal ball cause most of the scatter in the IR signal.
Results & trade-offs
IR is fastest; ToF is more linear.
For a fast control loop, the IR signal is the better input; for an absolute distance, ToF is. Together they point to a hybrid.
≈ 19 µs
IR photodiode system
Practically unaffected by room light.
10.1 ms
VL6180X (ToF)
Most robust and linear, up to about 200 mm.
33.7 ms
VL53L0X (ToF)
More range, but more sensitive to reflections and lamp light.
Response time from step responses, measured with and without room light.
Reflection
Fast, but not yet linear enough.
Reflections from the metal ball and overlapping light from the five LEDs bend the IR curve.
Known limits
The IR system is fast, energy-efficient and compact, but does not yet reach the linearity of the original system. The ball was positioned by hand and held still, so dynamic effects were deliberately left out.
Next steps
Lenses and apertures to reduce overlap and stray light, a control loop to shape the characteristic, and a hybrid: IR photodiodes for fast control, ToF for absolute distance.
Full case study
B.Sc. thesis · University of Stuttgart · Institute of Power Electronics and Electrical Drives · presented 12 Sep 2025
Measuring a floating steel ball with light
Original title: Vergleich von Sensorsystemen zur vertikalen Positionsbestimmung eines Körpers im Raum, a comparison of sensor systems for the vertical position of a body in space.
Why
Maglev systems need the air gap between vehicle and track with millimetre precision at high speed, and pick-and-place robots need vertical position too. The goal was to build alternative sensor systems and compare them with an existing one for linearity, accuracy, response time and robustness.
What I compared
- My IR photodiode system: five IR LEDs (VSLY5940) and photodiodes (PDB-C607-2) on two custom PCBs. The photocurrent passes a transimpedance amplifier, an inverting amplifier and a summing amplifier, with offset compensation for ambient light and filtering of the 50 Hz lamp flicker.
- Two time-of-flight sensors: VL6180X for short range (about 5–200 mm) and VL53L0X for longer range, read out with an Arduino Mega.
- The institute’s existing system: a halogen lamp and a solar cell. It was not rebuilt; its comparison data comes from earlier work.
My part
Sole author: component selection and photocurrent calculation, LTspice simulation of the receiver chain, KiCad design and hand-soldering of both PCBs, ToF firmware and a Python logging interface, and all measurements.
Results, with context
- Response time: about 19 µs for the IR photodiode system, 10.1 ms for the VL6180X and 33.7 ms for the VL53L0X, measured with and without room light. The IR system is practically unaffected by ambient light.
- Linearity: the IR system is very sensitive but less linear than the existing lamp-and-solar-cell system. The deviations come from reflections off the metal ball and overlapping light from the five LEDs.
- ToF: the VL6180X is the most robust and linear at short range (up to about 200 mm); the VL53L0X covers more range (tested to about 500 mm, linear to about 300 mm) but reacts more to reflections and lamp light.
Outlook
Lenses and apertures to reduce overlap and stray light, a control loop to shape the characteristic, and a hybrid: IR photodiodes for fast control and ToF for absolute distance.