Conductivity measurements with Bipolar Pulse

102 views
Skip to first unread message

Markos

unread,
Nov 17, 2015, 7:47:10 AM11/17/15
to diy...@googlegroups.com
Hi,

I'm trying to implement a conductivity meter with the Arduino board. My
intention is to keep the electronic circuit as simple as possible.

I'm only using a voltage divider as shown:
http://www.c2o.pro.br/hackaguas/figuras/condutivimetro_00_bb.png

The alternating pulses are generated by switching the signals from pins
7 and 8 of Arduino:
http://www.c2o.pro.br/hackaguas/figuras/condutividade_efeito_frequencia_01.png


For now I'm using two steel wires as electrodes:
http://www.c2o.pro.br/hackaguas/figuras/eletrodos_00.png

My intention is to be able to control via software some measuring
parameters, such as electrode polarization time. And adjust these
parameters on the fly depending on the sample concentration range.

Recently I started to read some papers about bipolar pulse technique:
http://pubs.acs.org/doi/abs/10.1021/ac60285a015

The bipolar pulse technique for measuring solution resistance minimizes
the effects of both the series and parallel cell capacitances. The
technique consists of applying two consecutive voltage pulses of equal
magnitude and pulse width but of oposite polarity to a cell and
measuring the cell current precisely at the end of the second pulse.
(Source: Peter Kissinger, William R. Heineman, Laboratory techniques in
electroanalytical chemistry)

Does anyone has any experience with this conductivity measuring technique?

Thanks for any tip,
Markos

Nathan McCorkle

unread,
Nov 17, 2015, 2:09:57 PM11/17/15
to diybio
It sounds like you need a dual-voltage power supply. There really
isn't such a thing as "negative" voltage... for example if you have a
9V power supply, you could say that 4.5V is a "virtual ground", and
then 0V would appear as "negative" relative to your "virtual ground",
and the 9V wire would appear like 4.5V relative to "virtual ground"
(again, which is actually 4.5V relative to 0V wire).

A simple circuit is shown here, though you can get more complex ICs
that are more efficient, this has few parts and is simple:
http://electronics.stackexchange.com/a/79317/34413

So with something like that in place, you connect your arduino GND pin
to the "virtual ground" and the PWR pin to the "virtual 4.5V"
(assuming you have a 5V tolerant Arduino). Then using transistors, you
can pulse your analysis cell with your "positive" and "negative"
polarity pulses.


Stripping voltammetry is another interesting and related technique,
where you hold a voltage for some time, then slowly alter the voltage
and watch the current response... basically you plate ions to the
electrode, and then slowly drive them off. There are characteristic
current curves, since different ions electrolyse at different
voltages, so you can determine minute amounts of metals and their
concentrations (if you have standards to calibrate against). There are
also interesting impedance spectrometry techniques... where you
generate an electrical wave, watch the current flowing, then do this
while changing/scanning through a range of frequencies. Lots of neat
stuff! It's all electron interactions at some point! So might as well
learn to use them!
> --
> -- You received this message because you are subscribed to the Google Groups
> DIYbio group. To post to this group, send email to diy...@googlegroups.com.
> To unsubscribe from this group, send email to
> diybio+un...@googlegroups.com. For more options, visit this group at
> https://groups.google.com/d/forum/diybio?hl=en
> Learn more at www.diybio.org
> --- You received this message because you are subscribed to the Google
> Groups "DIYbio" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to diybio+un...@googlegroups.com.
> To post to this group, send email to diy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/diybio.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/diybio/564B2299.2050204%40c2o.pro.br.
> For more options, visit https://groups.google.com/d/optout.



--
-Nathan

Markos

unread,
Nov 18, 2015, 9:42:48 AM11/18/15
to diy...@googlegroups.com
Hi Nathan,

Thanks for the tip about the dual supply.

But for now, I'm using the Arduino digital pins to generate the
alternating pulses.

The circuit set up is this:
http://www.c2o.pro.br/hackaguas/figuras/condutivimetro_00_bb.png

Where Rx is the solution resistance.

And the pulses are generated switching the levels (high and low) of pin
I'm imagining that for the solution is important only the difference of
voltage between the two electrodes.

If in the first pulse pin 8 is 5V and pin 7 is at 0V and in the next
pulse pin 8 = 0V (LOW) and pin 7 is 5V (HIGH) so I'm reversing the
polarity. Right?

I imagine that would be the same as using a symmetrical dual supply and
apply at pin 8= +2.5V and pin 7= -2,5V and then pin 8= -2,5V and pin 7=
+ 2.5V. Right?

In both cases I apply at the electrodes a difference voltage of 5V and
alternating. Do you agree?

Some info about the Bipolar Pulse: https://goo.gl/qBd6CO

My intention in Bipolar Pulse is to evaluate whether it would help to
increase the range of linear reading for samples with different
conductivities without changing the electrode.

