Searching \ for 'AD and PIC interfacing problem' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'AD and PIC interfacing problem'.

Truncated match.
PICList Thread
'AD and PIC interfacing problem'
1999\10\18@204947 by hris Fanning

flavicon
face
In short, my application is to read AD from a pH electrode.

I'm using a 16F877 and I want to use all 8 AD channels.  I have a 24V
power supply (24V used to control solenoids) dropped with a 5V
regulator for the PIC.

pH probes output roughly -500 to 500mV at very high impedance.

Some pH electrode and measurement info is at:
  http://www.innovativesensors.com/phMeasure.asp
the bottom is the most relevant.

I think my biggest problem is the negative voltage reference, or lack
thereof.

What's the best way of going from this electrode to the AD line on
a PIC?

Ideas?

Thanks,
Chris

1999\10\18@210431 by Sean H. Breheny

face picon face
Hi Chris,

What you want is a good CMOS op-amp (like the LMC660). They have a HUGE
input impedance (in the teraohms. You can preserve this by lifting the pin
and soldering the wire to it in mid air. A PCB will have a lower impedance).

You can make an amplifier which amplifies this +/- 500mV and shifts it to
give 0-5V, and then use a regular ADC (maybe even the PIC's internal one).
To do this properly, you will need a negative supply. Since you don't need
much current at all, however, you can use an inverting charge pump circuit
(see http://www.people.cornell.edu/pages/shb7/neatcir.html ) to generate
the 1mA or so of -5v that you need. Filter it well, and use a low pass
filter on the output of the op-amps to reduce noise before feeding the
signal to the PIC.

Sorry, I'm not good at ascii art. If you want a schematic, ask me,and I'll
draw one up.

Sean

At 08:48 PM 10/18/99 -0400, you wrote:
{Quote hidden}

| Sean Breheny
| Amateur Radio Callsign: KA3YXM
| Electrical Engineering Student
\--------------=----------------
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
spam_OUTshb7TakeThisOuTspamcornell.edu ICQ #: 3329174

1999\10\18@215932 by Thomas Brandon

flavicon
picon face
I'm not exacxtly an electronic's master so this may be way of the mark, but
if you were to drop the supplies (both ground and +5V (you could not drop
the +5V as 4V is within supply specs)) of the PIC 0.5 -1V (I think I saw an
couple of messages about dropping .6V with a zener diode, if so that'd do
the trick) then the -0.5V - +0.5V relative to the sensors ground would
actually be around +0.1V - +1.1V (you could also raise the ground of the
sensor 0.5V, assuming it could handle a -0.5V supply drop). Don't know how
accurate the zener would be, so extra calibration may be neccesary but this
was quite possibly on the cards anyway. Now you at least have a unipolar
signal which increases your range of components to choose from (you may need
some protection to clamp the input above 0V as I don't think your ADC will
like a -ve input).

In terms of scaling the input to full +5V range this may not be neccesary
depending on the required accuracy. For instance, the 10bit AD of the 16F87x
series will theoretically give a proper 8bit range with an FSR of only
1.25V, however this is of course using the 8 LSB's of the ADC so all the ADC
noise will be present (as opposed to scaling 5V FSR to 8bit by taking 8
MSBs). But if 7bit was adequate you could probably get that out of only 1V
FSR (with scaling).

Of course you'd still need an op amp to buffer the high impedance sensor,
but it could be a single supply model, and could simply be used in unity
gain configuration.

Tom.
{Original Message removed}

1999\10\18@232057 by Robert A. LaBudde

flavicon
face
At 08:48 PM 10/18/99 -0400, Chris wrote:
>In short, my application is to read AD from a pH electrode.
>
>I'm using a 16F877 and I want to use all 8 AD channels.  I have a 24V
>power supply (24V used to control solenoids) dropped with a 5V
>regulator for the PIC.
>
>pH probes output roughly -500 to 500mV at very high impedance.

You don't need a negative voltage reference. You do, however, need an
op-amp that will work at 5 V.

First, pick a dual op-amp chip.

Second, buffer the pH electrode with a non-inverting follower amplifier to
avoid loading the cell.

Third, follow by a 5x gain amplifier.

What about the negative supply? Well, just bias the op-amp at 1/2 Vcc with
a voltage divider. If you choose op-amps that draw current, use an op-amp
in a non-inverting follower arrangement to buffer the 1/2 Vcc reference.

Since you want to use the full 0-5V range, the LMC660 quad rail-rail CMOS
op-amp is a good choice. It also only draws a couple pA bias current, so a
resistance-divider network for 1/2 Vcc is sufficient.

You'll have two op-amps left over. You can either use them for another
channel, or for anti-aliasing.

================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: .....ralKILLspamspam@spam@lcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

1999\10\18@232934 by Sean H. Breheny

face picon face
Robert,

How can a non-inverting follower work without at least a negative supply? I
interpreted "negative reference" to mean "negative supply" in this case.

If we could use an inverting buffer, THEN it wouldn't need a negative
supply. However, good luck finding a high enough Rin,

Sean

At 11:19 PM 10/18/99 -0400, you wrote:
{Quote hidden}

| Sean Breheny
| Amateur Radio Callsign: KA3YXM
| Electrical Engineering Student
\--------------=----------------
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
.....shb7KILLspamspam.....cornell.edu ICQ #: 3329174

1999\10\19@103327 by Robert A. LaBudde

flavicon
face
At 11:27 PM 10/18/99 -0400, Sean wrote:
>How can a non-inverting follower work without at least a negative supply? I
>interpreted "negative reference" to mean "negative supply" in this case.
>
>If we could use an inverting buffer, THEN it wouldn't need a negative
>supply. However, good luck finding a high enough Rin,

As far as I know, you never need to have bipolar supplies. You just need a
Vss and a Vdd and a common point in between, typically at the midpoint.

The common voltage becomes the signal ground. The full Vcc becomes the
'plus' voltage. The power supply ground becomes the 'minus' voltage.

This works for all op-amps, although rail-rail types are best suited to low
voltage supplies, such as the 5 V needed in the example.

To connect the pH electrode to a non-inverting voltage follower with a
LMC660, connect one side to the non-inverting input and the other side to
the common point (@ 1/2 VCC). Feedback the output to the non-inverting
input. Voila!

What's the problem?

================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: EraseMEralspam_OUTspamTakeThisOuTlcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

1999\10\19@112754 by Wagner Lipnharski

picon face
LMC660 is a nice amplifier, low cost, low drift, low consume and more,
works great in single +5V supply, one of the type that catch the eye for
price/performance, but with the high impedance input CMOS there is a
catch; is the crazy oscillation if configured as a follower (output
connected to the negative input). The manufacturer recommend to install
a RC network (see documentation) to avoid oscillations in this
configuration.  By other side, if you need a cheap oscillator, just
choose the right RC... :)

Your doubt about negative input, or inverting buffer with a positive
input, is the most common and old problem in instrumentation. This is so
often that they invented the "instrumentation amplifier".  You just need
a reference lower than the signal itself.  Those amplifiers accept
several types of transducers and sensors, mostly bridge configurations,
and they amplify the difference between the + and - inputs.  The same
for any other amplifier? yes, but the negative feedback is NOT done to
the - input, so it doesn't interfere with the input itself.  Those
amplifiers (as any other) need the inputs inside the common mode voltage
(Power + and -), and they are great to reject noise at both inputs
(common mode reject), as 60Hz for example.  Instrumentation amplifiers
can be build with 3 regular op-amp (LMC660 for example), but I usually
do it with only 2 with the same effect, so one LMC660 can produce 2
instrumentation amplifiers.  The good point is that in your case, the
inverting output just need a fixed reference voltage at the + input to
work as adjustment to the output dc component setup (what voltage will
be at the output when the input is zero).  A good inst-amplify cost more
than $10 while the LMC660 is around $2.

If you need some drawing examples, just email me.

Wagner

"Robert A. LaBudde" wrote:
{Quote hidden}

1999\10\19@115138 by hris Fanning

flavicon
face
> At 11:27 PM 10/18/99 -0400, Sean wrote:
> >How can a non-inverting follower work without at least a negative supply? I
> >interpreted "negative reference" to mean "negative supply" in this case.
> >
> >If we could use an inverting buffer, THEN it wouldn't need a negative
> >supply. However, good luck finding a high enough Rin,
>
> As far as I know, you never need to have bipolar supplies. You just need a
> Vss and a Vdd and a common point in between, typically at the midpoint.
>
> The common voltage becomes the signal ground. The full Vcc becomes the
> 'plus' voltage. The power supply ground becomes the 'minus' voltage.

>From what I can tell, you're suggesting to basically connect one end
of the electrode to 2.5V.  I'd then be running current through the
electrode and I'm not sure that's a good thing...

I found an interesting part in the Burr Brown INA116 differential
amplifier.  Not too cheap but seems ideal for this.  Looks really
easy to use too.  Just get a 2.5V reference, plug in a resistor for
gain and I'm set.  My concern would be ESD with this device though.
Any way to help control ESD across really sensitive inputs?

Unless there's a convincing argument otherwise, I think I'm going to
go with this part instead of DIYing a differential amp with lots of
external parts.

The LMC660 looks like a good cheap part.  I'll probably use that for
non-pH inputs.

Thanks for everyone that replied to help me get this input into a PIC.

Chris

1999\10\19@115722 by Robert A. LaBudde

flavicon
face
At 11:11 AM 10/19/99 -0400, Wagner wrote:
>Your doubt about negative input, or inverting buffer with a positive
>input, is the most common and old problem in instrumentation. This is so
>often that they invented the "instrumentation amplifier".  You just need
>a reference lower than the signal itself.  Those amplifiers accept
>several types of transducers and sensors, mostly bridge configurations,
>and they amplify the difference between the + and - inputs.  The same
>for any other amplifier? yes, but the negative feedback is NOT done to
>the - input, so it doesn't interfere with the input itself.  Those
>amplifiers (as any other) need the inputs inside the common mode voltage
>(Power + and -), and they are great to reject noise at both inputs
>(common mode reject), as 60Hz for example.  Instrumentation amplifiers
>can be build with 3 regular op-amp (LMC660 for example), but I usually
>do it with only 2 with the same effect, so one LMC660 can produce 2
>instrumentation amplifiers.  The good point is that in your case, the
>inverting output just need a fixed reference voltage at the + input to
>work as adjustment to the output dc component setup (what voltage will
>be at the output when the input is zero).  A good inst-amplify cost more
>than $10 while the LMC660 is around $2.

Actually, using a difference amplifier solves the requirements for the pH
application with the LMC660, since it's got such a high input impedance.
You'll have to deal with the offset, however, since it's a measurable error
compared to the 60 mV per pH unit.

A good chopper-stabilized instrumentation amplifier actually costs only $3,
not a whole lot more than the LMC660. The advantage is that the offset
voltage problem is removed.

But, again, both chips work fine with only a single 5 V supply.

================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: ralspamspam_OUTlcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

1999\10\19@134926 by Sean Breheny

face picon face
Sorry, Robert, you are right. I was thinking of cases where the input is
already GND referenced, THEN you do need the bipolar supplies,since you
can't float it. However, in this case you are right.

As for the concern over the current thru the electrode, there shouldn't
be any current. The input impedance of the amp is still very high,so
raising the electrode to 2.5v doesn't make any difference.

Sean



On Tue, 19 Oct 1999, Robert A. LaBudde wrote:
{Quote hidden}

1999\10\19@172206 by Robert A. LaBudde

flavicon
face
At 11:11 AM 10/19/99 -0400, Wagner wrote:
>LMC660 is a nice amplifier, low cost, low drift, low consume and more,
>works great in single +5V supply, one of the type that catch the eye for
>price/performance, but with the high impedance input CMOS there is a
>catch; is the crazy oscillation if configured as a follower (output
>connected to the negative input). The manufacturer recommend to install
>a RC network (see documentation) to avoid oscillations in this
>configuration.

I've looked up this problem. You're right: configuring the LMC660 as a
non-inverting voltage follower has a problem. It's due to the input voltage
range not being rail-rail although the output range is. Therefore a lot of
clipping and ringing will occur if the output voltage gets within 2 V of
rail, similar to that of non-rail-rail op-amps.

So connecting the LMC660 as a non-inverting unity gain follower on low
voltage supplies is not advisable.

================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: KILLspamralKILLspamspamlcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

1999\10\19@172834 by Robert A. LaBudde

flavicon
face
At 11:50 AM 10/19/99 -0400, Chris wrote:
>>From what I can tell, you're suggesting to basically connect one end
>of the electrode to 2.5V.  I'd then be running current through the
>electrode and I'm not sure that's a good thing...

One point of voltage reference doesn't make a circuit. It is irrelevant
what the common point signal voltage is, since the pH electrode is not at
earth ground, and the common signal voltage is not connected to earth ground.

This is the same issue as running the Vss on the PIC at ground and Vdd at
-5V. The chip doesn't care, so long as the voltage difference and polarity
are right.

The simplest approach among those suggested is to rig the LMC660 as a unity
gain difference amplifier, followed by a 5x voltage gain stage. The input
impedance is > 10^12 ohms, and only the difference voltage is amplified.
The current flow is only in the pA range. The fact that the output of the
difference amplifier carries a 2.5 V DC offset is irrelevant to the pH
electrode and to the op-amp. The input +/- 0.5 V falls within the swing
allowed with the LMC660, even with a 5 V supply.


================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: RemoveMEralTakeThisOuTspamlcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

1999\10\19@185835 by Wagner Lipnharski

picon face
This is quite [OT] but still related to the original PIC interfacing
problem.

The point here is that even using the pH electrode as an independent
element, just generating the diferential voltage to the op-amp, at least
one op-amp input (-) needs a DC voltage refence to keep all the signal
swing inside the op-amp input common voltage, so the input will not be
"clipped" by the input rail tolerances.  This is a "dc" input
polarization of the op-amp.

A simple 100k resistor to ground or Vcc,  or a voltage divider to
reference to middle vcc, can do the trick.  If you don't do this, the +
and - op-amp inputs will be dc floating and it can "travels" close to
ground or vcc, clipping the input.  As I said in my previous post, only
instrumentation amplifiers don't need this dc polarization, since the
reference is made internaly.

Feedback resistors double as dc polarization (unit or gain
configuration), if the output load goes to a valid input voltage swing.
The feedback to negative input will try to set the "float output ground"
to input.  As experience, install a 100 Ohms resistor at the op-amp
inputs, and a 10k directly from - input to the output (voltage
follower), another 10k from the output to VCC, measure the voltage at
the inputs. Now using a floating transformer apply 1Vpp senoidal signal
across the 100 Ohms resistor at input, scope the output. Move the 1k
load from VCC to ground, repeat the experience. Move the 1k load from
Ground to half VCC, repeat the experience.

Better and easy experience, install a 10k potentiometer extremes to VCC
and Ground, Center pin to the op-amp output via a 10k resistor. Rotate
Pot knob from one extreme to another while scoping op-amp output signal.
When you see some clipping it could not means only output rails
clipping, for voltage followers it is most likelly to be input rails
clipping.

Wagner

"Robert A. LaBudde" wrote:
{Quote hidden}

1999\10\19@195132 by hris Fanning

flavicon
face
> At 11:50 AM 10/19/99 -0400, Chris wrote:
> >>From what I can tell, you're suggesting to basically connect one end
> >of the electrode to 2.5V.  I'd then be running current through the
> >electrode and I'm not sure that's a good thing...
>
> One point of voltage reference doesn't make a circuit. It is irrelevant
> what the common point signal voltage is, since the pH electrode is not at
> earth ground, and the common signal voltage is not connected to earth ground.

The problem is, the solution conducts.  (ie. saltwater)  There will
also be other probes that will require different offsets.  I'll have
to stick with the instrumentation amplifier configuration for everything
it appears.

Now I remember why the idea of running current through it bothered me.

Chris

1999\10\19@202724 by paulb

flavicon
face
Chris Fanning wrote:

> The problem is, the solution conducts.  (ie. saltwater)  There will
> also be other probes that will require different offsets.

 My suggestion (the last time round) was to use a third electrode,
perhaps already a metal part of the container, to set the overall
offset.  You then use instrumentation amplifiers with high impedance to
monitor *both* the glass and AgCl (and PO2 etc...) electrodes and
determine the differential.

 Whether you drive (bias) the bulk solution (container) against your
electronics ground or vice versa is a minor consideration.
--
 Cheers,
       Paul B.

1999\10\20@052154 by Robert A. LaBudde

flavicon
face
At 07:50 PM 10/19/99 -0400, Chris wrote:
>> One point of voltage reference doesn't make a circuit. It is irrelevant
>> what the common point signal voltage is, since the pH electrode is not at
>> earth ground, and the common signal voltage is not connected to earth
ground.
>
>The problem is, the solution conducts.  (ie. saltwater)  There will
>also be other probes that will require different offsets.  I'll have
>to stick with the instrumentation amplifier configuration for everything
>it appears.
>
>Now I remember why the idea of running current through it bothered me.

I must be missing something in this problem. I don't understand the
connection to the conductivity of the solution.

Since the 2.5 V is a common voltage across the electrode, it wouldn't
matter if it was a copper wire instead: no current will flow from a
constant potential on both terminals.

The only current as I can see it which will be drawn from the pH electrode
is the bias current from the op-amp, which is a fraction of a picoamp, so
should be no problem.

The only issue that's been raised so far is in connecting the LMC660 as a
unity gain non-inverter, since the inputs are not rail-rail. This is not a
problem with the pH electrode, since a +/- 0.5 V swing lies within the
allowed range even at 5 V.

I use the LMC660 with battery supplies all the time with either a voltage
divider midpoint reference or a buffered version (since I've got 4 op-amps
on the chip). I've never had a problem of the type discussed.

I'd be interested in hearing a good reason for a bipolar supply, other than
historical ones.

I'm not an EE, so perhaps I'm either not understanding the problem or some
trade-off involved. I am, however, a chemist, so I have some understanding
of  pH electrodes and electrochemical cells. Anything under a nanoamp
shouldn't be a problem.

PS. A single-supply design white paper can be found at:

http://www-s.ti.com/sc/psheets/sloa030/sloa030.pdf



================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: spamBeGoneralspamBeGonespamlcfltd.com
Least Cost Formulations, Ltd.                   URL: http://lcfltd.com/
824 Timberlake Drive                            Tel: 757-467-0954
Virginia Beach, VA 23464-3239                   Fax: 757-467-2947

"Vere scire est per causae scire"
================================================================

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...