ADC Battery Voltage reading on DFRobot Firebeetle

I have a DFRobot Firebeetle V3.0 ESP32 board.
The board comes with a battery power option and ability to measure battery voltage.
From the board schematic:
image

When I setup ADC on A0 with 2x multiplier I get wildly fluctuating values.
Anywhere from 0.28V to 2V.
I’ve read that ESP32 ADCs are not the greatest, but I think I’m just getting garbage readings…
YAML code:

sensor:
  - platform: adc
    pin: A0  # Analog input pin (GPIO 36/ A0)
    name: "Battery Voltage"
    id: battery_voltage
    accuracy_decimals: 2
    update_interval: 120s
    attenuation: 12db  # Allows reading up to ~3.9V
    samples: 1
    filters:
      - multiply: 2.0  # Adjust based on your voltage divider ratio
    on_value:
      then:
        - lambda: |-
            ESP_LOGW("adc_sensor", "Voltage is %.2f V", id(battery_voltage).state);

pin: GPIO36
would be better choice

That change did not seem to make a difference. Still getting erratic readings.

seems to indicate others have faced the same problem with no solution.

it seems the firebettle 2 might be a better choice.

it will take some HW debugging skills to get a better answer

you should set samples to at least 10, but I doubt it help much with what you and others have said

Think I found a solution…
The 1M-ohm resistors are too high.
I’m guessing the are high to reduce the battery current draw as much as possible but this leads to ADC problems.
Replaced the 1M with 100K-ohm and all is good now.
Getting accurate readings.
I’m guessing there is some way to calculate the optimal resistor value based on capacitance of ADC circuit, etc…