And I have also a great interest to study more about analytical
techniques based on voltammetry and use Arduino to make DIY systems for
quantitative electrochemical analysis in water. Do you suggest any
mailing list (or forum) where I can meet other people with similar
interests?

Thank you very much for your comments.

Best Regards,
Markos

Nathan McCorkle

unread,
Nov 19, 2015, 2:05:19 AM11/19/15
to diybio
So the one thing I notice after skimming the paper earlier today, and
then now a bit more zoomed in, and also comparing your images.

When you switch the polarity, you're no longer sensing on the same
side of the resistor relative to the + voltage. When forcing voltage
through the sense resistor, your analog-sense-pin will see much less
cell (analyte) induced changes. I considered that you might not be
sampling on both pulses, like if one was a 'reset' pulse... but if you
don't mean to do that, then I think you need another sense resistor
and use another of the analog inputs.

Depending on your solution's conductivity, and the value of your sense
resistor, you might risk sinking too much current into the pin at 0V
state (AtMega 328 says current limit for GPIO is 40mA, so at 5V you'd
be safe with at least (5/0.4) ohms (125 ohms) for the sense).
> https://groups.google.com/d/msgid/diybio/564C8F4B.5080006%40c2o.pro.br.
>
> For more options, visit https://groups.google.com/d/optout.



--
-Nathan

Markos

unread,
Nov 19, 2015, 6:49:06 AM11/19/15
to diy...@googlegroups.com
Hi Nathan,

Thanks for your comments.

I'm using the sampling in only one pulse. For example to read the
voltage at point "M" just when the pin 8 = 5V (see figure):
http://www.c2o.pro.br/hackaguas/figuras/circuito_condutivimetro_00.png

And use the following formula:
http://www.c2o.pro.br/hackaguas/figuras/eq_div_tensao.png

to calculate Rx from V8 (5V), Rc and VM.

Where V8 = potential on pin 8 (5V)
VM = potential in the analog-sense-pin (A0)
Rc = sense resistor
Rx = Solution resistance

But also I'm considering that each command analogRead takes ~100
microseconds, so I include 1 analogRead command (or delaymicroseconds
(100)) on the other pulse to keep the duration of both pulses the same.

Do you agree with this strategy? Any suggestion?

And back to your commentes on voltammetry, do you know any group that
are using voltamentria in the DIY philosophy?

Thanks for your attention.
Markos

John Griessen

unread,
Nov 19, 2015, 2:35:52 PM11/19/15
to diy...@googlegroups.com
On 11/19/2015 01:04 AM, Nathan McCorkle wrote:
> I considered that you might not be
> sampling on both pulses, like if one was a 'reset' pulse... but if you
> don't mean to do that, then I think you need another sense resistor
> and use another of the analog inputs.

Yes, you probably want to flip the whole experimental setup around
and attach everything that was on one electrode to the other and vice versa.

So, if you cannot see how to do that via using different pins of the microcontroller,
you could add an analog switch IC to act like a patch panel.

Or, get big or small medieval style DC relays chunking or clicking to do the swap around.

Markos

unread,
Nov 21, 2015, 8:01:25 AM11/21/15
to diy...@googlegroups.com
Hi John,

I'm doing by this way:

const float V_arduino = 5.00;

byte pin_electrode_1 = 7;
byte pin_electrode_2 = 8;

int reading_pin = A0;
int reading;

float Vm;
float Rc = 10000; //Constant resistor
float Rx; //Resistance of solution

void setup()
{
Serial.begin(115200);
pinMode(pin_electrode_1, OUTPUT);
pinMode(pin_electrode_2, OUTPUT);
}

void loop()
{


//Pin 7 = 0V e Pin 8 = 5V
digitalWrite(pin_electrode_1, LOW);
digitalWrite(pin_electrode_2, HIGH);

delayMicroseconds(2000);

//Pin 7 = 5V e Pin 8 = 0V
digitalWrite(pin_electrode_1, HIGH);
digitalWrite(pin_electrode_2, LOW);

delayMicroseconds(1900);
reading = analogRead(reading_pin);

digitalWrite(pin_electrode_1, LOW);
digitalWrite(pin_electrode_2, LOW);

Vm = reading * 0.0048;
Rx = Rc * (V_arduino - Vm) / Vm;

Serial.print(Vm);
Serial.print(" ");
Serial.println(Rx);

delay(500);

}

Any tip?

Many thanks,
Markos

Nathan McCorkle

unread,
Nov 21, 2015, 11:35:50 PM11/21/15
to diybio
Markos, if you mean the pins to switch simultaneously (and I think you
do), then you will
need to use PORT manipulation logic:
https://www.arduino.cc/en/Reference/PortManipulation
> --
> -- You received this message because you are subscribed to the Google Groups
> DIYbio group. To post to this group, send email to diy...@googlegroups.com.
> To unsubscribe from this group, send email to
> diybio+un...@googlegroups.com. For more options, visit this group at
> https://groups.google.com/d/forum/diybio?hl=en
> Learn more at www.diybio.org
> --- You received this message because you are subscribed to the Google
> Groups "DIYbio" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to diybio+un...@googlegroups.com.
> To post to this group, send email to diy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/diybio.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/diybio/56506C02.2050305%40c2o.pro.br.

