1
0
mirror of https://github.com/esphome/esphome-docs.git synced 2025-03-21 15:10:05 +01:00

Add sensor support: MAX44009 ()

This commit is contained in:
Arturo Casal 2022-02-18 22:25:38 +01:00 committed by GitHub
parent 4c444c0143
commit 4d71ef93ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 131 additions and 0 deletions
components/sensor
images
index.rst

View File

@ -0,0 +1,45 @@
MAX44009 Ambient Light Sensor
=============================
.. seo::
:description: Instructions for setting up MAX44009 ambient light sensors in ESPHome.
:image: max44009.svg
:keywords: MAX44009
The ``max44009`` sensor platform allows you to use your MAX44009
(`datasheet <https://datasheets.maximintegrated.com/en/ds/MAX44009.pdf>`__)
ambient light sensor with ESPHome. This sensor features an ultra-wide 22-bit dynamic range
from 0.045 lux to 188,000 lux. The :ref:`I²C bus <i2c>` is required to be set up in your
configuration for this sensor to work.
The ``max44009`` sensor can operate in two modes: ``low_power`` (default) and ``continuous``:
- In ``low_power`` mode, the sensor measures lux intensity only once every 800ms regardless of integration time.
This mode allows the part to operate at its lowest possible supply current.
- In ``continuous`` mode, the sensor continuously measures lux intensity. That is, as soon as one reading is finished, a
new one begins. If integration time is 6.25ms, readings are taken every 6.25ms. If integration time is 800ms,
readings are taken every 800ms. In this mode, the part consumes slightly higher power than in the ``low_power``
mode.
- Additionally mode can be set to ``auto``. In this mode, the mode will be chosen according to the ``update_interval``
value. If ``update_interval < 800``, ``continuous`` mode will be selected. Otherwise, ``low_power`` mode will be selected.
Configuration variables:
------------------------
- **name** (**Required**, string): The name for the sensor.
- **address** (*Optional*, int): Manually specify the I²C address of the sensor. Defaults to ``0x4A``.
- **mode** (*Optional*, string): Measurement mode. One of ``auto``, ``low_power``, ``continuous``.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
sensor. Defaults to ``60s``.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`Sensor <config-sensor>`.
See Also
--------
- :ref:`sensor-filters`
- :doc:`bh1750`
- `MAX44009 Library <https://github.com/RobTillaart/Max44009>`__ by `@RobTillaart <https://github.com/RobTillaart>`__
- :ghedit:`Edit`

