From 0d0979823b4a300522a584cd7702f76ea2d835d6 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Saura Date: Wed, 10 Nov 2021 19:13:16 +0100 Subject: [PATCH] [ADC] Reference new "raw output" option + clarify voltage ranges (#1592) --- components/sensor/adc.rst | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/components/sensor/adc.rst b/components/sensor/adc.rst index 1123e346d..d50736681 100644 --- a/components/sensor/adc.rst +++ b/components/sensor/adc.rst @@ -30,7 +30,8 @@ Configuration variables: Or on the ESP8266 alternatively also ``VCC``, see :ref:`adc-esp8266_vcc`. - **name** (**Required**, string): The name of the voltage sensor. - **attenuation** (*Optional*): Only on ESP32. Specify the ADC - attenuation to use. See :ref:`adc-esp32_attenuation`. + attenuation to use. See :ref:`adc-esp32_attenuation`. Defaults to ``0db``. +- **raw** (*Optional*): Allows to read the raw ADC output without any conversion or calibration. Defaults to ``false``. - **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. @@ -52,23 +53,23 @@ Configuration variables: - multiply: 3.3 - .. _adc-esp32_attenuation: ESP32 Attenuation ----------------- -On the ESP32, the voltage measured with the ADC caps out at 1.1V by default as the sensing range -or the attenuation of the ADC is set to ``0db`` by default. +On the ESP32 the voltage measured with the ADC caps out at ~1.1V by default as the sensing range (attenuation of the ADC) is set to ``0db`` by default. +Measuring higher voltages requires setting ``attenuation`` to one of the following values: ``0db``, ``2.5db``, ``6db``, ``11db``. +There's more information `at the manufacturer's website `__. -To measure voltages higher than 1.1V, set ``attenuation`` to one of the `following values -`__: +To simplify this, we provide the setting ``attenuation: auto`` for an automatic/seamless transition among scales. `Our implementation +`__ combines all available ranges to allow the best resolution without having to compromise on a specific attenuation. + +.. note:: + + In our tests, the usable ADC range was from ~0.075V to ~3.12V (with the ``attenuation: auto`` setting), and anything outside that range capped out at either end. + Even though the measurements are calibrated, the range *limits* are variable among chips due to differences in the internal voltage reference. -- ``0db`` for a full-scale voltage of 1.1V (default) -- ``2.5db`` for a full-scale voltage of 1.5V -- ``6db`` for a full-scale voltage of 2.2V -- ``11db`` for a full-scale voltage of 3.9V -- ``auto`` for an automatic/seamless transition among scales .. _adc-esp8266_vcc: