ESP32 ADC Calibration curves?

brown_x
Posts: 12
Joined: Wed Mar 08, 2017 11:07 am

Re: ESP32 ADC Calibration curves?

Postby brown_x » Wed Dec 06, 2017 10:49 am

Any update on this?

cmorgan
Posts: 89
Joined: Thu Aug 24, 2017 12:52 am

Re: ESP32 ADC Calibration curves?

Postby cmorgan » Sat Dec 30, 2017 7:40 pm

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.

ESP_Dazz
Posts: 308
Joined: Fri Jun 02, 2017 6:50 am

Re: ESP32 ADC Calibration curves?

Postby ESP_Dazz » Sun Dec 31, 2017 11:06 am

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.

brown_x
Posts: 12
Joined: Wed Mar 08, 2017 11:07 am

Re: ESP32 ADC Calibration curves?

Postby brown_x » Thu Jan 04, 2018 12:33 pm

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?

flodis
Posts: 13
Joined: Mon Feb 26, 2018 5:09 am

Re: ESP32 ADC Calibration curves?

Postby flodis » Thu Nov 22, 2018 1:16 am

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 15360 times

flodis
Posts: 13
Joined: Mon Feb 26, 2018 5:09 am

Re: ESP32 ADC Calibration curves?

Postby flodis » Thu Nov 22, 2018 1:24 am

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 15359 times

flodis
Posts: 13
Joined: Mon Feb 26, 2018 5:09 am

Re: ESP32 ADC Calibration curves?

Postby flodis » Thu Nov 22, 2018 1:59 am

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 15356 times
Reading a linear sweep 0..3.4 V with a 0.5X voltage divider usiing 12-bit ADC, Range 3.

User avatar
HelWeb
Posts: 36
Joined: Sat Mar 23, 2019 8:39 am

Re: ESP32 ADC Calibration curves?

Postby HelWeb » Sat Aug 10, 2019 8:06 pm

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
Fast is not fast enough :D

ozkaraha
Posts: 1
Joined: Mon Dec 19, 2022 3:08 am

Re: ESP32 ADC Calibration curves?

Postby ozkaraha » Mon Dec 19, 2022 3:18 am

I don't think it helps with the lower-end dead offset between 0-70 mV, does it?

Who is online

Users browsing this forum: No registered users and 55 guests