Hello friends, I hope you all are doing great. Today, I am going to share the new VL53L1X Distance Sensor Library for Proteus Simulation. The VL53L1X is ST's long-range time-of-flight sensor: a laser, a light detector fast enough to count single photons and a small processor in a package smaller than a grain of rice, which tells you the distance to the nearest object up to about 4 metres - by timing light. It sits in robots, drones, parking aids and people counters. With this library you can run a full Proteus simulation of the sensor over its real register interface: the boot, the model ID, ST's configuration, the distance modes, the timing budget, the range status and the data-ready pin, so that your driver code works before the module arrives.
VL53L1X Distance Sensor Library for Proteus
Latest version: V1.0 (November 2026, this tutorial)
Other distance sensors: VL53L0X · TF-Luna LiDAR · Sharp IR · Ultrasonic HC-SR04
Helping Tools
- Serial Monitor Advance: a serial terminal window for the UART of your board
- Serial Monitor Expert: the serial monitor with extra debugging tools
- LCD Library for Proteus V3.0: 16x2, 20x4 and I2C LCDs to show your readings
The module comes alive at run time: a DATA LED blinks with every measurement and the emitter window glows while it ranges. The demo is a parking distance meter: a white car backs into a garage, parks, leaves, a black car rolls in and then the sun shines on the wall - and an Arduino shows the distance, a bar, the signal and the status on an OLED, with an OK and a NEAR LED.
NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the VL53L0X board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the VL53L1X Distance Sensor Library for Proteus Simulation:
How Does a Time-of-Flight Sensor Work?
Light travels 30 centimetres in a nanosecond. A time-of-flight sensor sends a short pulse of invisible 940 nm laser light, catches what comes back from the target, and measures how long the trip took: the distance is the speed of light times the round trip, divided by two. For one metre that is about 6.7 nanoseconds. The VL53L1X does it with a VCSEL - a tiny surface-emitting laser - and an array of SPADs, single-photon avalanche diodes, each of which fires on a single photon. It repeats the measurement thousands of times within one timing budget and builds a histogram of arrival times, so it can find the target's echo among the photons of the ambient light.
| VL53L1X time-of-flight ranging sensor (ST) | |
|---|---|
| Package | 4.9 x 2.5 x 1.56 mm, a 940 nm Class 1 laser and a SPAD receiver |
| Range | up to about 4 m; short mode about 1.3 m, long mode up to about 3.6 - 4 m |
| Field of view | 27 degrees (a programmable region of interest) |
| Timing budget | 20 - 1000 ms per measurement; up to 50 Hz |
| Interface | I2C at 0x29 (16-bit register addresses), up to 1 MHz |
| Pins | GPIO1 (data ready, open drain), XSHUT (shutdown, active low) |
| Supply | 2.6 - 3.5 V for the chip; the modules have a regulator for 3.3 - 5 V |
| Uses | robots, drones, parking aids, people counting, liquid levels |
Why the Colour and the Sunlight Matter
The sensor sees a target as long as enough of its own photons come back. A white wall returns most of the light; a black car returns only a few percent. The return falls with the square of the distance, so a dark target simply disappears sooner. Sunlight is the other enemy: it floods the SPADs with photons of its own and hides the faint echo. ST's own figures for a white target in long mode are about 3.6 m in the dark and only about 73 cm in strong light. Short mode reaches only about 1.3 m but holds it almost the same in the sun. Our model follows that picture.
The Range Status
Every measurement comes with a status, and a distance without its status means nothing. ST's Ultra Lite Driver (ULD) reads the raw value at 0x0089 and maps it to a short list: 0 is a valid range, 1 a sigma fail (too noisy), 2 a signal fail (too little light back), 4 out of bounds, 7 a wrap-around. When nothing is in range, the distance register still holds a number - only the status tells you not to believe it.
Features of the VL53L1X Distance Sensor Library for Proteus Simulation
- A real-looking module: the purple 18 x 13 mm board at its real size, the VL53L1X with its emitter and receiver windows, the regulator, the level shifter and the six-pin header.
- Animated: a PWR LED, a DATA LED that blinks with each measurement and the emitter window glowing while it ranges (our additions - the real laser is invisible).
- The real register interface: I2C at 0x29 with 16-bit addresses, the boot flag, the model ID 0xEACC, the address change, ST's 91-byte default configuration.
- Real settings: short and long modes, the ULD's timing budget values, the inter-measurement period, start, stop and clear.
- Real results: the range status, the distance, the signal and ambient rates, GPIO1 and its polarity, XSHUT.
- A scene: a garage with a white car, a black car and the sun, plus chips for white, grey and black targets and a sunlight switch.
- A pop-up: the sensor, its beam and the target with the range limit, the distance over the run, eight live tiles, graphs, an event log and a check page.
- A complete package: about 2.3 MB with the library, our OLED, 5 mm LED and resistor libraries, our Arduino UNO V4.0 and the demo, without the source code of the model.
The VL53L1X in Proteus
The device is VL53L1XTEP in TEPVL53L1X.LIB, under Sensors > Distance, with the prefix U and the model TEPVL53L1X.DLL. Search VL53L1X or distance in Pick Devices. Six pins along the bottom: VIN, GND, SCL, SDA, GPIO1 and XSHUT. Its properties: PROFILE (DEMO or STEADY) and DIST (the target's distance in mm, for STEADY).
Download VL53L1X Distance Sensor Library for Proteus Simulation
Click the button below to download VL53L1X-Distance-Sensor-Library-for-Proteus-v1.0.zip (about 2.3 MB, without the source code of the models):
VL53L1X Distance Sensor Library for Proteus V1.0- README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
- Proteus Library Files:
TEPVL53L1X.LIB,TEPOLED12864.LIB,TEPLED5MM.LIB,TEPRESISTOR.LIBandArduinoV4TEP.LIB. - Proteus Model Files:
TEPVL53L1X.DLL,TEPOLED.DLL,TEPLED5MM.DLL,TEPRESISTOR.DLLandTEPARDUINO.DLL. - Arduino Code: the demo sketch (no extra library).
- Proteus Simulation: the demo project, its HEX file and copies of the DLLs.
No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.
How to Install VL53L1X Distance Sensor Library for Proteus Simulation
- Close Proteus and extract the whole zip file, for example to your Desktop.
- Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
- Copy the files from Proteus Model Files into the MODELS folder.
- Delete
TEPVL53L1X.IDXfrom the LIBRARY folder if it is there. - Start Proteus, press P and search for VL53L1X.
Proteus Simulation of a Parking Distance Meter
Our demo is the sensor on a garage wall. U1 is the VL53L1X with PROFILE DEMO: nothing in front, a white car backing in from 2 seconds and parked at 250 mm, gone at 12.5 seconds, a black car rolling in from 13 seconds and bright sun on a white wall 1.2 m away from 18 seconds. VIN goes to 5 V, SCL and SDA to A5 and A4 of our Arduino UNO Library for Proteus V4.0, GPIO1 to D2, and XSHUT stays open - the module pulls it up. Our OLED SSD1306 Library for Proteus shares the I2C bus, and two LEDs from our 5mm LED Library for Proteus sit beside it: OK (green, D5) for a valid distance and NEAR (red, D6) under 300 mm, each through 220 ohm. The Arduino's built-in monitor is the same window as our TEP Serial Monitor Advance for Proteus. Open VL53L1X-Parking-ArduinoUnoV4.pdsprj.
The Sketch
The sketch needs no library: it follows ST's ULD with plain Wire calls. Every register address is 16 bits, sent MSB first:
void wr8(uint16_t reg, byte v) { Wire.beginTransmission(TOF); Wire.write(reg >> 8); Wire.write(reg & 0xFF); Wire.write(v); Wire.endTransmission(); }
After the boot and the model-ID check, the init writes ST's default configuration - 91 bytes, one register at a time:
for (uint16_t a = 0x2D; a <= 0x87; a++) wr8(a, pgm_read_byte(CONFIG + a - 0x2D));
GPIO1 can be active high or low; bit 4 of GPIO_HV_MUX__CTRL tells which, and the sketch reads it the ULD's way:
intPol = !((rd8(0x0030) & 0x10) >> 4); // GPIO_HV_MUX__CTRL bit 4: 0 = active high
Then the long distance mode, a 50 ms timing budget (the ULD's values for the two timeout registers) and a measurement every 100 ms - a period counted in the sensor's own oscillator, read from 0x00DE:
void setBudget50ms() { wr16(0x005E, 0x00AD); wr16(0x0061, 0x00C6); } // the ULD's long-mode values for 50 ms
wr32(0x006C, (uint32_t)(pll * ms * 1.075));
Each time GPIO1 says a distance is ready, the sketch reads the status and maps it with the ULD's table, reads the distance, and clears the interrupt so that the next one can come:
status = raw < 24 ? pgm_read_byte(STATUS + raw) : 255;
dist = rd16(0x0096); // mm
wr8(0x0086, 0x01); // clear the interrupt: the next distance can come
The OLED shows the distance in big digits or OUT OF RANGE, a 0 - 4 m bar, the signal in MCPS, the status, and NEAR - STOP under 300 mm.
VL53L1X Simulation Results
Open the project and press Run. The demo runs 21.5 simulated seconds and took about 4 minutes on our PC with the pop-up open and the pictures being taken. Click the sensor for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.
Boot, Init and an Empty Garage
The sensor booted 3 ms after power-up - FIRMWARE__SYSTEM_STATUS read 0x03 - and the sketch printed "Booted, model ID 0xEACC". The Event log then shows the ULD's init step by step: ranging started at 102 ms with the default configuration (long mode, a 100 ms budget), the first measurement came at 203 ms, ranging stopped, and at 206 ms it started again with the sketch's own settings - long mode, a 50 ms timing budget and a measurement every 100 ms. The pop-up's MEASUREMENTS tile confirms 10.0 Hz. With the garage door open and nothing within range, every measurement came back with status 2, a signal fail; the monitor printed "Out of range", the OLED said OUT OF RANGE and both LEDs stayed dark.
A White Car Backing In
At 2 seconds a white car starts backing in from 3.5 m. For a car of that colour under the garage light, the model's range is 2.66 m, so the first second still reads out of range - the red ticks along the bottom of the pop-up's chart. Then the car crosses the line and the measured distance follows it closely: at 5.5 seconds the target was 1063 mm, the sensor reported 1078 mm with a sigma of 4.2 mm and a return signal of 2.71 MCPS, and the green OK LED was lit. The monitor counted down 502, 312 and 250 mm as the signal grew to 12.69 and 33.30 MCPS.
Parked
The car stops 250 mm from the wall. The sensor reported 248 to 255 mm, the signal reached the model's ceiling of 40 MCPS, and the sketch switched from OK to NEAR: when the run paused at 10 seconds, the OLED read 248 MM with an almost empty bar, STATUS 0 VALID and NEAR - STOP, and the red NEAR LED was lit. At 11 seconds the car drives off; the monitor caught it at 1852 mm with a signal of only 0.91 MCPS, and then "Out of range".
A Black Car
At 13 seconds a black car rolls in from 2 m. It reflects only 5 % of the light, so its range is just 711 mm. At 14 seconds it was 1578 mm away and the status was 2 with a signal of 0.09 MCPS; the monitor printed 2046, 1415 and 1037 mm, all with status 2 - numbers the sketch rightly ignores. Only when the car came within its range did the status turn to 0: "Target in range", 679 mm on the monitor, and at 16.3 seconds the target was 591 mm and the sensor reported 601 mm.
Bright Sun
From 18 seconds the sun shines on a white wall 1.2 m away. A white wall at 1.2 m is easy indoors, but the sunlight floods the receiver and cuts the long mode's range to 694 mm. The signal from the wall was a healthy 2.77 MCPS, yet every measurement came back with status 2, and the distances wandered from 1277 to 1598 mm. That is exactly why the sketch trusts the status and not the number. At 21 seconds the wall is gone and the run ends out of range, after 214 measurements: 98 valid and 116 out of range.
The Graphs, the Event Log and the Check Page
The Graphs page plots the target, the measured distance, the return signal and the range limit for that target and light. The Event log keeps the boot, the ranging and each change of the scene. The Check page sums up the run: VIN at 5.00 V, XSHUT high through the module's pull-up, booted with the model ID 0xEACC, I2C at 0x29 with 1,276 reads, long mode with a 50 ms timing budget every 100 ms, and 214 measurements - the last one out of range with nothing in front.
The monitor shows the sketch's side: the boot, the settings, the distance once a second and each change between in range and out of range.
VL53L1X, VL53L0X, LiDAR, Sharp IR or Ultrasonic?
Our VL53L0X Library for Proteus simulates the VL53L1X's smaller brother: the same idea, up to about 2 m. For more range, our TF-Luna LiDAR Library for Proteus measures to 8 m over UART. Our Sharp IR Distance Sensor Library for Proteus is the old analog way - an infrared triangulation sensor with a voltage output and a short, curved range. And our Ultrasonic Sensor Library for Proteus V2.0 times sound instead of light: cheap and happy with dark or transparent targets, but with a wide beam and slower answers. The VL53L1X sits between them: small, precise to millimetres, a narrow beam, but sensitive to sunlight and dark surfaces.
Try It Yourself
- Click Grey 3 m: out of range in long mode indoors. Then White 2 m: valid. The colour matters as much as the distance.
- Click Sunlight with a white target at 2 m: the status turns to signal fail. Then switch the sketch to short mode and move the target within 1.2 m.
- Change the timing budget to 100 ms (0x01CC / 0x01EA): the readings get steadier, the range a little longer.
- Remove the interrupt clear (0x0086): GPIO1 stays asserted and the sketch reads the same distance again and again.
- Write a new address to 0x0001 and talk to the sensor there - the first step for several sensors on one bus.
Ideas to Extend the Demo
- A buzzer that beeps faster as the car comes closer.
- A people counter at a door with two regions of interest.
- A tank level meter that looks down at the water.
Your Own Sketches
The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.
Things to Know Before Using a Real VL53L1X
- The init: write ST's default configuration (the ULD's SensorInit) before you range - the sensor needs it.
- The cover glass: keep it clean and close, or its reflection reads as a target (crosstalk); ST has a calibration for it.
- The light: outdoors use short mode; for range, a longer timing budget.
- The beam: 27 degrees wide - it sees the nearest thing in the cone. Narrow it with the region of interest for a small target.
- Several sensors: hold all but one off with XSHUT, give it a new address, and repeat.
Troubleshooting
- Nothing answers at 0x29: VIN missing, XSHUT held low, or the address was changed earlier.
- The status is always 2: the target is too far, too dark or in too much light for the mode - or nothing is in front.
- Data ready never comes: ranging not started (0x0087 = 0x40), or the polarity read the wrong way.
- The same distance over and over: the interrupt is not cleared (0x0086 = 0x01).
- The part is not simulated:
TEPVL53L1X.DLLis missing from MODELS and from the project folder.
Limitations of the Simulation
- The register interface - the 16-bit addresses, the boot flag, the model ID, the configuration block, the modes, the timing budget values, the period, the status table, the results, GPIO1, XSHUT and the address change - follows ST's Ultra Lite Driver; the module is our own drawing.
- Our own choices: the signal and range formula behind the scene, the noise, the oscillator value, the LEDs and the glowing emitter.
- Not modelled: the region of interest, crosstalk and offset calibration, the threshold and window interrupts, more than one object in the beam.
- Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or STMicroelectronics. The demo carries ST's default configuration bytes under ST's BSD-3-Clause licence.
- Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.
So, that was all about the VL53L1X Distance Sensor Library for Proteus Simulation. I hope it helps you get your 16-bit registers, your init and your status checks right before the first module arrives - and shows how a sensor smaller than a grain of rice can time light to the millimetre. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!