John Griessen

unread,
Dec 2, 2015, 11:02:15 AM12/2/15
to diy...@googlegroups.com
I'm not experienced with arduino, but:

"void setup()
>>{
>> Serial.begin(115200);
>> pinMode(pin_electrode_1, OUTPUT);
>> pinMode(pin_electrode_2, OUTPUT);
>>}"

Seems like you set the drive direction once and do not change it.

If you are simply using a digital out and digital levels lo and high
as drivers, it is likely not accurate enough. read the datasheet about
levels tolerance and you will probably find it is coarse -- that's the nature of digital
wire outs and ins, they tolerate inexact levels...

Your external R divider circuit needs to be driven by a comparator from a voltage reference
that is part of the analog circuitry of your microcontroller, or as external parts.

If those pins *ARE* analog, they may need some strength amplifying to do it right.
have you instrumented any of this and confirmed that the voltage level goes to within some accuracy range of intended?
The currents are small, so instrumenting current may not work well, but if you check the volts while running long pulses,
and also see that a pulse edge is good in xxx microseconds, then you can infer that the fast desired pulses are good...



Jonathan Cline

unread,
Dec 3, 2015, 12:16:07 PM12/3/15
to DIYbio, mar...@c2o.pro.br, jcline
Solder the circuits, don't use a plastic breadboard, for conductivity measurements.  I haven't used this technique that I remember, but have built conductivity tools. 

## Jonathan Cline
## jcl...@ieee.org
## Mobile: +1-805-617-0223
########################

Markos

unread,
Dec 5, 2015, 7:00:46 AM12/5/15
to diy...@googlegroups.com
 Hi Jonathan,

I am continuing this project and I am currently studying this circuit:
www.c2o.pro.br/hackaguas/figuras/Condutivimetro_Pulso_Bipolar_04.png

Now I'm trying to implement a circuit to sample the end of the second pulse.

For example, from a pulse of 40 microseconds make the reading of voltage only in the last 10 or 5 microseconds.

I plan to add a peak detector (attached figure).

What do you think?

Thanks for your attention,
Markos
sample_and_hold_peak_detector_02.png

Jonathan Cline

unread,
Dec 11, 2015, 12:28:02 AM12/11/15
to diy...@googlegroups.com, Jonathan Cline
Hm, well, it seems you are thinking to use a transmission gate to switch the pulse but it's not clear from your diagram what is on the input at the left of your R7, so I'm guessing it is the discharge pulse from your previous diagram.  You might also consider explaining the diagram word pino.  I thought I had replied to this message but I can't find the reply so I will summarize what might have just gone into the ether previously.  For detecting a rapidly discharging analog pulse I would use a comparator (LM339 or op amp with very hi gain).  One side of the comparator is the input.  The other side of the comparator is optionally an adjustable voltage which is controlled by the microcontroller software, or you can make it a fixed value with a simple voltage divider.  You can create the adjustable voltage by implementing software PWM (say, period of 20kHz) in the microcontroller and making it into an average with a simple 1st order filter.  I don't think it would have enough ripple to matter much.   The output of the comparator would be digital 1 or 0, depending on the threshold voltage you generate in software, which goes to a digital input pin on the microcontroller.  Let's say you wire it such that the comparator goes to 1 at the detection of the peak.  This creates a very fast digital 1 which is an interrupt to the microcontroller, which then executes an exact delay (40 usec - 10 usec = 30 usec spin delay time), and which then software triggers the microcontroller A/D to sample the voltage.   Read the atmel chip datasheet closely to make sure the physics of the chip and the peripherals support what you are trying to do, in terms of timing (especially sample/hold time of the A/D peripheral).   If you want to detect the negative-going pulse, then make a pair of the circuits I described, one for positive and one for negative, which is simple with a dual comparator IC.  So in summary, my solution would be different than the circuit you have drawn.  But I also didn't read the paper you posted previously so I might be misinterpreting your intention.

Don't forget that you will want to have a calibration algorithm which measures the impulse response of your own circuit.  Presumably the user would run this on a known buffer, and the result would be saved as a calibration constant in EEPROM or Flash.


## Jonathan Cline
## jcl...@ieee.org
## Mobile: +1-805-617-0223
########################

--
-- You received this message because you are subscribed to the Google Groups DIYbio group. To post to this group, send email to diy...@googlegroups.com. To unsubscribe from this group, send email to diybio+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/diybio?hl=en
Learn more at www.diybio.org
---
You received this message because you are subscribed to a topic in the Google Groups "DIYbio" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/diybio/eleWlFbHrTM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to diybio+un...@googlegroups.com.

To post to this group, send email to diy...@googlegroups.com.
Visit this group at http://groups.google.com/group/diybio.
Reply all
Reply to author
Forward
0 new messages