Extension board · Sensors and inputs

VL53L1X distance sensor

A laser distance sensor board: it times invisible light to a surface and reports the distance, up to 4 m in the dark. It connects to an I2C socket or a Qwiic cable. Reading it needs your own driver.

Top view of the sensor board: two ten-contact sockets standing side by side at the top, the small sensor module in the middle, two lights on the right and a header and Qwiic connector at the bottom.
Top view, drawn from the board’s design files. This is a drawing, not a photograph.
4 mmaximum range, dark, data sheet
27°field of view, diagonal
0x29I2C address at power-up
3.3 Vsupply and logic only
40 mApeak current
40 × 40millimetres, four M3 holes
This is not a safety device. Never use it as a guard, interlock or person detector. Smoothieware does not support this board yet. If you have a use for it, email wolf.arthur@gmail.com: we will implement it, or help you implement it.

Tech specs

PurposeMeasuring the distance to a surface without touching it
SensorST VL53L1X time-of-flight module, 940 nm Class 1 laser
RangeFrom 4 cm; up to 4 m on a white target in the dark, about 73 cm in strong ambient infrared light (data sheet, long-range mode). Quoted ranging error ±20 to ±25 mm
Field of view27° diagonal, typical; software can narrow it to 15°
RateUp to 50 readings per second
InterfaceI2C up to 400 kHz, address 0x29; interrupt output and shutdown input
Supply3.3 V only, 40 mA peak
Pull-ups3.3 kΩ on SDA and SCL, removable
ConnectorsTwo Gadgeteer type I sockets (Samtec SHF-105, 1.27 mm), Qwiic, and holes for a 1×4 2.54 mm header
Size40 × 40 mm, four M3 holes on a 30 × 30 mm square
Works withSmoothieboard V2 Prime header GG electrically; no firmware driver
LicenceOpen hardware, CERN-OHL-S-2.0

Every figure with its basis is in the electrical specifications appendix; hole positions are in the mounting dimensions appendix.

Board tour

The numbers on the drawing match the list below it. The board is shown from the component side.

  1. 1
    Input socket I IN — The ribbon cable from the controller goes here.
  2. 2
    Chain socket CHAIN — Passes the bus on to the next board.
  3. 3
    Distance sensor — The VL53L1X module. Remove the protective film on top, and keep everything out of its view.
  4. 4
    Supply capacitors — Smooth the supply right next to the module.
  5. 5
    Interrupt and shutdown resistors — Hold both lines high when nothing drives them.
  6. 6
    Bus pull-ups — 3.3 kΩ; disconnect them with the two links underneath.
  7. 7
    Power light PWR — Green while 3.3 V is present.
  8. 8
    Interrupt light INT — Blue while the sensor pulls its interrupt line low.
  9. 9
    2.54 mm header — Ground, 3.3 V, SDA, SCL, for jumper wires. Solder it only if you want it.
  10. 10
    Qwiic connector — The same bus on a four-way cable.
  11. 11
    Mounting hole — One of four M3 holes.
Point at a number, or tap it, to read what the part is; the same text is in the list. On a small screen, scroll the drawing sideways.

Pinout

Everything on this board is 3.3 V. Check contact numbering with the power removed.

J1: input socket (I IN)

ContactSignalUsePrime header GG
13.3 VBoard supply3.3 V
25 VNot used, passed to the chain5 V
3INTInterrupt from the sensorPH2
4, 5, 7Passed throughNot usedPH4, PC0, PH3
6XSHUTLow holds the sensor in shutdownPF15
8SDAI2C dataPF0 (I2C2_SDA)
9SCLI2C clockPF1 (I2C2_SCL)
10GNDGroundGND

J3 Qwiic and J4 header

Both carry the same four signals.

PinSignal
1GND
23.3 V
3SDA
4SCL

What you need

An I2C portPrime header GG, or any 3.3 V I2C host.
A cableGadgeteer ten-way ribbon, Qwiic, or jumper wires on the header.
Clear viewNothing in front of the sensor but the target. A cover window must suit infrared light.
Your own driverNone is supplied.

Get started

