ESP32c3 ADC channels

FastBoatUS1
Posts: 2
Joined: Fri Feb 03, 2023 3:37 pm

ESP32c3 ADC channels

Postby FastBoatUS1 » Fri Feb 03, 2023 4:08 pm

My design has analog input channels on IO0 and IO1 and a ESP32-C3-MINI-1-N4 module on it.
I have configured the channels with :
ESP_ERROR_CHECK(adc1_config_width(ADC_WIDTH_BIT_DEFAULT));
ESP_ERROR_CHECK(adc1_config_channel_atten(ADC1_CHANNEL_0, ADC_ATTEN_DB_6));
ESP_ERROR_CHECK(adc1_config_channel_atten(ADC1_CHANNEL_1, ADC_ATTEN_DB_6));
IO0 has 1.6 volts on it, IO1 has 1.5 volts (precision external vRef) on it.
When I read the channels using adc1_get_raw(ADC1_CHANNEL_0); and adc1_get_raw(ADC1_CHANNEL_1);
Channel 0 returns a count of 20 (equals 8.5 mVolt)-Incorrect
Channel 1 returns a value of 3455 = (equals 1.69V) - Correct (within range of adc1's capabilities) and is used to determine scale factor
Whatever input I give channel 0, from 1.6 to 1.2 in my case, I get a reading of 20-24.

Has anyone had this issue (or success) reading channel 0 data with the esp32c3 device?
Thanks!

Jiv_au
Posts: 3
Joined: Sat Apr 04, 2026 5:18 am

Re: ESP32c3 ADC channels

Postby Jiv_au » Sat Apr 04, 2026 5:55 am

I seem to have similar issues on my two ESP32 C3.

They exhibit the same problem even though they are from different factories, so I am wondering if the problem may be library related.

On my ESP32 C3 ADC1 Channel 2 (GPIO 2) the reading is much higher than expected.

To test, I built the example code from v6.0\esp-idf\examples\peripherals\adc\oneshot_read to test. Example code already uses ADC1 Channel 2 and Channel 3, so I ran it without changing code.
Log from running idf.py monitor:

Code: Select all

I (14279) EXAMPLE: ADC1 Channel[2] Raw Data: 4095
I (14279) EXAMPLE: ADC1 Channel[2] Cali Voltage: 2897 mV
I (15279) EXAMPLE: ADC1 Channel[3] Raw Data: 2268
I (15279) EXAMPLE: ADC1 Channel[3] Cali Voltage: 1655 mV
I have two 10K ohm resistors in series across the 3.3v and GND pin, and connect the midpoint of the series to Channel 2 pin. I also setup another two 10K ohm resistors in the same way and connect the midpoint to Channel 3 pin.
Midpoint should be measuring about 1650mv and Channel3 shows the correct reading. But Channel 2 is too high (almost double).

Now I change one of the 10K resistor in each of the series to 1.8K, and expecting a reading of 595mV.

Code: Select all

I (5279) EXAMPLE: ADC1 Channel[3] Raw Data: 796
I (5279) EXAMPLE: ADC1 Channel[3] Cali Voltage: 589 mV
I (6279) EXAMPLE: ADC1 Channel[2] Raw Data: 1037
I (6279) EXAMPLE: ADC1 Channel[3] Cali Voltage: 764 mV
Again, Channel 3 reads correctly, but Channel 2 is too high.

Who is online

Users browsing this forum: trendictionbot and 4 guests