Unexpected ADC offset in ESP32

ramon82
Posts: 4
Joined: Thu Jul 04, 2019 2:12 pm

Unexpected ADC offset in ESP32

Postby ramon82 » Thu Mar 12, 2020 9:21 am

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.

username
Posts: 536
Joined: Thu May 03, 2018 1:18 pm

Re: Unexpected ADC offset in ESP32

Postby username » Thu Mar 12, 2020 7:57 pm

"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

ramon82
Posts: 4
Joined: Thu Jul 04, 2019 2:12 pm

Re: Unexpected ADC offset in ESP32

Postby ramon82 » Wed Mar 18, 2020 6:20 pm

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.

Who is online

Users browsing this forum: No registered users and 84 guests