Wiring: one ten-way ribbon cable from Smoothieboard V2 Prime socket G_G to the sensor board socket marked I IN.Smoothieboard V2 Prime, socket G_GDistance sensor boardTen-way ribbon, G_G to I IN
One ribbon cable carries power, I2C, the interrupt and the shutdown line. Check pin 1 at both ends before power on.
  1. Remove the film

    Peel the protective film off the sensor module.

  2. Mount the board

    Four M3 screws, sensor facing the target.

  3. Connect with the power off

    Ribbon cable from header GG to I IN.

    After power on, the green PWR light is on.

  4. Find the device

    At I2C address 0x29, read one byte from register address 0x010F (the register address is two bytes long).

    It reads 0xEA, the model ID.

  5. Range

    Start ranging with ST’s driver for the VL53L1X or your own, then move a sheet of paper in front of it.

    The distance follows the paper.

Configuration

You wantModuleExample
Read a distanceNoneNo Smoothieware driver for this sensor

There is nothing to add to config.ini. The wiring and driver settings for each use are in the next section.

Uses

1. Two sensors on one port

Both sensors answer at address 0x29 after power-up. The board lets the controller hold one of them in shutdown while it gives the other a new address.

Two sensor boards: controller socket G_G to I IN of the first board, and CHAIN of the first board to I IN of the second.Smoothieboard V2 Prime, socket G_GSensor A: enabled by pin 6Sensor B: enabled by pin 3
Two sensors on one port. Change the solder links on the underside as listed below before connecting.
Board Link on the underside Set to
A (next to the controller) INT-3 (JP12) open
A CHAIN P3 (JP3) closed
B (second) INT-3 (JP12) open
B XS-6 (JP13) open
B XS-3 (JP14) closed
B PULLUP SDA and SCL (JP1, JP2) open

Then A is enabled by contact 6 (PF15) and B by contact 3 (PH2). In your own driver: drive both low; release PF15; write the new 7-bit address of A (for example 0x30) into register 0x0001; release PH2; B answers at 0x29. Repeat after every power cycle. The register is the one used by the Pololu driver library; the ST data sheet only states that the address can be changed. Neither interrupt reaches the controller in this arrangement.

2. Distance and orientation on one bus

Chain a 9-axis IMU board behind the sensor to measure how far away a surface is and how the carrier is tilted.

A sensor board chained to a 9-axis IMU board on the same I2C bus.Smoothieboard V2 Prime, socket G_GDistance sensor, 0x299-axis IMU, 0x28
A distance sensor and an orientation sensor share the two bus wires. Their addresses differ.
Setting Value
Sensor address 0x29
IMU address 0x28, with the address link JP4 on the IMU board left open (closed gives 0x29, which clashes)
Pull-ups Keep one set: open JP1 and JP2 on one of the two boards
Interrupt on contact 3 Used by the sensor. The IMU interrupt does not reach the controller through the open CHAIN P3 link

3. Cable-only connection

A Qwiic or STEMMA QT cable, or the four-pin 2.54 mm header, connects the board to any 3.3 V I2C host, such as a development board used to try a driver.

Qwiic cable between the Qwiic connectors of two boards, shown with two sensor boards.Four-way Qwiic cable: ground, 3.3 V, SDA, SCL
Qwiic carries only power and I2C: no interrupt and no shutdown line, so two of these sensors cannot be told apart this way.

The shutdown line then stays high through its on-board resistor and the sensor starts by itself. Driver check: after at least 1.2 ms, the model ID byte at register address 0x010F (a 16-bit address) reads 0xEA.

Machine ideas

With your own driver the readings can show whether a lid is open, how much material is left on a spool, or whether a part is in place. The sensor sees a patch of the target, not a point: at 27 degrees the patch is about 48 mm across at 100 mm (calculated). It is not precise enough to level a print bed or set a tool height, and it must never guard a person or stop a machine for safety.

How it works

The module sends laser pulses, times their return and answers over I2C. Targetany surface VL53L1Xtime of flight I2CSDA, SCL Your driverdistance
One measurement path.

