ESP32 ADC measurment with variable input voltage?

Another thing to be aware off... any toggling line will cause noise. It is also recommended to set an interrupt and get the CPU to wait until the ADC is finished.