Page 1 of 1

Unexpected ADC offset in ESP32

Posted: Thu Mar 12, 2020 9:21 am
by ramon82
Hi,

I have detected an unexpected offset when measuring values with the adc in the module huzzah32 (esp32).

For example, when trying the get the battery value:
- 3781 mV acquired in the ESP32
- 4113 mV measured with the multimeter.

I am taking 3300 mV as reference (VREF) for adc conversions. 12 bit (4095 adc steps).

Being calculaed as follows:
voltage = value * (VREF / ADC_STEPS);

The same happened when using a TMP36 sensor for acquiring temperature values.

TMP36 -> pin 39 (A3 - ADC1)
VBAT/2 -> pin 35 (A13)

Any of you have experienced anything similar?

Regards, Ramon.

Re: Unexpected ADC offset in ESP32

Posted: Thu Mar 12, 2020 7:57 pm
by username
"The ADC should be configured before reading is taken." as per the docs, has this been done in your code ?
https://espressif-docs.readthedocs-host ... eading-adc

Re: Unexpected ADC offset in ESP32

Posted: Wed Mar 18, 2020 6:20 pm
by ramon82
Hi,

I am using Arduino IDE. The configuration is done out of my scope, but I am assuming full scale 12 bits and 3,3V and no attenuation.

I have tested at 3 points so as to double check:

Vadc_real: 0V -> measured: 0
Vadc_real: 1,78V (through resistor divider) -> measured: 0d1990 (1,60 V)
Vadc_real: 3,3V -> measured: 0d4095 (3,3V)

As you can see there are -180mV offset/linearity error.

Any suggestion will be welcome.

Regards, Ramon.