Skip to content

Commit 1bd00d2

Browse files
committed
[tfluna] New component for the TF-Luna Low Cost LiDAR Distance Sensor
1 parent e3335db commit 1bd00d2

File tree

4 files changed

+125
-0
lines changed

4 files changed

+125
-0
lines changed

components/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ Distance
302302
HRXL MaxSonar WR, components/sensor/hrxl_maxsonar_wr, hrxl_maxsonar_wr.jpg, Acoustic distance
303303
JSN-SR04T, components/sensor/jsn_sr04t, jsn-sr04t-v3.jpg, Acoustic distance
304304
TOF10120, components/sensor/tof10120, tof10120.jpg, IR optical distance
305+
TF-Luna, components/sensor/tfluna, tfluna.jpg, IR optical distance
305306
Ultrasonic Sensor, components/sensor/ultrasonic, ultrasonic.jpg, Acoustic distance
306307
VL53L0x, components/sensor/vl53l0x, vl53l0x.jpg, IR optical distance
307308
Zio Ultrasonic Sensor, components/sensor/zio_ultrasonic, zio_ultrasonic.jpg, Acoustic distance

components/sensor/images/tfluna.jpg

21.1 KB
Loading

components/sensor/tfluna.rst

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
TF-Luna LiDAR Distance Sensor
2+
=======================================
3+
4+
.. seo::
5+
:description: Instructions for setting up TF-Luna distance sensors in ESPHome.
6+
:image: tfluna.jpg
7+
:keywords: tfluna
8+
9+
Component/Hub
10+
-------------
11+
.. _tfluna-component:
12+
13+
The ``tfluna`` sensor platform allows you to use TF-Luna distance sensor (`datasheet <https://files.waveshare.com/upload/a/ac/SJ-PM-TF-Luna_A05_Product_Manual.pdf>`__)
14+
with ESPHome to measure distances. The sensor works optically by emitting short infrared pulses
15+
and measuring the time it takes the light to be reflected back.
16+
17+
The sensor can measure distances in range 20-800 centimeters, though that figure depends significantly
18+
on several conditions like surface reflectance, field of view, temperature etc. .
19+
20+
The :ref:`I²C Bus <i2c>` is
21+
required to be set up in your configuration for this sensor to work.
22+
23+
.. figure:: images/tfluna.jpg
24+
:align: center
25+
:width: 50.0%
26+
27+
TF-Luna Time Of Flight Distance Sensor.
28+
29+
.. code-block:: yaml
30+
31+
# Example configuration entry
32+
tfluna:
33+
34+
Configuration variables:
35+
------------------------
36+
37+
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
38+
sensor. Defaults to ``60s``.
39+
- **address** (*Optional*, int): Manually specify the I^2C address of the sensor. Defaults to ``0x10``.
40+
- All other options from :ref:`Sensor <config-sensor>`.
41+
42+
Sensor
43+
------
44+
45+
The ``tfluna`` sensor allows you to use your :doc:`tfluna` to perform different
46+
measurements.
47+
48+
.. code-block:: yaml
49+
50+
sensor:
51+
- platform: tfluna
52+
distance:
53+
name: Distance
54+
signal_strength:
55+
name: Signal Strength
56+
temperature:
57+
name: TF-Luna Temperature
58+
timestamp:
59+
name: TF-Luna Timestamp
60+
61+
.. _tfluna-sensors:
62+
63+
Configuration variables:
64+
************************
65+
66+
- **distance** (*Optional*, int): Distance in cm.
67+
All options from :ref:`Sensor <config-sensor>`.
68+
- **signal_strength** (*Optional*, int): Signal strength. If lower than 100, the range value is considered not reliable. If over 30000, there is an ambient light overexposure, for instance, when the sensor faces the sun outside.
69+
All options from :ref:`Sensor <config-sensor>`.
70+
- **temperature** (*Optional*, float): Sensor temperature in degrees Celsius.
71+
All options from :ref:`Sensor <config-sensor>`.
72+
- **timestamp** (*Optional*, float): Timestamp indicating milliseconds since the TF-Luna booted.
73+
All options from :ref:`Sensor <config-sensor>`.
74+
- **tfluna_id** (*Optional*, :ref:`config-id`): Manually specify the ID for the :doc:`tfluna` component if you are using multiple components.
75+
76+
Button
77+
------
78+
79+
The ``tfluna`` button allows you to perform actions on your :doc:`tfluna`.
80+
81+
.. code-block:: yaml
82+
83+
button:
84+
- platform: tfluna
85+
factory_reset:
86+
name: "factory reset"
87+
restart:
88+
name: "restart"
89+
90+
Configuration variables:
91+
************************
92+
93+
- **factory_reset** (*Optional*): This command is used to restore all configuration values to their original values.
94+
All options from :ref:`Button <config-button>`.
95+
- **restart** (*Optional*): Restart the device.
96+
All options from :ref:`Button <config-button>`.
97+
- **tfluna_id** (*Optional*, :ref:`config-id`): Manually specify the ID for the :doc:`tfluna` component if you are using multiple components.
98+
99+
Text Sensor
100+
-----------
101+
102+
The ``tfluna`` text sensor allows you to get information about your :doc:`tfluna`.
103+
104+
.. code-block:: yaml
105+
106+
text_sensor:
107+
- platform: tfluna
108+
version:
109+
name: "firmware version"
110+
111+
Configuration variables:
112+
************************
113+
114+
- **version** (*Optional*): The firmware version.
115+
All options from :ref:`Text Sensor <config-text_sensor>`.
116+
- **tfluna_id** (*Optional*, :ref:`config-id`): Manually specify the ID for the :doc:`tfluna` component if you are using multiple components.
117+
118+
See Also
119+
--------
120+
121+
- :ref:`sensor-filters`
122+
- :apiref:`tfluna/tfluna.h`
123+
- :ghedit:`Edit`
124+

images/tfluna.jpg

3.73 KB
Loading

0 commit comments

Comments
 (0)