Hi
I am wondering how the results tabulated in the ADC Attenuation section is calculated.
If I use the equation as below, the max Vin with an attenuation of 11dB should be 3.9V something, but not 3.1V.
11dB = 20*log(Vin/Vref) dB
Vin = Vref * arclog(11/20) = 1100*3.548 = 3902.94mV
If we really want to get a max voltage input of 3100mV from 1100mV, the attenuation is 9dB. See results from an online calculator as follows:
John
How the max Vin of 3100mV is calculated from an attenuation of 11dB?
-
- Posts: 1734
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: How the max Vin of 3100mV is calculated from an attenuation of 11dB?
Apparently, measuring close to the nominal Vref is somewhat discouraged, probably due to measurement error increasing when approaching Vref; note how at 0db the recommended voltage range ends at 950mV instead of 1100mV. There seem to be some conservative margins included in the documentation, breaking the "mathematical relation" between the name of the constant and the recommended max. voltage.
Re: How the max Vin of 3100mV is calculated from an attenuation of 11dB?
A value as large as a 2dB gap seems too big as a measurement error. I think there is some other reasons.MicroController wrote: ↑Sun Aug 20, 2023 1:25 pmprobably due to measurement error increasing when approaching Vref
-
- Posts: 1734
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: How the max Vin of 3100mV is calculated from an attenuation of 11dB?
What I meant was, that
a) it is known that the ESP32's ADC becomes more inaccurate when Vin approaches Vref
b) "the true reference voltage can range from 1000 mV to 1200 mV among different chips."
c) The "attenuator" may have unspecified variations too
These are likely the reasons why the Vin_max value documented is probably a) after "HW and SW calibration" and b) chosen conservatively ("worst-case") low.
a) it is known that the ESP32's ADC becomes more inaccurate when Vin approaches Vref
b) "the true reference voltage can range from 1000 mV to 1200 mV among different chips."
c) The "attenuator" may have unspecified variations too
These are likely the reasons why the Vin_max value documented is probably a) after "HW and SW calibration" and b) chosen conservatively ("worst-case") low.
Re: How the max Vin of 3100mV is calculated from an attenuation of 11dB?
Voltage reference became 873mV if we apply a measured voltage of 3100mV with 11dB (see screen shot attached.) This value deviates a lot from 1000mV to 1200mV.MicroController wrote: ↑Sun Aug 20, 2023 6:02 pmb) the true reference voltage can range from 1000 mV to 1200 mV among different chips."[/url]
c) The "attenuator" may have unspecified variations too
However, when the arduino function analogRead() is used to return the raw ADC count, it returns 4095 when the applied voltage is 310xmV which is fairly accurate. What I am wondering is that, the attenuation stated at 11dB is not really 11dB.
Who is online
Users browsing this forum: axellin and 144 guests