Most of (maybe all?) the microprocessors supported by ESPHome support analogue inputs:
- ESP8266 : Only GPIO17 (A0) can be used for ADC input. You can also measure VCC voltage directly by setting
pin: VCC, useful for low-voltage detection in battery-powered setups. - ESP32 : Multiple pins support ADC (e.g., GPIO32–GPIO39 for ADC1, GPIO0, GPIO2, GPIO4, etc. for ADC2). Use
attenuationto measure voltages above 1.1V (e.g.,12dBfor up to ~3.9V). - RP2040 (Raspberry Pi Pico) : GPIO26–GPIO29 are available. You can also measure VSYS via
pin: VCC(GPIO29), though it may interfere with WiFi on Pico W. - nRF52840 : Supports AIN0–AIN7, VDD, and VDDHDIV5.
(The above from AI so double-check).
What kind of sensor do you want to use?