Page 2 of 2

Re: ESP32 ADC Calibration curves?

Posted: Wed Dec 06, 2017 10:49 am
by brown_x
Any update on this?

Re: ESP32 ADC Calibration curves?

Posted: Sat Dec 30, 2017 7:40 pm
by cmorgan
I'm also interested in an update. I have both a NTC thermistor and an analog thermistor. I'm afraid to use the internal ADC going forward but would prefer to use the internal ADC vs. adding a $1+ ADC to the board.

Re: ESP32 ADC Calibration curves?

Posted: Sun Dec 31, 2017 11:06 am
by ESP_Dazz
Please take a look at the following link
https://esp-idf.readthedocs.io/en/lates ... alibration
Calibration for 11db attenuation is not very good as 11db attenuation does not have a linear response. Adding a 0.1uf capacitor can also help with the noise.

Re: ESP32 ADC Calibration curves?

Posted: Thu Jan 04, 2018 12:33 pm
by brown_x
As far as I understand:
1. we have to route the vref to a gpio internally
2. measure it manually
3. save that value somewhere and replace the #define V_REF 1100 with the saved value

This is kinda produces unexpected steps in factory process and it is bad too since we already used all the GPIO's, connecting a reference to electronic circuits might bias the measuring and also produce unexpected behavior ... Doing it before is soldered is also a pain ...

ESP_Sprite said this process might happen for any new module in ESP factory - is the date known from which any new ESP32 bought will have this value measured, stored in EFuses to not be bugged with this additional step?

Re: ESP32 ADC Calibration curves?

Posted: Thu Nov 22, 2018 1:16 am
by flodis
High offset levels needs fixing.

The high offset levels of the ADC makes it difficult to read lower voltages. As the ADC lowest range starts from zero at appr 70-100 mV you need external signal conditioning to lift the signal into "view".

Also noticed the ADC 12-bit, Range 3 is exremely unlinear. See image..

The light blue line is an RC filtered 12-bit 3.4V PWM to DC voltage and ADC values are averaged from 100 readings at each point.
ADC_Sweep_2018-11-21_162935.png
ADC_Sweep_2018-11-21_162935.png (84.63 KiB) Viewed 13201 times

Re: ESP32 ADC Calibration curves?

Posted: Thu Nov 22, 2018 1:24 am
by flodis
A closer look at the large ADC offsets

About the offset you can see the PWM to DC signal has the ouput at 150 ticks before the ADC Range=3 reading bcomes > 0.

A closer look:
ADC_Sweep_2018-11-21_215115.png
ADC_Sweep_2018-11-21_215115.png (63.11 KiB) Viewed 13200 times

Re: ESP32 ADC Calibration curves?

Posted: Thu Nov 22, 2018 1:59 am
by flodis
To show the PWM is not unlinear a 0.5X voltage divider using 220k resistors feeding the ADC input. As seen the lower half scale in Range 3 is pretty straight.

And this is also serves as a demonstration of the 12-bit ADC used for 6.4V full scale input, where the ADC does not producing readings >0 until >0.12 volts.
ADC_Sweep_2018-11-22_024128.png
ADC_Sweep_2018-11-22_024128.png (49.8 KiB) Viewed 13197 times
Reading a linear sweep 0..3.4 V with a 0.5X voltage divider usiing 12-bit ADC, Range 3.

Re: ESP32 ADC Calibration curves?

Posted: Sat Aug 10, 2019 8:06 pm
by HelWeb
Maybe you may want to test:

esp32.com/viewtopic.php?f=19&t=2881&start=30

Posted: Sat Aug 10, 2019 12:30 pm

You may calibrate your own ESP32( the nonlinear 11DB curve) with this program.<br>
All you need is a wire from pin 25 to pin 35 and a normal voltmeter.<br>

Calibration is done automatically.<br>
It produces a LookUpTable[4096] to correct your values like: <br>
CalibratedValue = LookUpTable[Read Value];<br>

I do NOT use a fitted curve but a real LookUpTable with 4096 values !

I get correct values +/- 0.01V compared to the voltmeter. :D

Re: ESP32 ADC Calibration curves?

Posted: Mon Dec 19, 2022 3:18 am
by ozkaraha
I don't think it helps with the lower-end dead offset between 0-70 mV, does it?