Between every publish, I sample a voltage on AN0 using an FC10 ADC component.
I return the sampled voltage and aim to get as close to the actual voltage as possible.
However, I have never needed to use the ADC before, and now I am confused about the settings.
I am using a voltage divider with 390K and 110K resistors.
The expected input voltage could be as high as 5V, but the ESP32 C3 reference voltage is approximately 1.1V:
Now I need to configure the FC ADC component:Per design the ESP32-C3 ADC reference voltage is 1100 mV, however the true reference voltage can range from 1000 mV to 1200 mV among different chips. To minimize this difference, hardware calibration is introduced.
- Vref Voltage is set to 500 (5V).
- Vref option is set to 950 mV (changing this doesn't affect the output).
I need to multiply the measured value by 2.81 to get an accurate reading (compared to my multimeter).
Is this a reasonable value, or am I overlooking something?
The voltage divider is chosen so that the maximum voltage never exceeds the 1.1V reference voltage.
Could someone please help me understand what might be going wrong?