Page 1 of 1

adc reading huge variation

Posted: Sun Sep 15, 2019 4:26 pm
by Neywiny
I have a potentiometer hooked up onto pin 33 of my huzzah, "analog input A9 on ADC #1. It can also be used to connect a 32 KHz crystal." (adafruit pinout)

I use ADC 2 for my wifi stuff so even if switching ADC would work for reading voltages it would not work for my application. For testing I'm just sending the adc value over serial from the ReadAnalogVoltage sketch with a 100ms delay and revised scaling factors.

With almost 800 samples I'm seeing a variation of ~0.11v. I've measured the pin with my multimeter, it's stable to the millivolt so 110mV is on the ESP not the circuit. I've tried setting the attenuation, I did the analogSetCycles up to 255, no improvement. I don't really know where to go from here.

Now admittedly I am reading ~2.7v on my 3.3v output from the board, which may be causing something but it's also consistent to the millivolt range so it should at least give a consistently wrong value, right?

Re: adc reading huge variation

Posted: Thu Oct 10, 2019 3:41 am
by ESP_Dazz
Have a look at the ADC calibration library. Although it's part of ESP-IDF, these functions should still be callable as long as you include the library's header file in your sketch.