Schematic: https://drive.google.com/file/d/15zgiig ... sp=sharing
So, my measure voltage range is from 0.6V to 3.0V. When I connect transducer and then I want read voltage by ADC (gpio35) I get 3.3V (4095) where should be less, actually about 2.9V. I measured the output to adc with multimeter and it shows exactly 2.9V (measured between adc pin and esp32 gnd), but ADC read 4095 = 3.3V...
I also tried another channel of adc1 (6,7), and then i also try replace "analogRead" function with "adc1_get_raw", but still same issue. It looks like adc is saturated.. OR ? Did anyone have a similar problem? Thank you for all the advices
SETUP:
- adc1_config_width(ADC_WIDTH_12Bit);
- adc1_config_channel_atten(ADC1_CHANNEL_6, ADC_ATTEN_MAX); //GPIO 34
- adc1_config_channel_atten(ADC1_CHANNEL_7, ADC_ATTEN_MAX); //GPIO 35
- float readAdcVoltage(tsadcSamples *trans, int16_t lsbOffset, uint16_t adcRozsahLow, uint16_t adcRozsahHigh, float inVoltLow, float inVoltHigh){
- //Null
- trans->buffer = 0;
- trans->avgSample = 0;
- //OverSample
- for(int i = 0; i < ADC_BUFFERSIZE; i++)
- {
- trans->buffer += analogRead(trans->adcPin);
- }
- trans->avgSample = (trans->buffer >> 2);
- trans->internalVolt = (trans->avgSample * ADC_VREF) / (ADC_BIT);
- trans->externalVolt = (trans->internalVolt * 3.0303030303);
- trans->value = mapf(trans->avgSample, adcRozsahLow, adcRozsahHigh, inVoltLow, inVoltHigh); //BAR
- return trans->internalVolt;
- }