Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Pressure Sensor

Status
Not open for further replies.

brentonw2004

New Member
Hello everyone. I am currently working on a project where I am trying to convert the signal from an uncompensated/unamplified pressure sensor into a meaningfull signal that I can use a PIC to convert the pressure into an actual PSI/bar reading. Here is the sensor I am using: http://catalog.sensing.honeywell.com/datasheet.asp?FAM=Pressure&PN=24PCBFA6G . I have searched the internet quite a bit and not really found anything usefull. Any advice would be greatly appreciated. Also, I found this sensor which I believe would work a lot better if anyone could help me locate it: http://catalog.sensing.honeywell.com/datasheet.asp?FAM=Pressure&PN=40PC030G1A . Thanks!

-Brent
 
The schematic of the part is given on the data sheet. Basically it is the same as using a thermistor in a bridge. Except that in this case, the ambient pressure can also affect the measurement (since it is on one side of the bridge). The sensor measures the differential pressure between ambient and the input. It outputs a voltage proportional to dP. So you feed it with a constant current from pins 1-3, though you can probably just put 5-10 V across it to get 1-2mA of current since they specify the typical input resistance. Then just measure the differential voltage across pins 2 and 4. I would use (one or more) opamps to buffer the signal for your ADC. The exact topology would depend on what ADC you are going to use because some can take differential inputs.
 
You trying to take a barometric pressure reading or a gauge pressure?

These are better sensors for absolute baro pressure, the scale is limited to what's possible from sea level to several 100k feet. They're also buffered (I think so at least they are, the specs are not clear). The pressure sender you list would need an op amp to buffer the output.

https://www.electro-tech-online.com/custompdfs/2004/08/MPXA4101AC.pdf
https://www.electro-tech-online.com/custompdfs/2004/08/MPX4115A20MPXA4115A20SERIES.pdf

So, back to the same standard question- just what are you trying to do??
 
I am trying to take a gauge reading... What type of circuit would I have to use to amplify the output voltage of I think 330mV to a 0v to +5v for the ADC? Could you do it with a lm324 quad amp?
 
That is an interesting idea. I did not know that you could set the reference point on an ADC, I thought it was simply a variable between 0v and 5v. Do you have anything that would help explain how to do this? Thanks for your advice!

-Brent
 
brentonw2004 said:
That is an interesting idea. I did not know that you could set the reference point on an ADC, I thought it was simply a variable between 0v and 5v. Do you have anything that would help explain how to do this? Thanks for your advice!

Most A2D converters allow you to set the -ve and +ve reference points, certainly internal ones in PIC's do - I often use a 2.5V precision voltage reference IC in my PIC projects.

However, there are limits to how far you can stretch them, and (at least on PIC's) both references must be positive as well. You could set the negative reference to 1V and the positive reference to 4V, the span of the A2D would then be 1V to 4V.

The datasheet for your A2D should explain the options available to you.
 
Nigel Goodwin said:
Most A2D converters allow you to set the -ve and +ve reference points, certainly internal ones in PIC's do - I often use a 2.5V precision voltage reference IC in my PIC projects.

Awww, Nigel, I thought you'd know better than to do that with a PIC. Spec sheet never comes out and says it, but the errors involved in using any reference below 5V are so much greater (350% @2.5V) that it's more accurate to use a 5V ref as long as you can find the dropout to drive it (can't drive a 5V pvr from a 5v line).

Anyways, back to the original question:
1. Calculate in the error from an op amp's offset as well. LM324 is 3mV which is around 1% of the possible fullscale. Now if the pressures you're interested in are only 10% of the fullscale, the offset error's more significant.
2. Then add in the possible gain errors from resistor inaccuracies. The best ones are 2% each.
3. Does the pressure unit have an output impedance too high for the PIC's ADC?

See, the thing is, pressure senders are inherently very noisy. You can use this to your advantage. If you oversample a crapload of readings- like 1024- the average will be just like a 20-bit ADC, although the ADC's offset error will still be present. This is still many readings per second. I got enough accuracy with 4096 samples to take an absolute barometric pressure sensor down to a few feet of relative accuracy. No amplification or buffering used. It's fun- walk up the stairs, see the readings go down, walk down the stairs, see the readings to up.
 
Oznog said:
Awww, Nigel, I thought you'd know better than to do that with a PIC. Spec sheet never comes out and says it, but the errors involved in using any reference below 5V are so much greater (350% @2.5V) that it's more accurate to use a 5V ref as long as you can find the dropout to drive it (can't drive a 5V pvr from a 5v line).

I've never heard any suggestion of that, what are your sources?.

As you say, using a 5V reference is difficult with only a 5V supply, which is why I use a 2.5V one.
 
PIC spec sheets. On PIC18F452/252, they're Fig23-28 & 23-29, pg 302/302.

Actually, looking at them again, the inaccuracy goes up 3.5x LSBs when Vdd AND VrefH drop to 2.5V.

If you drop VrefH from 5V to an external 2.5V PVR, the inaccuracy only goes up 2.4x in terms of LSBs. The LSB is 2x finer, so the net inaccuracy is now 1.2x, or 20% poorer. Also, the spec only bothers to list an offset err of +/-1.5V at Vdd=Vref=5.0V, but logically that offset error is going to be a fixed DC voltage (+/-7.33 mV) and will not decrease will a decrease in Vref. I could be wrong, but I doubt it. Anybody want to do a precision experiment? Or maybe I should just ask Microchip to be sure.

Of course, if this is versus using an LM7805 with a tolerance of +/-4%, that's +/- 41 full scale codes right there so it dwarfs the internal PIC inaccuracies IF you're measuing an absolute voltage. However, some sensors- many barometric ones included- are ratiometric, they do NOT give absolute voltage but rather a proportion of Vin. This totally cancels out the inaccuracy of the reg. That's the situation for any thermistor being pulled up to 5V through a resistor, for example. Even if the reg gave 4.8V and VrefH is 4.8V, the thermistor will have no additional error from the reg.

In fact, if you've got a ratiometric input, an external voltage reference will reintroduce the regulator error into the calculation since the sensor still gives output as a ratio of the regulator voltage.
 
Oznog said:
PIC spec sheets. On PIC18F452/252, they're Fig23-28 & 23-29, pg 302/302.

Actually, looking at them again, the inaccuracy goes up 3.5x LSBs when Vdd AND VrefH drop to 2.5V.

The relevent diagram is 23-29, using 5V Vdd and a lower Vref for the A2D, at 2.5V Vref it gives a linearity of better than 2 LSB's, that's better than 0.2% - I don't see any problem with that at all?.
 
Most would assume the lower vRef gets you a better resolution for small signals. In fact this is true for most ADCs and is a common practice.

You've got a resolution of around 5mV with a 5V ref, some think you can get 2.5mV resolution with a 2.5V ref. But the inaccuracy being more than double removes any such gains, so you might as well use a 5V ref and left shift it one and just put a zero in the LSB. Again, it'll work, but there are no gains from reducing vRef. There are gains from having a precision ref of course.

When I was hacking my first circuit to measure thermocouples, I tried to lower vRef to something ridiculously low in hope of getting an acceptable resolution of maybe 200 codes within the 0-30mV range. It of course failed to get any useful resolution, much offset error and linearity was poor. I hadn't thought to look for relevant areas of the spec sheet first.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top