ESP32 ADC voltage drop after some hours

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: ESP32 ADC voltage drop after some hours

Post by kevinkk525 » Sat May 16, 2020 1:38 pm

I would assume that it will stay absolutely stable if you change nothing, at least that is how it is in my test. Only when I changed the connection status of the UART using rshell the voltage on the ADC changed.
Might be indeed related to conductivity that might not play a role with a real resistor compared to a liquid solution which has capacitance too. Additionally the use of "AC" power in my case could play a role in introducing capacitance importance to the measurement that would not be an issue with DC voltage.
But I'm still testing.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: ESP32 ADC voltage drop after some hours

Post by Roberthh » Mon May 18, 2020 7:30 pm

I do not know which electrodes you use. But with metal electrodes you will see the issue of polarization. In the cited link of your first post it is told that this will not happen if the test cycle is very short. I have my doubts. It is still a DC measurement, only the total time it takes to polarize will be longer. Commercial electrodes use a special coating (e.g. Ag/AgCl compound) to avoid that.
But: Since you switch both GND and power to the probe, you could alternate the polarity at the electrodes.
Besdies that: may it be that you moved the electrodes a little bit when this sudden change in conductivity occurred?

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: ESP32 ADC voltage drop after some hours

Post by kevinkk525 » Mon May 18, 2020 9:15 pm

I was thinking about that too but a polarization would result in a slowly increasing ppm value. However the measurements are stable.
And I didn't touch the cable when the spike happened, nor when it returned back to the old value.

Alternating the powering pin to avoid polarization is a good idea, just need to adapt my formula.
Generally I wouldnt expect polarization to be much of a problem later when the probe is in a 150l tank with a pump that will be active every hour. But for now the probe sits in a glass of water so polarization might occur easily.

Thanks for your ideas and thoughts!
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: ESP32 ADC voltage drop after some hours

Post by pythoncoder » Wed May 20, 2020 8:34 am

To be meaningful this testing needs to separate the behaviour of the electrodes from that of the ESP32. That is best done by replacing the electrodes with a fixed resistor and repeating the test.
Peter Hinch
Index to my micropython libraries.

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: ESP32 ADC voltage drop after some hours

Post by kevinkk525 » Wed May 20, 2020 1:19 pm

It doesn't seem to cause problems with real resistors, even with AC measurements, so it probably is not the ADC itself that is causing these offsets. At least in my last tests with resistors it did not make a difference if rshell was connected or not. But as soon as I use the probe, it immediately makes a difference again.
Therefore I assume it could be the capacitance of nearby traces for the UART (as dhylands suggested), which only plays a visible role when measuring using the probe, which has a capacitance (due to the water) too?
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

Post Reply