ADC reading degrading over time
Posted: Tue Mar 28, 2023 9:17 pm
I am using GPIO32 as a 12-bit input pin to read a voltage from a sample and hold circuit. I am monitoring the reading with a UART to serial monitor connection. My oscilloscope shows the voltage level does not diminish over time, but the reading from the ESP32 does at a rate of 15 points per minute (eg reading degrades from 3339 to 3263 over 5 minutes with the same input voltage). This degradation continues to a point where at some point GPIO32 begins to put a 1V output on the pin.
The pin is protected by a 3V Zener diode. The hold capacitor from which the reading is taken is fed by a mosfet that is sourced from VDD, such that the pin is protected on both sides of the sample and hold circuit by a 3.0V and 3.3V limit respectively. The degrading signal would suggest some sort of damage or derating is happening at the pin, but there is no obvious cause from the circuit itself. Has anyone seen this behavior?
One mitigation I have tried to use without success was to change GPIO32 to a digital OUTPUT and then set it LOW between readings to protect the pin from any unseen event by sinking the current rather than affecting the ADC with it.
This behavior is also seen if I use an INPUT ONLY pin like GPIO35.
The ADC is no longer functional overnight. I need to resolve this. Any help is greatly appreciated. Thanks!
The pin is protected by a 3V Zener diode. The hold capacitor from which the reading is taken is fed by a mosfet that is sourced from VDD, such that the pin is protected on both sides of the sample and hold circuit by a 3.0V and 3.3V limit respectively. The degrading signal would suggest some sort of damage or derating is happening at the pin, but there is no obvious cause from the circuit itself. Has anyone seen this behavior?
One mitigation I have tried to use without success was to change GPIO32 to a digital OUTPUT and then set it LOW between readings to protect the pin from any unseen event by sinking the current rather than affecting the ADC with it.
This behavior is also seen if I use an INPUT ONLY pin like GPIO35.
The ADC is no longer functional overnight. I need to resolve this. Any help is greatly appreciated. Thanks!