The VL53L1X contains an infrared laser, a receiver made of many small light detectors and a processor. It measures how long the light takes to come back, so the reading depends much less on the colour of the target than a brightness-based sensor does; colour and ambient light still change the maximum range. It runs directly from 3.3 V.

The shutdown line (XSHUT) is held high on the board, so the sensor starts by itself unless the controller pulls it low. The interrupt line is open drain: the sensor can only pull it low. Which level means a new reading depends on how the driver sets its polarity.

Behind a cover window, use a material that passes 940 nm light, keep the air gap small and calibrate for crosstalk as ST’s application note AN5231 describes. Mechanical parts must stay outside a cone above each of the two sensor openings: at a height h above the module, about 0.54 mm + 0.36 × h from the centre of the opening (calculated from the data sheet), plus your assembly tolerance.

Solder links

All links are on the underside. For one sensor, leave them as delivered. Open JP1 and JP2 when another board on the bus already has pull-ups.

Solder links as delivered: JP1 closed; JP2 closed; JP3 open; JP6 open; JP8 closed; JP9 closed; JP10 closed; JP11 closed; JP12 closed; JP13 closed; JP14 open. JP1 · closedSDA pull-up JP2 · closedSCL pull-up JP3 · openchain contact 3 JP6 · openchain contact 6 JP8 · closedchain SDA JP9 · closedchain SCL JP10 · closedPWR light JP11 · closedINT light JP12 · closedinterrupt to 3 JP13 · closedshutdown on 6 JP14 · openshutdown on 3
The links as delivered. Close one with a small blob of solder across both pads; open it by removing the solder or cutting the copper between the pads.
LinkWhat it doesAs delivered
JP1Connects the SDA pull-upClosed
JP2Connects the SCL pull-upClosed
JP3Passes contact 3 to the chain socketOpen
JP6Passes contact 6 to the chain socketOpen
JP8Continues SDA to the chainClosed
JP9Continues SCL to the chainClosed
JP10Powers the green lightClosed
JP11Powers the blue lightClosed
JP12Sends the interrupt to contact 3Closed
JP13Takes shutdown from contact 6Closed
JP14Takes shutdown from contact 3. Close only with INT-3 and XS-6 openOpen

Chaining

The CHAIN socket carries the same contact numbers as the input: nothing shifts. Power, contacts 4, 5 and 7 go straight across. SDA and SCL cross through closed links. Contacts 3 and 6, which this board uses, stop here until you close their links. Two boards must never drive the same contact.

Two sensor boards: controller socket G_G to I IN of the first board, and CHAIN of the first board to I IN of the second.Smoothieboard V2 Prime, socket G_GSensor A: enabled by pin 6Sensor B: enabled by pin 3
Two sensors on one port. Change the solder links on the underside as listed below before connecting.
ContactSignalOn CHAIN
1, 2, 10Power and groundSame contact, always connected
3InterruptContact 3, only if CHAIN P3 (JP3) is closed
4, 5, 7FreeSame contact, always connected
6ShutdownContact 6, only if CHAIN P6 (JP6) is closed
8, 9I2CSame contact, through closed links JP8 and JP9

Troubleshooting

SymptomLikely causeWhat to check
PWR light offNo 3.3 V, cable reversed, or JP10 openCable orientation and the +3V3 test pad
No answer at 0x29Wiring, shutdown line held low, or less than 1.2 ms since power onXSHUT test pad should read 3.3 V
Reads a short distance all the timeFilm still on the sensor, or something in its view or a window reflectingRemove the film; check the view and calibrate for the window
Short range or noisySunlight or other infrared light, dark targetShade the sensor; use the long timing budget
Two boards, one answers wronglyBoth still at 0x29Follow the two-sensor link table and release one at a time
LightPWRINT
WhereRight edge, upperRight edge, lower
Lit means3.3 V is presentThe sensor is pulling its interrupt line low
Dark meansNo 3.3 V, or its link is openThe line is high, or its link is open

Still stuck? Read how to ask for help or see the general troubleshooting guide.

Downloads

FileWhat it is
Schematic (PDF)The circuit diagram
Parts list (CSV)Every component with its value, footprint and part number where one is chosen
Board drawing (PNG)The top view used on this page

