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!
ADC reading degrading over time
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: ADC reading degrading over time
Can you post a schematic of the circuit?
-
- Posts: 11
- Joined: Fri Apr 08, 2022 6:02 pm
Re: ADC reading degrading over time
LineVADC is connected to GPIO32
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: ADC reading degrading over time
I agree that there isn't anything directly coupling the Vac into the IO-pin... perhaps there's some inductive coupling going on? Are you using a ground plane between the zener and cap and the ground of the ESP32 / AC? Asking because if something coupled into that circuit, the zener and cap have no way of stopping it.
-
- Posts: 11
- Joined: Fri Apr 08, 2022 6:02 pm
Re: ADC reading degrading over time
The zener, capacitor, and ESP32 share a common ground plane on a 2-layer PCB. The trace from the zener/capacitor junction to GPIO35 is 4mm. There are no other traces running parallel or close to it. There is one trace running perpendicular to it on the underside of the board, but it is a 3.3V pulse from the ESP32. Given its orientation and low current, I don't see any coupling there. Did I answer your question?
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: ADC reading degrading over time
It does. Unfortunately, that was also the only explanation for what you're experiencing I had left. All I can say is that I have never seen an issue like yours (degrading ADC performance within 24hrs) before at all, so statistically it's likely that what you're seeing is specific to your setup. I have no idea about the mechanism that causes it, though.
Re: ADC reading degrading over time
Does the same problem occur if you apply a constant voltage to the pin from a regulated power supply? Just to eliminate all possibilities of the hardware.
Who is online
Users browsing this forum: No registered users and 135 guests