85
images/max44009.svg Normal file
View File

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="301.333"
height="61.333"
version="1.1"
id="svg10"
sodipodi:docname="max44009.svg"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs14" />
<sodipodi:namedview
id="namedview12"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="5.1371737"
inkscape:cx="150.56917"
inkscape:cy="30.658882"
inkscape:window-width="2560"
inkscape:window-height="1349"
inkscape:window-x="0"
inkscape:window-y="30"
inkscape:window-maximized="1"
inkscape:current-layer="svg10" />
<path
d="M19.333.8H282c10.31 0 18.667 8.357 18.667 18.667V40.8c0 10.31-8.358 18.667-18.667 18.667H19.333C9.024 59.467.667 51.109.667 40.8V19.467C.667 9.157 9.024.8 19.333.8z"
id="path2" />
<path
fill="none"
stroke="#000"
stroke-linecap="round"
stroke-linejoin="round"
stroke-miterlimit="10"
stroke-width="1.333"
d="M19.333.8H282c10.31 0 18.667 8.357 18.667 18.667V40.8c0 10.31-8.358 18.667-18.667 18.667H19.333C9.024 59.467.667 51.109.667 40.8V19.467C.667 9.157 9.024.8 19.333.8z"
id="path4" />
<g
aria-label="MAX44009"
id="text3495"
style="font-size:47.1878px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;stroke-width:1.1797px"
transform="translate(-0.2512635,-36.082705)">
<path
d="M 12.580587,48.99312 H 23.870638 L 31.70455,67.402814 39.584544,48.99312 H 50.851553 V 83.393211 H 42.464659 V 58.232528 l -7.926076,18.54794 h -5.621984 l -7.926076,-18.54794 v 25.160683 h -8.409936 z"
style="font-weight:bold;font-family:'Noto Sans Adlam';-inkscape-font-specification:'Noto Sans Adlam Bold';fill:#ffffff"
id="path19207" />
<path
d="M 80.413053,77.126081 H 66.54242 l -2.188887,6.26713 H 55.436698 L 68.178326,48.99312 H 78.754107 L 91.495735,83.393211 H 82.5789 Z M 68.754348,70.743747 h 9.423736 L 73.477737,57.057441 Z"
style="font-weight:bold;font-family:'Noto Sans Adlam';-inkscape-font-specification:'Noto Sans Adlam Bold';fill:#ffffff"
id="path19209" />
<path
d="m 115.22788,65.836031 11.9352,17.55718 h -9.23941 l -8.04128,-11.750868 -7.97216,11.750868 H 92.62474 L 104.55994,65.836031 93.085558,48.99312 h 9.262452 l 7.53438,11.082682 7.51134,-11.082682 h 9.30853 z"
style="font-weight:bold;font-family:'Noto Sans Adlam';-inkscape-font-specification:'Noto Sans Adlam Bold';fill:#ffffff"
id="path19211" />
<path
d="m 145.4806,56.297091 -9.72326,14.400574 h 9.72326 z m -1.47462,-7.303971 h 9.86152 v 21.704545 h 4.90771 v 6.428416 h -4.90771 v 6.26713 h -8.3869 v -6.26713 h -15.25308 v -7.603503 z"
style="font-weight:bold;font-family:'Noto Sans Adlam';-inkscape-font-specification:'Noto Sans Adlam Bold';fill:#ffffff"
id="path19213" />
<path
d="m 178.31392,56.297091 -9.72327,14.400574 h 9.72327 z M 176.8393,48.99312 h 9.86151 v 21.704545 h 4.90772 v 6.428416 h -4.90772 v 6.26713 h -8.38689 v -6.26713 h -15.25309 v -7.603503 z"
style="font-weight:bold;font-family:'Noto Sans Adlam';-inkscape-font-specification:'Noto Sans Adlam Bold';fill:#ffffff"
id="path19215" />
<path
d="m 215.47892,66.158604 q 0,-6.451457 -1.22117,-9.078122 -1.19812,-2.649705 -4.0552,-2.649705 -2.85707,0 -4.07824,2.649705 -1.22117,2.626665 -1.22117,9.078122 0,6.52058 1.22117,9.193327 1.22117,2.672746 4.07824,2.672746 2.83403,0 4.0552,-2.672746 1.22117,-2.672747 1.22117,-9.193327 z m 8.87076,0.06912 q 0,8.548181 -3.68655,13.202446 -3.68655,4.631225 -10.46058,4.631225 -6.79707,0 -10.48362,-4.631225 -3.68654,-4.654265 -3.68654,-13.202446 0,-8.571222 3.68654,-13.202446 3.68655,-4.654266 10.48362,-4.654266 6.77403,0 10.46058,4.654266 3.68655,4.631224 3.68655,13.202446 z"
style="font-weight:bold;font-family:'Noto Sans Adlam';-inkscape-font-specification:'Noto Sans Adlam Bold';fill:#ffffff"
id="path19217" />
<path
d="m 248.31224,66.158604 q 0,-6.451457 -1.22117,-9.078122 -1.19813,-2.649705 -4.05521,-2.649705 -2.85707,0 -4.07824,2.649705 -1.22117,2.626665 -1.22117,9.078122 0,6.52058 1.22117,9.193327 1.22117,2.672746 4.07824,2.672746 2.83404,0 4.05521,-2.672746 1.22117,-2.672747 1.22117,-9.193327 z m 8.87075,0.06912 q 0,8.548181 -3.68655,13.202446 -3.68655,4.631225 -10.46058,4.631225 -6.79707,0 -10.48361,-4.631225 -3.68655,-4.654265 -3.68655,-13.202446 0,-8.571222 3.68655,-13.202446 3.68654,-4.654266 10.48361,-4.654266 6.77403,0 10.46058,4.654266 3.68655,4.631224 3.68655,13.202446 z"
style="font-weight:bold;font-family:'Noto Sans Adlam';-inkscape-font-specification:'Noto Sans Adlam Bold';fill:#ffffff"
id="path19219" />
<path
d="m 264.16438,82.632861 v -6.359293 q 2.11976,0.990759 4.0552,1.497659 1.93543,0.48386 3.82479,0.48386 3.96304,0 6.17497,-2.188888 2.21192,-2.211928 2.60362,-6.543621 -1.56678,1.152046 -3.34093,1.728069 -1.77415,0.576023 -3.84784,0.576023 -5.27637,0 -8.52514,-3.064442 -3.22573,-3.087483 -3.22573,-8.110403 0,-5.552862 3.59439,-8.893795 3.61742,-3.340933 9.67718,-3.340933 6.72795,0 10.4145,4.539061 3.68655,4.539061 3.68655,12.833792 0,8.525139 -4.30866,13.409814 -4.30865,4.861634 -11.81999,4.861634 -2.41929,0 -4.63122,-0.368655 -2.21193,-0.345613 -4.33169,-1.059882 z m 10.94443,-16.56642 q 2.32714,0 3.50222,-1.49766 1.17509,-1.520701 1.17509,-4.539061 0,-2.99532 -1.17509,-4.51602 -1.17508,-1.520701 -3.50222,-1.520701 -2.32713,0 -3.50222,1.520701 -1.17508,1.5207 -1.17508,4.51602 0,3.01836 1.17508,4.539061 1.17509,1.49766 3.50222,1.49766 z"
style="font-weight:bold;font-family:'Noto Sans Adlam';-inkscape-font-specification:'Noto Sans Adlam Bold';fill:#ffffff"
id="path19221" />
</g>
</svg>

After

(image error) Size: 6.0 KiB

View File

@ -319,6 +319,7 @@ Light
APDS9960, components/sensor/apds9960, apds9960.jpg, Colour & Gesture
BH1750, components/sensor/bh1750, bh1750.jpg, Lux
LTR390, components/sensor/ltr390, ltr390.jpg, Lux & UV
MAX44009, components/sensor/max44009, max44009.svg, Lux
TCS34725, components/sensor/tcs34725, tcs34725.jpg, Lux & RGB colour
TSL2561, components/sensor/tsl2561, tsl2561.jpg, Lux
TSL2591, components/sensor/tsl2591, tsl2591.jpg, Lux