Maker Pro
Maker Pro

Interfacing A Pressure Sensor

M

Michael

Jan 1, 1970
0
Hi,

I have a pressure sensor (http://www.farnell.com/datasheets/8717.pdf - page
4) which uses positive and negative pins to output the pressure. As the
pressure increases the (potential) difference between the pins also
increase.

How do I go about interfacing this to a microcontroller (Picaxe 08M - has a
ADC)?

Thanks

Michael
 
P

petrus bitbyter

Jan 1, 1970
0
Michael said:
Hi,

I have a pressure sensor (http://www.farnell.com/datasheets/8717.pdf -
page 4) which uses positive and negative pins to output the pressure. As
the pressure increases the (potential) difference between the pins also
increase.

How do I go about interfacing this to a microcontroller (Picaxe 08M - has
a ADC)?

Thanks

Michael

Michael,

There's nothing about electrical characteristics. As far as I can see from
the schematic you need to connect some power supply to the pins 1 and 3 and
some differential amplifier to the pins 2 and 4. But required voltage and
current of the power supply and expected output signal are al in the dark.

petrus bitbyter
 
C

Chris

Jan 1, 1970
0
Michael said:
Hi,

I have a pressure sensor (http://www.farnell.com/datasheets/8717.pdf - page
4) which uses positive and negative pins to output the pressure. As the
pressure increases the (potential) difference between the pins also
increase.

How do I go about interfacing this to a microcontroller (Picaxe 08M - has a
ADC)?

Thanks

Michael

Hi, Michael. You need a differential amplifier that has essentially
infinite input impedance at both inputs. This differential amplifier
gives as an output the difference between the two voltages. You can
then read that voltage with the dreaded PICAXE. The data sheet doesn't
say anything about the type of output you'd expect, but I'll bet it
will be less than 1V, so you might want to amplify that output voltage.

You can do this with 3/4 of a quad op amp and a handful of
precision-matched resistors, like on page 14 of National
Semiconductor's AN-31, "Differential Input Instrumentation Amplifier"
at the top of the page.

http://www.national.com/an/AN/AN-31.pdf#page=1

Or you can just buy the thing in one IC package called an
instrumentation amp. Analog Devices' AD622 isn't too expensive, and
works great.

http://www.analog.com/UploadedFiles/Data_Sheets/218546992AD622_c.pdf

If this is a bit too complicated, please post again, and indicate what
you don't understand.

Cheers
Chris
 
D

David L. Jones

Jan 1, 1970
0
Michael said:
Hi,

I have a pressure sensor (http://www.farnell.com/datasheets/8717.pdf - page
4) which uses positive and negative pins to output the pressure. As the
pressure increases the (potential) difference between the pins also
increase.

How do I go about interfacing this to a microcontroller (Picaxe 08M - has a
ADC)?

You need a differential amplifier. Depending on the precision you need,
something like the AD620 or AD623 should suffice.

Watch out for temperature, pressure sensors can be notoriously bad over
the temperature range. There are temperature compensated ones
available, so if it's a problem use one of them if possible.

Dave :)
 
M

Michael

Jan 1, 1970
0
David L. Jones said:
You need a differential amplifier. Depending on the precision you need,
something like the AD620 or AD623 should suffice.

Watch out for temperature, pressure sensors can be notoriously bad over
the temperature range. There are temperature compensated ones
available, so if it's a problem use one of them if possible.

Dave :)

Thanks for the replies.

Could I use a LM13700 amp? Datasheet:
http://www.rapidonline.com/netalogue/specs/82-5038.pdf

Michael
 
D

David L. Jones

Jan 1, 1970
0
C

Chris

Jan 1, 1970
0
Michael said:
Thanks for the replies.

Could I use a LM13700 amp? Datasheet:
http://www.rapidonline.com/netalogue/specs/82-5038.pdf

Michael

Hi, Michael. Last call for the LM13700 was about 8 years ago -- it's
obsolete, isn't it?

I'm not sure why you want to use a transconductance amplifier when a
standard op amp will do.

Look. This is for a PICAXE, and I'd guess this is for a class in the
U.K. Also, I would suppose you're looking for the lowest cost, easiest
solution here. Let's start from the beginning, and see what you need
to get this done.

First, you didn't mention which model of PICAXE you're using. It's one
with analog inputs, I'm assuming more than one. Your PICAXE gives a
result from 0 to 255 for an analog conversion with the "readadc"
command. That's an 8-bit A to D converter.

http://www.rev-ed.co.uk/docs/picaxe_manual1.pdf

