TCS34725 automatic integration times (#1951)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
swifty99 2022-05-12 06:53:37 +02:00 committed by GitHub
parent dbddc09b34
commit 306f5f55e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,9 +60,10 @@ Configuration variables:
- **illuminance** (*Optional*): Get the total illuminance of the sensor in lx.
- **color_temperature** (*Optional*): Get the calculated color temperature of the light in Kelvin.
- **gain** (*Optional*): Set the gain for the internal ADCs to work better in certain low-light conditions. Valid
values are ``1x`` (default), ``4x``, ``16x``, ``60x`` (highest gain).
values are ``1x`` (default), ``4x``, ``16x``, ``60x`` (highest gain). Will be overwritten if auto integration time
is used
- **integration_time** (*Optional*): The amount of time the light sensor is exposed. Valid values are
``2.4ms`` (default), ``24ms``, ``50ms``, ``101ms``, ``120ms``, ``154ms``, ``180ms``, ``199ms``,
``auto`` (default), ``2.4ms``, ``24ms``, ``50ms``, ``101ms``, ``120ms``, ``154ms``, ``180ms``, ``199ms``,
``240ms``, ``300ms``, ``360ms``, ``401ms``, ``420ms``, ``480ms``, ``499ms``, ``540ms``, ``600ms``, ``614ms``.
- **glass_attenuation_factor** (*Optional*): The attenuation factor of glass if it's behind some glass facia.
Default is ``1.0`` means ``100%`` transmissivity. ``2`` means ``50%`` transmissivity etc.
@ -70,6 +71,23 @@ Configuration variables:
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
sensor. Defaults to ``60s``.
For many applications, you can use AUTO timing or leave integration time empty to have the ESP select a suitable gain
setting based on the previous measurement. If light levels change dramatically this may cause the next reading to saturate,
after which the gain will adjust down and subsequent readings will be in range.
If auto is used in a dynamic environment an update rate of 1 second is best. Filters can be used to throttle the output and
prevent updates of marginal changes like:
.. code-block:: yaml
illuminance:
name: "TCS34725 Illuminance"
filters:
- or:
- delta: 50
- throttle: 60sec
When using integration times lower than 154ms the accuracy of the sensor drops with no further gain in possible light
accumulation. Use faster timings only if fast readout is necessary with stable light conditions recommended.
See Also
--------