Appendix: mounting dimensions

For drilling a mounting plate or designing an enclosure. Positions are hole centres, in millimetres, measured from the top-left corner with the board seen from the component side. Leave the space above the sensor open.

Mounting drawing of the distance sensor board, component side: outline 40 by 40 millimetres with 4 mounting holes. Hole positions are listed in the table below. COMPONENT SIDE · millimetres 40 40 0, 0 X Y 1 5.00, 5.00 2 35.00, 5.00 3 5.00, 35.00 4 35.00, 35.00 Numbered rings are mounting holes. Positions are hole centres, X then Y, from the marked corner.
Board outline 40 × 40 mm, corners rounded to a 1 mm radius, board thickness 1.6 mm. Drawn from the design files, component side up, in the same orientation as the board tour.
HoleX (mm)Y (mm)DiameterUse
15.005.003.2 mm, not platedMounting, M3 screw
235.005.003.2 mm, not platedMounting, M3 screw
35.0035.003.2 mm, not platedMounting, M3 screw
435.0035.003.2 mm, not platedMounting, M3 screw

Appendix: electrical specifications

Every figure is a design value, a calculated or simulated value, or a manufacturer’s data sheet value, as the last column says. A dash means no figure is given.

ParameterApplies toLowerNominalUpperBasis
SupplyJ1 contact 12.6 V3.3 V3.5 VST data sheet
Absolute maximum, any pinSupply and signals——3.6 VST data sheet
Peak current, sensor3.3 V——40 mAST data sheet, at 2.8 V
Average while ranging3.3 V—16 mA18 mAST data sheet, at 2.8 V
Pull-up current, both lines low3.3 V—2.0 mA—Calculated
Power light currentPWR—1.3 mA—Simulated, assumed light model
Interrupt light currentINT—0.85 mA—Simulated, assumed light model
Rise time, one pull-up set, 100 pFSDA, SCL—280 ns300 nsSimulated; limit for 400 kHz
Low level, two pull-up setsSDA, SCL—0.12 V0.4 VSimulated
Operating temperature, sensorModule-20 °C—85 °CST data sheet; the board is not rated

Component stress limits

PartLimitUse on this board
Any sensor pin3.6 V maximumNever connect 5 V logic or a 5 V supply
Capacitors10 V and 16 V3.3 V

Appendix: simulation

Bus loading and indicator currents were simulated with ngspice, with 100 pF of bus capacitance.

Each simulated value (yellow mark) against its allowed range (green band). Rise time 30 to 70 %, one pull-up set, 100 pF (400 kHz limit 300 ns) 280 ns Rise time with two pull-up sets 140 ns Low level with two pull-up sets 0.12 V Power LED current (assumed diode model) 1.3 mA Interrupt LED current with GPIO1 low (assumed diode model) 0.85 mA GPIO1 low level with the LED and 10 k pull-up, 60 ohm output 70.3 mV
Simulated value (yellow) against the limit used for it (green). Each bar has its own scale.
ResultSimulated valueLimitOutcome
Rise time 30 to 70 %, one pull-up set, 100 pF (400 kHz limit 300 ns)280 nsat most 300 nsWithin
Rise time with two pull-up sets140 nsat most 300 nsWithin
Low level with two pull-up sets0.12 Vat most 400 mVWithin
Power LED current (assumed diode model)1.3 mA200 µA to 2.5 mAWithin
Interrupt LED current with GPIO1 low (assumed diode model)0.85 mA50 µA to 2 mAWithin
GPIO1 low level with the LED and 10 k pull-up, 60 ohm output70.3 mVat most 400 mVWithin

Not simulated: the sensor, its optics and range, cover windows and cable crosstalk.

Appendix: datasheet

The first page of the sensor data sheet. Click the page to open the PDF.

First page of the VL53L1X time-of-flight distance sensor, DS12385 datasheet
VL53L1X time-of-flight distance sensor, DS12385 — STMicroelectronics, 36 pages.

For a wider, sound-based measurement, see the ultrasonic distance sensor.

See all boards on the extension boards page.

This is a wiki! If you'd like to improve this page, you can edit it on GitHub.