Page 1 of 1

ESP32C6 ADC not working properly

Posted: Wed Apr 05, 2023 11:02 pm
by rafael.04694
Sorry in advance in case this post is repeated.

I'm trying to read voltages using the ESP ADC, but something weird happens.

I'm using the one shot example from ESP-IDF.

When the pin with the used channel is connected to 3.3V it returns a raw reading of 4081, giving me a V = 4081 * 3V3 / 4095 = 2.28 V which is pretty good. However, when I connect the pin to GND, the raw value is 2144, which gives me something like 1.7V.

I'm using the new C6, and I know its calibration is still not available, but shouldn't the method I'm using work? Considering it works for 3V3?

(The code is the one bellow, with an addition of a printf that prints the voltage using the formula above).

Code: https://github.com/espressif/esp-idf/bl ... ead_main.c

Re: ESP32C6 ADC not working properly

Posted: Fri Apr 07, 2023 12:48 am
by ESP_Sprite
Wondering if it is because you're witching between two channels all the time. Does it still does that if you only measure one channel?

Re: ESP32C6 ADC not working properly

Posted: Mon Aug 28, 2023 4:40 pm
by aenapple
I have the same issue - higher bit from 12-bits ADC value always is '1'.

Re: ESP32C6 ADC not working properly

Posted: Wed Aug 30, 2023 9:39 am
by rkit2134
I have the same problem. Adc always reads exactly 4081.

Re: ESP32C6 ADC not working properly

Posted: Tue Feb 27, 2024 11:58 pm
by lhns_esp
Hello! I am experiencing the same issue.
If I connect the pin to GND I get the following ADC output: 0b0000100001110001
If I connect it to 3.3V I get: 0b0000111111110001
Is this a hardware bug?

Re: ESP32C6 ADC not working properly

Posted: Wed Mar 06, 2024 12:44 am
by phemmer
I'm getting the same thing on 2x ESP32-C6-DevKitM-1, and also on a ESP32-H2-DevKitM-1. To get the same thing on H2 and C6, I'm dubious of a hardware bug.

For me I'm working in rust. And this is my first time working with ESP32 units, so I'm inclined to think I'm doing something wrong. However I've basically got the same code as in the example on https://docs.rs/esp32c6-hal/latest/esp3 ... index.html. So I can't see how it would be a software issue either. Unless there's some prerequisites that I've missed.

Also, to note, I do get a signal. When the input voltage changes, so does the value read. But it's nowhere near what it's supposed to be. When pulled to ground, I get ~2144 (bounces around a bit), and when floating it goes to 4081. When I have an input voltage of 0.307v and 0dB attenuation, I should read a value of about 1571, but instead get 3297.

Re: ESP32C6 ADC not working properly

Posted: Fri May 24, 2024 10:56 am
by bjozwicki
Same problem here one year later, any update on that? Surprisingly I have tested oneshot read from Arduino and it worked fine...

Re: ESP32C6 ADC not working properly

Posted: Fri Jun 07, 2024 1:42 pm
by yeohwaisiang
still no one can resolved the ADC-4081 issue?
where are their engineers?