See p.39. Now, since you neglected to mention the model of your
sensor, I've got to make some assumptions here. Let's assume you've
got an output span (that's the difference in voltage between terminal 2
and terminal 4) of 200mV to 400mV. You could take your Wheatstone
bridge sensor and just attach the two terminals (2 and 4) to 2 inputs.
That would initially seem like the easiest, and it is. The problem is,
you won't get much of a result. Here's why.

Your Wheatstone bridge gives a differential output. Some of the types
referred to in the data sheet you link have a full scale span of 200mV.
That means that terminal 2 will be, say, 2.4V, and terminal 4 will be
2.6V. When you readadc these with the PIC you will get results of 122
and 133. If you subtract, the difference will be 10. That means your
sensor, which is made to measure pressure of, say, 0-15psi with 5%
accuracy, will only give you a number 10 for 15psi and 0 for 0psi.
That's *very* poor resolution, and is basically wasting all the
precision of the sensor -- 1.5psi per count.

Now, if you can find a way to electronically subtract the difference
between the two outputs, and then amplify it, you will have a much more
precise reading. If you subtracted and then multiplied by 10, you
would have a 0 to 2V reading, which would correspond to a number 0 to
102 or so. That will give you a reading of about 0.15psi per count,
much more information.

Op amps are made to do this type of thing. You could easily do it with
just one op amp, except that a standard difference amplifier
configuration would load down the Wheatstone bridge and mess up the
voltage divider. It would be better to use the type of op amp setup I
mentioned above.

If you've got an LM324 in the class (the world's most popular op amp),
an ohmmeter, and a handful of 10K and 100K resistors, you can put
together a three op amp difference amplifier (instrumentation
amplifier) that will get you an "A". Looking at the National
Semiconductor reference shown above, you'll see that the first two op
amps are basically voltage followers. The third is a standard
difference amp (view in fixed font or M$ Notepad):

|
| VCC
| +
| |
| o----.
| | |
| .-. .-.
| | | | | .---------.
| | | | | | |
| '-' '-' | |
| | | | |\| |
| | | '--|-\ | ___ ___
| | | | >---o-|___|--o--|___|---.
| o----)--------|+/ 10K | 100K |
| | | |/ | |
| | | 1/4 LM324 | |
| | | | |\ |
| | | '--|-\ | Vout
| Sensor | >----o---o
| | | .--|+/
| | | | |/
| | | 1/4 LM324 | 1/4 LM324
| | | |\ |
| | o--------|+\ ___ | ___
| | | | >---o-|___|--o--|___|---.
| | | .--|-/ | 10K 100K |
| .-. .-. | |/| | ===
| | | | | | | GND
| | | | | | |
| '-' '-' '---------'
| | |
| o----'
| |
| ===
| GND
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

For classroom purpose, just find the two 10K resistors that are closest
to each other, and the two 100K resistors that are closest to each
other. As it says in the appnote, if you match the resistors like
this, the gain will be 100K / 10K, or 10. So your 200mV differential
input signal will be converted to a ground-referenced 0-2V signal you
can read with one PICAXE input.

http://www.national.com/ds.cgi/LM/LM124.pdf

I hope this has been of help. Please feel free to post again if you
need more help, and let us know how it goes.

Cheers
Chris
 
M

Michael

Jan 1, 1970
0
Chris said:
Hi, Michael. Last call for the LM13700 was about 8 years ago -- it's
obsolete, isn't it?

I'm not sure why you want to use a transconductance amplifier when a
standard op amp will do.

Look. This is for a PICAXE, and I'd guess this is for a class in the
U.K. Also, I would suppose you're looking for the lowest cost, easiest
solution here. Let's start from the beginning, and see what you need
to get this done.

First, you didn't mention which model of PICAXE you're using. It's one
with analog inputs, I'm assuming more than one. Your PICAXE gives a
result from 0 to 255 for an analog conversion with the "readadc"
command. That's an 8-bit A to D converter.

http://www.rev-ed.co.uk/docs/picaxe_manual1.pdf

See p.39. Now, since you neglected to mention the model of your
sensor, I've got to make some assumptions here. Let's assume you've
got an output span (that's the difference in voltage between terminal 2
and terminal 4) of 200mV to 400mV. You could take your Wheatstone
bridge sensor and just attach the two terminals (2 and 4) to 2 inputs.
That would initially seem like the easiest, and it is. The problem is,
you won't get much of a result. Here's why.

Your Wheatstone bridge gives a differential output. Some of the types
referred to in the data sheet you link have a full scale span of 200mV.
That means that terminal 2 will be, say, 2.4V, and terminal 4 will be
2.6V. When you readadc these with the PIC you will get results of 122
and 133. If you subtract, the difference will be 10. That means your
sensor, which is made to measure pressure of, say, 0-15psi with 5%
accuracy, will only give you a number 10 for 15psi and 0 for 0psi.
That's *very* poor resolution, and is basically wasting all the
precision of the sensor -- 1.5psi per count.

