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
ESP32C6 ADC not working properly
-
- Posts: 9772
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32C6 ADC not working properly
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
I have the same issue - higher bit from 12-bits ADC value always is '1'.
Re: ESP32C6 ADC not working properly
I have the same problem. Adc always reads exactly 4081.
Re: ESP32C6 ADC not working properly
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?
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
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.
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
Same problem here one year later, any update on that? Surprisingly I have tested oneshot read from Arduino and it worked fine...
-
- Posts: 2
- Joined: Fri Jun 07, 2024 1:34 pm
Re: ESP32C6 ADC not working properly
still no one can resolved the ADC-4081 issue?
where are their engineers?
where are their engineers?
Who is online
Users browsing this forum: No registered users and 87 guests