ADC unintendedly transformed into an antenna???

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
V!nce
Posts: 20
Joined: Sun May 22, 2022 4:35 pm

ADC unintendedly transformed into an antenna???

Post by V!nce » Mon Jun 06, 2022 8:40 pm

Hello folks,

For a project with multiple biosensors, I need to monitor Electrodermal Activity (EDA) which is basically skin conductance. From what i know, it should be as simple as connecting one of my esp32 ADC pin and 3v3 to my skin with one or several resistors in between and read the voltage value (for now, i can only use read_u16 not read_uv). Simple enough right? NO

The problem I am having is that as soon as I plug a dupont wire to the ADC Pin, I start observing a wave with a period of about 20 seconds. My knowledge in electronics is very limited but I quickly thought it could be some kind of electromagneric interference and added more wires. The the amplitude of the wave increased. What thing could have such a period ? And is there a way to make it disappear?

Thanks for your help if anyone has an idea!

Image

User avatar
Mike Teachman
Posts: 155
Joined: Mon Jun 13, 2016 3:19 pm
Location: Victoria, BC, Canada

Re: ADC unintendedly transformed into an antenna???

Post by Mike Teachman » Mon Jun 06, 2022 8:57 pm

Is there any chance that the period of the signal is 20ms, not 20s. If that is the case, 50Hz power line interference (20ms period) is likely the cause.

V!nce
Posts: 20
Joined: Sun May 22, 2022 4:35 pm

Re: ADC unintendedly transformed into an antenna???

Post by V!nce » Mon Jun 06, 2022 9:04 pm

Nah! Sadly I tried with different sampling rate because at first I didn't understand, but I always used a period above 20ms. In the graph I send, every value is 100ms appart :'(
I counted myself the seconds seperating 2 peeks and it was about 20sec...

I just wrapped the cable into aluminium foil to shield it and it actually worked... I don't know what to think about it. Maybe my PC is the cause of that noise. it's weird and funny at the same time.

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

Re: ADC unintendedly transformed into an antenna???

Post by Roberthh » Tue Jun 07, 2022 6:22 am

Any long wire will pick up the hum from mains. And the body of your test person is also a good antenna. And even with undersampling you can get such a nice since-like waveform, if both frequencies stay at a fixed ratio (aliasing).
b.t.w.: Using DC for skin conductance measurement is not optimal, since the skin will saturate, and you cannot tell whether it is any observed effect of the person or just skin chemistry. Old techniques used DC. Newer approaches use AC and measure the complex impedance, not only the resistance. There is a nice chip from Maxim for that purpose, MAX32600. Or something like the AD5933, AD5934. But these are all complex and/or expensive devices, nothing like an ESP32 plus wire.
At least you must use proper medical silver chloride probes for the skin, which do not saturate.

V!nce
Posts: 20
Joined: Sun May 22, 2022 4:35 pm

Re: ADC unintendedly transformed into an antenna???

Post by V!nce » Tue Jun 07, 2022 1:27 pm

Yesterday after seeing you post and before going to bed I turned down my tower PC and retested the esp32 with my portable computer and didn't see the same interference so I likely identified the source haha

Thanks a lot for your valuable feedback. My goal is to build a "watch" (more like a big bracelet) that monitors SPO2, acceleration, temperature and EDA. I already have 3 of the sensors working and I thought that EDA would be as simple as just pluging 2 wires to the skin and read the voltage value. Today I saw that the scheme I used to plug the wires is actually wrong. I have to plug the Vin to the skin, then have a second go to ground with a resistor and a last one before the resistor go to the ADC Pin. i'm gonna try tonight to see if I get something interesting.

Saying that I have several issues, first, I don't know anything about electronics, which is the reason my circuit was wrong. Then, this method doesn't actually measure skin conductance as I measure the voltage while current in unknown. I guess it's still good because what interests me is the variation in that voltage. If you have any knowledge on how to do it in a proper way, on the cheap, for a prototype I would be glad to follow your advices. Sadly, I guess adding more sensors would add bulk and maybe consume more energy and I am not sure yet I can power the ESP with 3 or 4 sensors for an entire day with several hundred values saved per sec (around 200) for an entire day.
For reference, I am using the MAX30102 sensor as well as the MPU6050 accelerometer.

To reformulate my question, do you know what would be the best way to measure skin conductance with an ESP and minimal additional equipment and also, what would be the proper way of doing it, still with an ESP (and more sensors?) while respecting the constraint I cited? Finally, for now I'm using 3.3v for everything because I thought that it would be more efficient than 5v. Should I plug the "electrode" to the 3.3v pin as well or should I separate it and go for the 5v and a bigger resistor?

PS: A collegue gave me some spare/used dry electrodes that I will try to adapt soon, it will be better than to make ones with aluminum foil for sure! :lol:

Post Reply