Go Down

Topic: Strange voltage readings using my potato (Read 3123 times) previous topic - next topic

kayle

Jan 29, 2013, 07:09 pm Last Edit: Jan 29, 2013, 07:21 pm by kayle Reason: 1
I am using an arduino uno with a wireless sd shield to measure galvanic skin response.
The setup uses two tens machine style electrodes, and measures the voltage coming into an analog input. The whole thing is portable and powered by a 9v duracel battery.
It is designed to take a voltage reading every 2 seconds, and print that to a micro sd card, so that it can take continuous readings over many hours.

I finally got the whole thing working and measured the voltage with the two electrodes placed about 2 inches apart on my chest over several hours. The graph of the readings shows a steady increase in the readings from about 40 to about 160 over about one and a half hours then a flatter range of between around 140 to around 180 over the next two hours. Basically a linear increase for two hours followed by sideways movement for two hours. I suspected this might be due to sweat build up under the electrodes slowly increasing conductivity, until they became saturated after 2 hours. (Attached image 1).

I decided to test the setup on a potato for several hours. If the graph shape was solely due to sweat, then since potatoes don't sweat the graph shape should be basically flat. Unfortunately the potato gave an even more extreme graph. It first shows a very rapid increase in measurement from about 270 to 350 over 15 minutes, followed by a more gentle linear increase from around 350 to around 410 over the next 2-3 hours. (Attached image 2).

The potato readings are clearly not due to sweat. This was done on a wooden table with no other interference. Inside a dry room in a warm house.
The wires used to take readings are fully insulated so that no bare copper is exposed.

The smaller fluctuations between readings are to be expected, but the general graph shape seems to suggest an underlying problem with the sensor setup.
Does anyone have any idea what might be causing these readings? Could it be something to do with the ground?
(I have no experience with electronics before this project!)

(The setup has:
9v battery going into the power jack, with proper 9v connector soldered to jack having positive on the inside.
3.3v going to first electrode via resistor.
Second electrode going back to arduino with the wire split so that one end goes into an analog input and the other end goes to a ground pin via a resistor.
An RTC with its own battery powered from the 5v output, with a ground wire going into another spare ground on the arduino, and info wires going into two more analog pins.
The arduino is fully sealed inside a plastic tub. Only the battery and electrodes are outside the tub.
I am using foam to cushion the arduino inside the tub, and the foam is touching many parts of the electronics, but I don't think it is conductive.)



robtillaart

The potato is acting like a battery. What material are the electrodes?

2 diff metals in a sour is in essence a battery.

Does the potato get a colour around (one of) the electrodes (blue/brown?)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

kayle

Now that you mention it, I remember something about potatoes being used as batteries ... I was just looking for something which would be slightly conductive without shorting the circuit.

There does not appear to be much colouration on the potato. There is a very, very slight brown hue under the electrode which goes to the ground. I did notice that the arduino light was not on when I came back to it. I assumed the battery had gone flat. I haven't actually tried turning the arduino back on again yet. I do hope I haven't bricked my arduino ... with a potato.

Could there be a problem a floating ground? I thought perhaps excess charge might be building up over time, or something, which is causing the gradually higher readings. I have tried to look up about floating grounds and whether it might be a problem for arduinos in general or my setup in particular, but I have not been able to find enough information on it to diagnose whether it is even relevant in this situation.


robtillaart

Quote
I assumed the battery had gone flat.

You could have tried a potato ;)

Quote
Could there be a problem a floating ground?

I expect that chemical reactions took place forming substances that increased the conductivity. If a cell of potato burst, the inner fluids come out.
There might even be a bit of heat build up, (causing your battery to drain faster?)

Redoing the experiment with more controlled conditions could shed some light on it.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

jackrae

Your body and the potato are effectively the electrolyte in a simple battery and the electrodes are becoming polarised over time since they are monitoring using a DC circuit.  You can prevent such polaristation by periodically reversing the polarity of the electrodes by either an h-bridge type device or a DPDT relay.

kayle

Quote
prevent such polarisation by periodically reversing the polarity of the electrodes by either an h-bridge type device or a DPDT relay


Awesome. I have never heard of these things before, but they sound cool enough to fix it. I'll look them up, thanks!

Thankfully my arduino still seems to work, and strangely the 9v battery also seems to be working again. I did notice that the RTC module went haywire in the last few minutes of the test as well, and started spewing out random times. It seems that strange things happen when potatoes get involved.

Thank you both very much for your help. I probably would never have found those answers on my own!

dc42

Try connecting the top end of the 3K3 resistor to an Arduino PWM pin instead of to +5V, and connect a 1uF ceramic capacitor in series with the electrode. Connect the analog input pin to the junction of the capacitor and the resistor. Set the PWM output to 50%. Take analog readings both when the PWM output is high and when it is low (you can read the state of the PWM pin using digitalRead), and take the difference between the two readings. This way, you will be feeding AC to the electrodes, avoiding electrolysis.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

