ADC reference docs attenuation possibly wrong
Posted: Tue Mar 30, 2021 6:15 pm
Hi there, I wanted to post this potential issue here because it's caused me a bit of confusion over the past few hours.
I've been referencing https://docs.espressif.com/projects/esp ... dc_atten_t for setting up some ADC readings on ADC1, channel 0 and 7.
The problem I faced is likely just an error on the documentation site, or possibly user error, but basically I was using DC_ATTEN_DB_0 to set the scale to 0-800mV as suggested in the docs: https://docs.espressif.com/projects/esp ... ATTEN_DB_0 but my output voltage calculated with: returns ~0.46V which is wrong. My actual reading voltage (as calculated by hand and confirmed with a multimeter) is 0.63V. When I used ADC_ATTEN_DB_0 but changed the 0.8 to 1.1 in my code, it returns the correct 0.63V.
TLDR: I think the voltage range stated in the esp32 docs for ADC_ATTEN_DB_0 should be 0-1100mV not 0-800mV.
If I'm wrong I would love an explanation of what I misread. Thank you!
I've been referencing https://docs.espressif.com/projects/esp ... dc_atten_t for setting up some ADC readings on ADC1, channel 0 and 7.
The problem I faced is likely just an error on the documentation site, or possibly user error, but basically I was using DC_ATTEN_DB_0 to set the scale to 0-800mV as suggested in the docs: https://docs.espressif.com/projects/esp ... ATTEN_DB_0 but my output voltage calculated with:
Code: Select all
float adpV = float(adpRaw)*(0.8/4095.0);
TLDR: I think the voltage range stated in the esp32 docs for ADC_ATTEN_DB_0 should be 0-1100mV not 0-800mV.
If I'm wrong I would love an explanation of what I misread. Thank you!