Now, if you can find a way to electronically subtract the difference
between the two outputs, and then amplify it, you will have a much more
precise reading. If you subtracted and then multiplied by 10, you
would have a 0 to 2V reading, which would correspond to a number 0 to
102 or so. That will give you a reading of about 0.15psi per count,
much more information.

Op amps are made to do this type of thing. You could easily do it with
just one op amp, except that a standard difference amplifier
configuration would load down the Wheatstone bridge and mess up the
voltage divider. It would be better to use the type of op amp setup I
mentioned above.

If you've got an LM324 in the class (the world's most popular op amp),
an ohmmeter, and a handful of 10K and 100K resistors, you can put
together a three op amp difference amplifier (instrumentation
amplifier) that will get you an "A". Looking at the National
Semiconductor reference shown above, you'll see that the first two op
amps are basically voltage followers. The third is a standard
difference amp (view in fixed font or M$ Notepad):

|
| VCC
| +
| |
| o----.
| | |
| .-. .-.
| | | | | .---------.
| | | | | | |
| '-' '-' | |
| | | | |\| |
| | | '--|-\ | ___ ___
| | | | >---o-|___|--o--|___|---.
| o----)--------|+/ 10K | 100K |
| | | |/ | |
| | | 1/4 LM324 | |
| | | | |\ |
| | | '--|-\ | Vout
| Sensor | >----o---o
| | | .--|+/
| | | | |/
| | | 1/4 LM324 | 1/4 LM324
| | | |\ |
| | o--------|+\ ___ | ___
| | | | >---o-|___|--o--|___|---.
| | | .--|-/ | 10K 100K |
| .-. .-. | |/| | ===
| | | | | | | GND
| | | | | | |
| '-' '-' '---------'
| | |
| o----'
| |
| ===
| GND
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)

For classroom purpose, just find the two 10K resistors that are closest
to each other, and the two 100K resistors that are closest to each
other. As it says in the appnote, if you match the resistors like
this, the gain will be 100K / 10K, or 10. So your 200mV differential
input signal will be converted to a ground-referenced 0-2V signal you
can read with one PICAXE input.

http://www.national.com/ds.cgi/LM/LM124.pdf

I hope this has been of help. Please feel free to post again if you
need more help, and let us know how it goes.

Cheers
Chris

Thanks Chris,

I did say which PICAXE I was using in the original post - 08M.

The reason I asked about the other one is that I'm in the UK and that was
the one my usual supplier has.

It's not for a classroom project, although my knowledge is about that level.

Having looked at the costs for a LM124 (£26GBP http://tinyurl.com/em3xx )
I'll have a play with the LM324

Cheers,

Michael
 
C

Chris

Jan 1, 1970
0
Michael said:
Thanks Chris,

I did say which PICAXE I was using in the original post - 08M.

The reason I asked about the other one is that I'm in the UK and that was
the one my usual supplier has.

It's not for a classroom project, although my knowledge is about that level.

Having looked at the costs for a LM124 (£26GBP http://tinyurl.com/em3xx)
I'll have a play with the LM324

Cheers,

Michael

Hi, Michael. You could try RS -- they've got the LM324N listed as
their p/n 268-0002 at £0.30 ea. Try to match your two pairs of
resistors to better than 1% of each other for best results. You might
want to buy 10 of each of the 10k and 100K to get a best match.

But even so, you'll get much better results with an op amp than just
using the PICAXE by itself.

Good luck on your efforts -- you seem to be doing a good job of
teaching yourself. Feel free to post again.

Cheers
Chris
 
M

Michael

Jan 1, 1970
0
Thanks Chris,

I did say which PICAXE I was using in the original post - 08M.

The reason I asked about the other one is that I'm in the UK and that was
the one my usual supplier has.

It's not for a classroom project, although my knowledge is about that
level.

Having looked at the costs for a LM124 (£26GBP http://tinyurl.com/em3xx )
I'll have a play with the LM324

Cheers,

Michael

Hi, Michael. You could try RS -- they've got the LM324N listed as
their p/n 268-0002 at £0.30 ea. Try to match your two pairs of
resistors to better than 1% of each other for best results. You might
want to buy 10 of each of the 10k and 100K to get a best match.

But even so, you'll get much better results with an op amp than just
using the PICAXE by itself.

Good luck on your efforts -- you seem to be doing a good job of
teaching yourself. Feel free to post again.

Cheers
Chris

Thanks Chris,

The parts are on order - let you know how it goes...

Michael
 
Top