ESP32 DevKit C V4 - ADC - Pull Up?

Ronnie Eriksson
Posts: 1
Joined: Wed Feb 28, 2024 2:39 pm

ESP32 DevKit C V4 - ADC - Pull Up?

Postby Ronnie Eriksson » Thu Feb 29, 2024 9:24 am

Hi everyone,

I'm haveing this issue - My ADC inputs seems to have a pullup at ADC inputs at my ESP32 DevKit C V4 and I'd like the them float.

I've tested ADC1_0 and ADC2_6 both inputs gives me a currentreading of 0.5 mA with a DMM set to a range of 2mA. Measuring the voltage I get 3.7 VDC. I've searched internet and it seems like this is what many users would like. Me I'm thinking of connecting a relatively high impedance sorce to the ADC input, and there fore a floating input would be aprciated.

I've used the folowing code:

Pin setup:
  1. #define PHOTO_ADC_INPUT 14
  1.     gpio_reset_pin(PHOTO_ADC_INPUT);
  2.     gpio_set_direction(PHOTO_ADC_INPUT, GPIO_MODE_INPUT);  
  3.     gpio_set_direction(PHOTO_ADC_INPUT, GPIO_FLOATING);
ADC setup:
  1.     //-------------ADC1 Init---------------//
  2.     adc_oneshot_unit_handle_t adc2_handle;
  3.     adc_oneshot_unit_init_cfg_t init_config2 = {
  4.         .unit_id = ADC_UNIT_2,
  5.         .ulp_mode = ADC_ULP_MODE_DISABLE,
  6.     };  
  7.     ESP_ERROR_CHECK(adc_oneshot_new_unit(&init_config2, &adc2_handle));
  8.  
  9.     //-------------ADC1 Config---------------//
  10.     adc_oneshot_chan_cfg_t config = {
  11.         .bitwidth = ADC_BITWIDTH_DEFAULT,
  12.         .atten = ADC_ATTEN_DB_11,
  13.     };
  14.     ESP_ERROR_CHECK(adc_oneshot_config_channel(adc2_handle, ADC_CHANNEL_6, &config));
Reading ADC:
  1.     static int ADC_Reading;
  2.     ESP_ERROR_CHECK(adc_oneshot_read(adc2_handle, ADC_CHANNEL_6, &ADC_Reading));
Can some one please help me get the inputs float?

Who is online

Users browsing this forum: No registered users and 109 guests