Skip to content

Commit de3d538

Browse files
committed
Add documentation for VL53L1X
1 parent 5c01ad8 commit de3d538

File tree

5 files changed

+98
-0
lines changed

5 files changed

+98
-0
lines changed

Diff for: components/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ Distance
291291
TOF10120, components/sensor/tof10120, tof10120.jpg, IR optical distance
292292
Ultrasonic Sensor, components/sensor/ultrasonic, ultrasonic.jpg, Acoustic distance
293293
VL53L0x, components/sensor/vl53l0x, vl53l0x.jpg, IR optical distance
294+
VL53L1x, components/sensor/vl53l1x, vl53l1x.jpg, IR optical distance
294295
Zio Ultrasonic Sensor, components/sensor/zio_ultrasonic, zio_ultrasonic.jpg, Acoustic distance
295296

296297
Electricity

Diff for: components/sensor/images/vl53l1x.jpg

22.2 KB
Loading

Diff for: components/sensor/vl53l0x.rst

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ See Also
104104
--------
105105

106106
- :ref:`sensor-filters`
107+
- :doc:`vl53l1x`
107108
- :apiref:`vl53l0x/vl53l0x_sensor.h`
108109
- `vl53l0x-arduino library <https://github.com/pololu/vl53l0x-arduino/>`__ by `Pololu <https://github.com/pololu>`__
109110
- :ghedit:`Edit`

Diff for: components/sensor/vl53l1x.rst

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
VL53L1X Time Of Flight Distance Sensor
2+
======================================
3+
4+
.. seo::
5+
:description: Instructions for setting up VL53L1X distance sensors in ESPHome.
6+
:image: vl53l1x.jpg
7+
:keywords: VL53L1X
8+
9+
The ``vl53l1x`` sensor platform allows you to use VL53L1X optical time of flight
10+
(`datasheet <https://www.st.com/resource/en/datasheet/vl53l1x.pdf>`__,
11+
`ST <https://www.st.com/en/imaging-and-photonics-solutions/vl53l1x.html>`__) with ESPHome
12+
to measure distances. The sensor works optically by emitting short infrared pulses
13+
and measuring the time it takes the light to be reflected back
14+
15+
The sensor can measure distances up to 2 meters, though that figure depends significantly
16+
on several conditions like surface reflectance, field of view, temperature etc. In general
17+
you can expect surfaces up to 73cm to work, after that you need to make sure the surface is reflecting
18+
well enough (see also section 3.5 of datasheet).
19+
20+
.. figure:: images/vl53l1x.png
21+
:align: center
22+
:width: 100.0%
23+
24+
The :ref:`I²C Bus <i2c>` is required to be set up in your configuration for this sensor to work.
25+
26+
- ``VCC`` connects to 3V3 (``3V3`` will output 3.3V), or directly connect ``VCC`` to 3.3V
27+
- ``GND`` connects to ground
28+
- ``SCL`` connects I2C SCL (clock)
29+
- ``SDA`` connects I2C SDA (data)
30+
- ``GPIO1`` is not used by ESPHome
31+
- ``XSHUT`` connects to free GPIO pin. Enable/disable device. This is optional if there is only one
32+
VL53L1X sensor on the I²C bus and the default ``0x29`` address is used. Otherwise this is required.
33+
34+
.. code-block:: yaml
35+
36+
# Simple configuration entry example
37+
sensor:
38+
- platform: vl53l1x
39+
name: "VL53L1x Distance"
40+
address: 0x29
41+
update_interval: 60s
42+
distance_mode: long
43+
44+
Configuration variables:
45+
------------------------
46+
47+
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
48+
sensor. Defaults to ``60s``.
49+
- **distance_mode** (*Optional*): Set the distance mode. Long distance mode allows the longest possible ranging
50+
distance of 4 m to be reached. However, this maximum ranging distance is impacted by ambient light.
51+
Short distance mode is more immune to ambient light, but its maximum ranging distance is typically limited to
52+
1.3m. One of ``short``, ``medium``, or ``long``. Defaults to ``long``.
53+
- **address** (*Optional*, int): Manually specify the i2c address of the sensor. Defaults to ``0x29``.
54+
If an address other the ``0x29`` is specified, the sensor will be dynamically re-addressed at startup.
55+
A dynamic re-address of sensor requires the ``enable_pin`` configuration variable to be assigned.
56+
If more then one VL53L1X sensor is used on the same i2c bus, a unique address must be specified per sensor.
57+
- **enable_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The pin connected to XSHUT
58+
on vl53l1x to enable/disable sensor. **Required** if not using address ``0x29`` which is the cause if you
59+
have multiple VL53L1X on the same i2c bus. In this case you have to assign a different pin to each VL53L1X.
60+
- **timeout** (*Optional*, :ref:`config-time`): Sensor setup timeout. Default to ``10ms``.
61+
- All other options from :ref:`Sensor <config-sensor>`.
62+
63+
64+
.. code-block:: yaml
65+
66+
# Muliple VL53L1X sensors on same i2c bus
67+
# Example configuration entry
68+
sensor:
69+
- platform: vl53l1x
70+
name: "distance1"
71+
id: distance1
72+
address: 0x41
73+
enable_pin: GPIOXX
74+
timeout: 200us
75+
update_interval: 500ms
76+
unit_of_measurement: "m"
77+
78+
- platform: vl53l1x
79+
name: "distance2"
80+
id: distance2
81+
address: 0x42
82+
enable_pin: GPIOXX
83+
timeout: 200us
84+
update_interval: 500ms
85+
unit_of_measurement: "m"
86+
87+
88+
89+
See Also
90+
--------
91+
92+
- :ref:`sensor-filters`
93+
- :doc:`vl53l0x`
94+
- :apiref:`vl53l1x/vl53l1x_sensor.h`
95+
- `vl53l1x-arduino library <https://github.com/pololu/vl53l1x-arduino/>`__ by `Pololu <https://github.com/pololu>`__
96+
- :ghedit:`Edit`

Diff for: images/vl53l1x.jpg

22.2 KB
Loading

0 commit comments

Comments
 (0)