Use Continuous Read Mode for ADC #3294
Unanswered
SodaWithoutSparkles
asked this question in
Component enhancements
Replies: 1 comment
-
🏷️ I've automatically added the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Component name
adc
Link to component documentation on our website
https://esphome.io/components/sensor/adc/
Describe the enhancement
The ADC component only works by doing one-shot reads as shown here:
https://github.com/esphome/esphome/blob/12ba4b142e8dd2950e9406de2f8d378631772688/esphome/components/adc/adc_sensor.h#L9-L14
and here:
https://github.com/esphome/esphome/blob/12ba4b142e8dd2950e9406de2f8d378631772688/esphome/components/adc/adc_sensor_esp32.cpp#L146-L169
It is inefficient to keep calling one-shot reads again and again, especially when the attenuation is known, or we are sampling very frequently (>= 1 sample / second)
Use cases
This would make Analog Threshold Binary Sensor responds more quickly, and be more efficient.
For example, a resistor divider network can aggregate multiple 5V pins into 1 adc sensor.
Table of possible voltages
Anything else?
https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/peripherals/adc_continuous.html
Beta Was this translation helpful? Give feedback.
All reactions