Re: Interfacing A Pressure Sensor
- From: "Chris" <cfoley1064@xxxxxxxxx>
- Date: 14 Sep 2006 14:56:27 -0700
Michael wrote:
"Chris" <cfoley1064@xxxxxxxxx> wrote in message
news:1158207226.810646.85840@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Michael wrote:
"David L. Jones" <altzone@xxxxxxxxx> wrote in message
news:1158114551.781626.130920@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Michael wrote:
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 :)
Thanks for the replies.
Could I use a LM13700 amp? Data***:
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 *** 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
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
.
- Follow-Ups:
- Re: Interfacing A Pressure Sensor
- From: Michael
- Re: Interfacing A Pressure Sensor
- References:
- Interfacing A Pressure Sensor
- From: Michael
- Re: Interfacing A Pressure Sensor
- From: David L. Jones
- Re: Interfacing A Pressure Sensor
- From: Michael
- Re: Interfacing A Pressure Sensor
- From: Chris
- Re: Interfacing A Pressure Sensor
- From: Michael
- Interfacing A Pressure Sensor
- Prev by Date: Re: How Many Of You Had To Teach Yourself The Math?
- Next by Date: Re: Question on cell phone stuff
- Previous by thread: Re: Interfacing A Pressure Sensor
- Next by thread: Re: Interfacing A Pressure Sensor
- Index(es):