Incorrect ADC Voltage After Calibration

ankgt11
Posts: 6
Joined: Sat May 19, 2018 11:37 am

Incorrect ADC Voltage After Calibration

Postby ankgt11 » Sat May 19, 2018 11:46 am

I have been reading and learning how to calibrate my ESP32 ADC for the last few days now. I finally seem to have done it using the following steps, but I still have a problem.

1. Route VREF to GPIO using function: adc2_vref_to_gpio
2. Measure this voltage using my multimeter (it was not too off, measured 1098 against expected 1100).
3. Set the characteristic curve using: esp_adc_cal_characterize. I am using width of 10 bits and attenuation of 6db.
4. Reading the ADC voltage using: esp_adc_cal_get_voltage.

The problem is that when the input voltage is 0 (and reading the ADC directly also confirms the ADC value is 0), the function esp_adc_cal_get_voltage returns a value of about 107mV. This seems very strange and I cannot understand why.

To crosscheck, I also manually tried getting the voltage using: esp_adc_cal_raw_to_voltage and entering 0 for the ADC value. Result is the same.

Other then this problem, the results from are usable (specially with the addition of a 0.1uF cap).

Can somebody please help!

Thanks.
Last edited by ankgt11 on Sat May 19, 2018 12:46 pm, edited 1 time in total.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Incorrect ADC Voltage After Calibration

Postby WiFive » Sat May 19, 2018 12:43 pm

Adc cannot measure below ~0.1v

ankgt11
Posts: 6
Joined: Sat May 19, 2018 11:37 am

Re: Incorrect ADC Voltage After Calibration

Postby ankgt11 » Sat May 19, 2018 12:47 pm

I understand that, but then why does the 'esp_adc_cal_raw_to_voltage' function return a voltage when the adc is reading 0?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Incorrect ADC Voltage After Calibration

Postby WiFive » Sat May 19, 2018 11:24 pm

Because the adc value will hit zero at ~0.1v so it can only tell you the voltage is ≤0.1

Archibald
Posts: 110
Joined: Mon Mar 05, 2018 12:44 am

Re: Incorrect ADC Voltage After Calibration

Postby Archibald » Sun May 20, 2018 12:43 am

If you look at the example graph under "ADC Calibration" here . . . .
http://esp-idf.readthedocs.io/en/latest ... s/adc.html
. . . . . . you will see that as the input voltage changes from zero volts to about +0.1V (not -0.1V) there is no change in the digital reading: it remains at 0000000000.

If you need to measure right down to zero volts, it is possible to use two resistors to provide a small voltage offset.

Who is online

Users browsing this forum: pubsub and 59 guests