Need beginner pressure sensor help
Archiver
Posts: 46,084
Hi all, I just got started messing around with a BS2 stamp. It's lots
of fun so far, right now I'm trying to make it measure the vacuum in
my engine. I've got it working, and even have it interfaced with my
laptop so I can watch it change as the engine revs. My problem is
that I can't seem to get a wide range out of my pressure sensor. I
ordered Newark part #16F3197. Data sheet can be found at
http://catalog.micro.honeywell.com/pdbdownload/images/24pc.series.char
t.5.pdf
It works, but the output changes on the order of mV per PSI of
pressure change. I have it connected to an ADC8031. It only seems to
have a range of 7 or 8 out of 255. I am new to this stuff so I'm not
sure if my terminology is correct, but it seems the resolution of the
ADC is ok, I just need a wider output range from the pressure sensor.
Is this correct? Is there a simple way I can do this? I am pretty
sure this can be done using the ADC8031, but so far I have not
figured it out. I have the output of the pressure sensor (which is
approx 2.5v at normal atmosphere) going to Vin(+) on the ADC. What
should I do with the Vin(-) and Vref pins? I think they are the
answer to my question! Thanks for any help, this thing is a great
learning tool, and a good way to spend lots of money eh?
of fun so far, right now I'm trying to make it measure the vacuum in
my engine. I've got it working, and even have it interfaced with my
laptop so I can watch it change as the engine revs. My problem is
that I can't seem to get a wide range out of my pressure sensor. I
ordered Newark part #16F3197. Data sheet can be found at
http://catalog.micro.honeywell.com/pdbdownload/images/24pc.series.char
t.5.pdf
It works, but the output changes on the order of mV per PSI of
pressure change. I have it connected to an ADC8031. It only seems to
have a range of 7 or 8 out of 255. I am new to this stuff so I'm not
sure if my terminology is correct, but it seems the resolution of the
ADC is ok, I just need a wider output range from the pressure sensor.
Is this correct? Is there a simple way I can do this? I am pretty
sure this can be done using the ADC8031, but so far I have not
figured it out. I have the output of the pressure sensor (which is
approx 2.5v at normal atmosphere) going to Vin(+) on the ADC. What
should I do with the Vin(-) and Vref pins? I think they are the
answer to my question! Thanks for any help, this thing is a great
learning tool, and a good way to spend lots of money eh?
Comments
> Hi all, I just got started messing around with a BS2 stamp. It's
lots
> of fun so far, right now I'm trying to make it measure the vacuum
in
> my engine. I've got it working, and even have it interfaced with my
> laptop so I can watch it change as the engine revs. My problem is
> that I can't seem to get a wide range out of my pressure sensor. I
> ordered Newark part #16F3197. Data sheet can be found at
>
http://catalog.micro.honeywell.com/pdbdownload/images/24pc.series.char
> t.5.pdf
>
> It works, but the output changes on the order of mV per PSI of
> pressure change. I have it connected to an ADC8031. It only seems
to
> have a range of 7 or 8 out of 255. I am new to this stuff so I'm
not
> sure if my terminology is correct, but it seems the resolution of
the
> ADC is ok, I just need a wider output range from the pressure
sensor.
> Is this correct? Is there a simple way I can do this? I am pretty
> sure this can be done using the ADC8031, but so far I have not
> figured it out. I have the output of the pressure sensor (which is
> approx 2.5v at normal atmosphere) going to Vin(+) on the ADC. What
> should I do with the Vin(-) and Vref pins? I think they are the
> answer to my question! Thanks for any help, this thing is a great
> learning tool, and a good way to spend lots of money eh?
It sounds like you need to use an op-amp to narrow the input of the
ADC.
If your sensor ( didn't get the link to work ) has a range of zero to
30 inches of vacuume, and your engine has 5 inches at idle and 15
inches at full power, then you are only using 30% of the range.
And op-amp would allow you to shift your values to an input of 1 volt
from the sensor was shifted to be zero volts on the ADC.
Of course, you would need another stage of the op-amp to expand the
span of the signal.
that second stage could be adjusted so 1 volt in from the sensor ( or
really 1 volt above your reading) could be amplified to 5 volts out
of the op-amp to your ADC.
These would typically be called zero and span adjustments.
Dave
> If your sensor ( didn't get the link to work ) has a range of zero...
<lots of interesting stuff removed>
"Tiny URL" <http://www.tinyurl.com> is your friend when posting long URLs
to mailing lists.. so this:
>> http://catalog.micro.honeywell.com/pdbdownload/images/24pc.
>> series.chart.5.pdf
becomes this:
http://tinyurl.com/2lr8r
[noparse]:)[/noparse]
Vern
--
Vern Graner CNE/CNA/SSE | "If the network is down, then you're
Senior Systems Engineer | obviously incompetent so why are we
Texas Information Services | paying you? Of course, if the network
http://www.txis.com | is up, then we obviously don't need
Austin Office 512 328-8947 | you, so why are we paying you?" ©VLG
> Dave Mucha said:
> > If your sensor ( didn't get the link to work ) has a range of
zero...
> <lots of interesting stuff removed>
>
> "Tiny URL" <http://www.tinyurl.com> is your friend when posting
long URLs
> to mailing lists.. so this:
>
> >> http://catalog.micro.honeywell.com/pdbdownload/images/24pc.
> >> series.chart.5.pdf
>
> becomes this:
>
> http://tinyurl.com/2lr8r
>
> [noparse]:)[/noparse]
>
> Vern
Thanks !
it looks like a simple wheatstone bridge.
the dual op-amp should do the trick to get the signal conditoind to
offer the ADC a better range.
Dave
>
> --
> Vern Graner CNE/CNA/SSE | "If the network is down, then you're
> Senior Systems Engineer | obviously incompetent so why are we
> Texas Information Services | paying you? Of course, if the network
> http://www.txis.com | is up, then we obviously don't need
> Austin Office 512 328-8947 | you, so why are we paying you?" ©VLG
> pressure change. I have it connected to an ADC8031.
> [noparse][[/noparse]...]
> I have the output of the pressure sensor (which is
> approx 2.5v at normal atmosphere) going to Vin(+) on the ADC. What
> should I do with the Vin(-) and Vref pins? I think they are the
> answer to my question! Thanks for any help, this thing is a great
> learning tool, and a good way to spend lots of money eh?
See: <http://www.electromics.com/palmonizer/palmonizer_circuit.html#adc>
--
Enjoy,
George Warner,
Schizophrenic Optimization Scientists
Apple Developer Technical Support (DTS)
> It sounds like you need to use an op-amp to narrow the input of the
> ADC.
Or you could narrow the range of the reference voltages to the ADC.
> If your sensor ( didn't get the link to work ) has a range of zero to
> 30 inches of vacuum, and your engine has 5 inches at idle and 15
> inches at full power, then you are only using 30% of the range.
>
> And op-amp would allow you to shift your values to an input of 1 volt
> from the sensor was shifted to be zero volts on the ADC.
Just set the -Vref to minimum expected voltage and the +Vref to the maximum
expected voltage and you'll get that range broken into the 12 bits of
resolution of the ADC.
For example say that you're expecting an input between 2 & 4 volts. Create a
series resistance chain (or ladder) from +5V to ground of 1K, 2K & 2K. This
will create two reference voltages of 4 and 2 volts. Connect the 4V to +Vref
and 2V to -Vref. Now the 2 volt range between these two references voltages
will be broken into 4098 (2^12) steps by the ADC. A value of 0 would be 2V,
a value of 1024 would be 2.5V, a value of 2048 would be +3V, and a value of
4095 would be 5V, etc.
--
Enjoy,
George Warner,
Schizophrenic Optimization Scientists
Apple Developer Technical Support (DTS)
> > --- In basicstamps@yahoogroups.com, "Adam" <fungus2112@h...>
wrote:
> > It sounds like you need to use an op-amp to narrow the input of
the
> > ADC.
>
> Or you could narrow the range of the reference voltages to the ADC.
>
> > If your sensor ( didn't get the link to work ) has a range of
zero to
> > 30 inches of vacuum, and your engine has 5 inches at idle and 15
> > inches at full power, then you are only using 30% of the range.
> >
> > And op-amp would allow you to shift your values to an input of 1
volt
> > from the sensor was shifted to be zero volts on the ADC.
>
> Just set the -Vref to minimum expected voltage and the +Vref to the
maximum
> expected voltage and you'll get that range broken into the 12 bits
of
> resolution of the ADC.
>
> For example say that you're expecting an input between 2 & 4 volts.
Create a
> series resistance chain (or ladder) from +5V to ground of 1K, 2K &
2K. This
> will create two reference voltages of 4 and 2 volts. Connect the 4V
to +Vref
> and 2V to -Vref. Now the 2 volt range between these two references
voltages
> will be broken into 4098 (2^12) steps by the ADC. A value of 0
would be 2V,
> a value of 1024 would be 2.5V, a value of 2048 would be +3V, and a
value of
> 4095 would be 5V, etc.
I'm a little confused.
The origional poster said he was using the ADC8031 and there is also
a ADC08031 and an ADC0831...
But it seems as though they are all 8 bit devices, not 12 bit. So
the bit count is 256. Not a big deal, but a little techincal point.
Also, there are 8 pin chips that will have Vref and ground, but not a
+Vref and -Vref, or Vref and AGnd.
Since the 8 pin units are 3 wire serial , you have Vcc, Gnd, A0 and
A1, Do, Di, CS and CLK.
I haven't tried using different ground and Vcc values on this
particular chip. but, if it works, then it is a very simple method
of setting the range.
BTY, one should ALWAYS tie the AGnd and Board Vcc to the reference
pins when available. We found the voltage regulators were off by a
few mV and it changed the readings enough to be a problem.
Dave
Dave
>
> --
> Enjoy,
> George Warner,
> Schizophrenic Optimization Scientists
> Apple Developer Technical Support (DTS)
> a ADC08031 and an ADC0831...
>
> But it seems as though they are all 8 bit devices, not 12 bit. So
> the bit count is 256. Not a big deal, but a little techincal point.
My bad; They're 8-bit devices, not 12. Thinking of the one with 8-channel
mux and 12-bit ADC.
> Also, there are 8 pin chips that will have Vref and ground, but not a
> +Vref and -Vref, or Vref and AGnd.
> Since the 8 pin units are 3 wire serial , you have Vcc, Gnd, A0 and
> A1, Do, Di, CS and CLK.
There is a +Vin and a -Vin. The ADC is the voltage difference (lab diff op
amp) between these two values so in effect -Vin is the -Vref.
> I haven't tried using different ground and Vcc values on this
> particular chip. but, if it works, then it is a very simple method
> of setting the range.
Vcc has to be +5V. But Vref & -Vin can be anything (less that 5V?).
--
Enjoy,
George Warner,
Schizophrenic Optimization Scientists
Apple Developer Technical Support (DTS)
> > The origional poster said he was using the ADC8031 and there is
also
> > a ADC08031 and an ADC0831...
> >
> > But it seems as though they are all 8 bit devices, not 12 bit. So
> > the bit count is 256. Not a big deal, but a little techincal
point.
>
> My bad; They're 8-bit devices, not 12. Thinking of the one with 8-
channel
> mux and 12-bit ADC.
>
> > Also, there are 8 pin chips that will have Vref and ground, but
not a
> > +Vref and -Vref, or Vref and AGnd.
Thanks guys. George, I tried your idea without even knowing if it
would work, unfortunately, there seems to be something I'm not doing
right. I set up a voltage divider so I have approx 2.75v at Vref, and
2.45v at -Vin. While this works (previously, the output would be 130
and vary by +/- 3 depending on pressure, and now it is 6 and varies
by +/- 5) it still isn't working as it should. Is this a limitation
of the chip over such a small range? I would like to give the op amp
idea a try, but don't know anything about them. Does anyone have a
typical example they could show me? Any other problems I should be
aware of that I might have wrong? Thanks!
> > Since the 8 pin units are 3 wire serial , you have Vcc, Gnd, A0
and
> > A1, Do, Di, CS and CLK.
>
> There is a +Vin and a -Vin. The ADC is the voltage difference (lab
diff op
> amp) between these two values so in effect -Vin is the -Vref.
>
> > I haven't tried using different ground and Vcc values on this
> > particular chip. but, if it works, then it is a very simple
method
> > of setting the range.
>
> Vcc has to be +5V. But Vref & -Vin can be anything (less that 5V?).
>
> --
> Enjoy,
> George Warner,
> Schizophrenic Optimization Scientists
> Apple Developer Technical Support (DTS)
> would work, unfortunately, there seems to be something I'm not
doing
> right. I set up a voltage divider so I have approx 2.75v at Vref,
and
> 2.45v at -Vin. While this works (previously, the output would be
130
> and vary by +/- 3 depending on pressure, and now it is 6 and varies
> by +/- 5) it still isn't working as it should.
This is odd. If you set the +Vref to a voltage near the maximum
input voltage, then your ADC should see your maximum input as 256 or
above 200 at least.
Halving your voltage is similar to doubling your range. so I would
expect getting a sensitivity as double the previous.
For the op-amp circuit, Radio Shack has a couple books. one is a
larger book on electronics and another is a small booklet on op-amps.
both will show the typical circuits.
Don't use the 741 as it needs a negative voltage. I'm not sure if
you have any op-amps, but the connection is simple enough.
put a 5k pot on the output and connect it to the + input.
put a 10k resistor on your signal line and connect that to your +
input.
connect the - input to common ground.
The pot will act as the gain adjustment.
I'm not sure where your low signal value is, but you could use a
voltage divider with a pair of resistors to drop it so it is less
than 1 volt.
remember, the gain will amplify all the values.
If you want to use the op-amp to drop the low value, you can use a
pair of resistors in a voltage divider to get a voltage near your
lowest reading. That would be a steady state voltage. connect that
to your - input on the op-amp instead of connecting the -In to
ground. It becomes the reference for the signal and subtracts that
value from both sides.
So, if you had a signal of 1.5 to 1.75 volts and only used a gain of
2.5 your 1.75 would be 4.375, but your 1.5 would also rise to 3.7.
the old range was 0.25, the new range is 0.675.
If you used a voltage divider on the op-amp and input
1 volt on the -in line the op-amp would see a difference in signals
as 0.5 at low and 0.75 at high. Then with a larger gain, say 6, the
op-amp would output 3 and 4.5 respectively or a span of 1.5.
increase the reference value on -in and bring your lower reading
closer to zero and you can increase your gain even more.
Any op-amp will work fine for this. you do not need anything
special, but should look for a single voltge type. or really cheap
if you have the +/- power supply.
If you hear the term rail to rail it means that the op-amp can output
values near it's ground value and near it's input value. non-rail to
rail will not be able to out 5 volts with a 5 volt power supply, but
will be somewhat less.
in this case, that is not really important as your values and
components will have enough from environmental effects to make
chasing the few fractions of a volt very complicated and expensive.
A jelly bean op-amp, LM324 or such will be under a buck in the
catalogues
probably should have used that ASCII schematic editor in the files
section to lay this out.
Dave
tomorrow. One question, how do you figure out the gain based on the
resistors? In a book I have it gives various formulas, but for that
conifguration it would appear to be a gain of less than 1, if it
really is 5k/10k = gain. Or do I have that backwards? Thanks again!
>
> put a 5k pot on the output and connect it to the + input.
> put a 10k resistor on your signal line and connect that to your +
> input.
>
> connect the - input to common ground.
>
> The pot will act as the gain adjustment.
>
>
> I'm not sure where your low signal value is, but you could use a
> voltage divider with a pair of resistors to drop it so it is less
> than 1 volt.
>
> remember, the gain will amplify all the values.
>
> If you want to use the op-amp to drop the low value, you can use a
> pair of resistors in a voltage divider to get a voltage near your
> lowest reading. That would be a steady state voltage. connect
that
> to your - input on the op-amp instead of connecting the -In to
> ground. It becomes the reference for the signal and subtracts that
> value from both sides.
>
> So, if you had a signal of 1.5 to 1.75 volts and only used a gain
of
> 2.5 your 1.75 would be 4.375, but your 1.5 would also rise to 3.7.
> the old range was 0.25, the new range is 0.675.
>
> If you used a voltage divider on the op-amp and input
> 1 volt on the -in line the op-amp would see a difference in signals
> as 0.5 at low and 0.75 at high. Then with a larger gain, say 6,
the
> op-amp would output 3 and 4.5 respectively or a span of 1.5.
>
> increase the reference value on -in and bring your lower reading
> closer to zero and you can increase your gain even more.
>
> Any op-amp will work fine for this. you do not need anything
> special, but should look for a single voltge type. or really cheap
> if you have the +/- power supply.
>
> If you hear the term rail to rail it means that the op-amp can
output
> values near it's ground value and near it's input value. non-rail
to
> rail will not be able to out 5 volts with a 5 volt power supply,
but
> will be somewhat less.
>
> in this case, that is not really important as your values and
> components will have enough from environmental effects to make
> chasing the few fractions of a volt very complicated and expensive.
>
> A jelly bean op-amp, LM324 or such will be under a buck in the
> catalogues
>
> probably should have used that ASCII schematic editor in the files
> section to lay this out.
>
>
> Dave
> Dave, I got an LM324, will try to hook it up as you described
> tomorrow. One question, how do you figure out the gain based on the
> resistors? In a book I have it gives various formulas, but for that
> conifguration it would appear to be a gain of less than 1, if it
> really is 5k/10k = gain. Or do I have that backwards? Thanks again!
There are a few ways to go.
The resistor between your + input and your signal is R1 and the
feedback from your output to the + input pin is R2. Select the ratio
between those two for your gain. If you have a 10k ohm on R1 and a
100k ohm of R2 you have a 10:1 ration and a gain of 10. There is a
little more to it, but that will get you into the ball park.
Remember when selecting a pot, try to shoot for 50 to 80% of the
value. if you needed 10:1 and selected 100k pot, you have no
adjustment.
Tracy Allen is the Guru for op-amps on here. He has a way of
explaining just the bits of important information for your circuit in
a clear manner.
Nation Semi has an interactive section on their site I think it's
called Web Bench.
http://www.national.com/pf/LM/LM324.html
It will let you put in different values and walk you thru the
selection steps and offer you a parts list. It does not offer any
theory so you don't know WHY those work. Look on the left of the
page for how to link there.
Texas Instruments offers "Op-AMPS FOR EVERYONE" a pretty extensive
book on op-amps. It is free from the TI website.
http://focus.ti.com/docs/apps/catalog/resources/appnoteabstract.jhtml?
abstractName=slod006b
but, is a large book and not light reading.
but, my favorite for the introduction to op-amps is the Forrest Mimms
booklet at Radio Shack.
Hope that helps.
Dave
> >
> > put a 5k pot on the output and connect it to the + input.
> > put a 10k resistor on your signal line and connect that to your +
> > input.
> >
> > connect the - input to common ground.
> >
> > The pot will act as the gain adjustment.
> >
> >
> > I'm not sure where your low signal value is, but you could use a
> > voltage divider with a pair of resistors to drop it so it is less
> > than 1 volt.
> >
> > remember, the gain will amplify all the values.
> >
> > If you want to use the op-amp to drop the low value, you can use
a
> > pair of resistors in a voltage divider to get a voltage near your
> > lowest reading. That would be a steady state voltage. connect
> that
> > to your - input on the op-amp instead of connecting the -In to
> > ground. It becomes the reference for the signal and subtracts
that
> > value from both sides.
> >
> > So, if you had a signal of 1.5 to 1.75 volts and only used a gain
> of
> > 2.5 your 1.75 would be 4.375, but your 1.5 would also rise to
3.7.
> > the old range was 0.25, the new range is 0.675.
> >
> > If you used a voltage divider on the op-amp and input
> > 1 volt on the -in line the op-amp would see a difference in
signals
> > as 0.5 at low and 0.75 at high. Then with a larger gain, say 6,
> the
> > op-amp would output 3 and 4.5 respectively or a span of 1.5.
> >
> > increase the reference value on -in and bring your lower reading
> > closer to zero and you can increase your gain even more.
> >
> > Any op-amp will work fine for this. you do not need anything
> > special, but should look for a single voltge type. or really
cheap
> > if you have the +/- power supply.
> >
> > If you hear the term rail to rail it means that the op-amp can
> output
> > values near it's ground value and near it's input value. non-
rail
> to
> > rail will not be able to out 5 volts with a 5 volt power supply,
> but
> > will be somewhat less.
> >
> > in this case, that is not really important as your values and
> > components will have enough from environmental effects to make
> > chasing the few fractions of a volt very complicated and
expensive.
> >
> > A jelly bean op-amp, LM324 or such will be under a buck in the
> > catalogues
> >
> > probably should have used that ASCII schematic editor in the
files
> > section to lay this out.
> >
> >
> > Dave