michinyon

To make a "battery"  you would need two different metals for the electrodes.

I am a bit unclear what you are actually trying to do ?

When you put the electrodes on your chest,  were you trying to measure a voltage generated
by your chest ?   Or were you applying a voltage from the arduino to your chest and trying
to measure the conductivity or resistance of your chest ?

kayle

1)
Quote
Try connecting the top end of the 3K3 resistor to an Arduino PWM pin instead of to +5V, and connect a 1uF ceramic capacitor in series with the electrode. Connect the analog input pin to the junction of the capacitor and the resistor. Set the PWM output to 50%. Take analog readings both when the PWM output is high and when it is low (you can read the state of the PWM pin using digitalRead), and take the difference between the two readings. This way, you will be feeding AC to the electrodes, avoiding electrolysis.


Thank you. I shall try this. It might take me a while to sort it out, and I will need to buy the ceramic resistor, but I am keen to try it.

2)
Quote
When you put the electrodes on your chest,  were you trying to measure a voltage generated
by your chest ?   Or were you applying a voltage from the arduino to your chest and trying
to measure the conductivity or resistance of your chest ?


I am applying 5v from the arduino (itself powered from a 9v battery) across my chest (or any other body part) to measure conductivity/resistance. I think galvanic skin response refers to the minute changes in sweat secretions from sweat glands which cause changes in skin surface conductivity. It is basically a lie detector test, although I am not interested in it for that purpose. I am trying to get a general measure of the physical stress someone is under, over an extended period of time. I'm not interested in the minute fluctuations that would be used for a lie detector test. I am only interested in the larger changes over hours or days. That is why the graph shapes I have so far created are causing a problem.

3)
Am I correct in thinking that using the usb connector to power the arduino, rather than the 9v battery, would produce an AC current across the skin? Or does the arduino somehow only provide DC current out of the 3.3v or 5v pins? If the usb connector is AC then I could at least use that to test the effectiveness, even if I will have to implement one of the proper solutions offered above for the portable battery operated operation.

kayle

I originally thought this was a problem with the arduino setup I had, but now that it has been pointed out to me that it is a polarization problem it is clear that this is a problem with gsr sensing in general.

This issue already seems to have been partly covered by an earlier post, for any who are interested:
http://arduino.cc/forum/index.php?topic=96361.0

dhenry

Quote
I remember something about potatoes being used as batteries


There are examples of using potato / tomato / apple / etc. to power your mcu.

dc42


1)
Thank you. I shall try this. It might take me a while to sort it out, and I will need to buy the ceramic resistor, but I am keen to try it.


You can try using an electrolytic capacitor instead of a ceramic capacitor, even a higher value such as 10uF or 100uF, and that should help a lot. However, the leakage current of an electrolytic capacitor will still result in a small amount of direct current, so you will still get some (very slow) electrolysis.


3)
Am I correct in thinking that using the usb connector to power the arduino, rather than the 9v battery, would produce an AC current across the skin? Or does the arduino somehow only provide DC current out of the 3.3v or 5v pins? If the usb connector is AC then I could at least use that to test the effectiveness, even if I will have to implement one of the proper solutions offered above for the portable battery operated operation.


Two points:

1. Powering the Arduino from the USB connector will make no difference, either way your present arrangement will feed DC to the electrodes, causing electrolysis.

2. Connecting yourself to something that is connected to mains ground (such as an Arduino powered from the USB port) is a bad idea, because if you touch anything live, your body will provide a direct path to ground. Medical devices having patient electrodes are always battery powered, or else the electrodes are isolated from ground (the standard calls for several thousand volts of isolation, I forget the exact figure).
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

kayle

Quote
Connecting yourself to something that is connected to mains ground (such as an Arduino powered from the USB port) is a bad idea


Good point. Thanks. I was focused so much on the problem itself, that I forgot I would be connecting myself up to the mains. :smiley-eek:

kayle

Quote
Try connecting the top end of the 3K3 resistor to an Arduino PWM pin instead of to +5V, and connect a 1uF ceramic capacitor in series with the electrode. Connect the analog input pin to the junction of the capacitor and the resistor. Set the PWM output to 50%. Take analog readings both when the PWM output is high and when it is low (you can read the state of the PWM pin using digitalRead), and take the difference between the two readings. This way, you will be feeding AC to the electrodes, avoiding electrolysis.


Thanks for describing this. I have tried to draw a circuit diagram of what I understand this description to mean. I have attached the circuit diagram as a jpeg below.
Have I drawn this circuit correctly?

I'm not really sure what the capacitor is doing. Is this really feeding AC to the electrodes, or just pulsing the current on and off without reversing it?


dc42

Yes, that's correct. The capacitor will feed AC to the electrodes when you generate a square wave at the PWM pin.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Go Up