Electronic – Interfacing an automotive pressure sensor to microcontroller circuit

analogdigital-logicinterfacemicrocontrollersensor

This is a follow up to Measuring water pressure in a tank. I've decided to try and go a different direction so I'm asking a new question.

I have an application in which I need to electronically measure the pressure inside of a pool filter. Because the sensor will be subjected to chlorinated water I can't use a simple pressure sensor such as the MPX5700 from Freescale.

I've got a cheap 150 PSI Pressure Transducer from Ebay with the following technical details:

Input: 0-150 psi.
Output: 0.5V – 4.5V linear voltage output. 0 psi outputs 0.5V, 75 psi
outputs 2.5V, 150 psi outputs 4.5V.

Works for oil, fuel, water or air pressure. Can be used in oil tank,
gas tank, etc.

Accuracy: within 2% of reading (full scale).

Thread: 1/8”-27 NPT.

Wiring connector: water sealed quick disconnect. Mating connector is
included.

Wiring: Red for +5V. Black for ground. Blue for signal output.

I tested it out on the bench using an oscilloscope and multimeter and measured the following:

  1. When no pressure is applied it is producing about 418mV. This seems correct based upon the above.
  2. When I force some air into it using my mouth the voltage goes up as expected.
  3. The resistance between 5V and GND is 42.7K ohm
  4. The resistance between 5V and signal OUTPUT is 120K ohm
  5. The resistance between GND and signal OUTPUT is 69K ohm

I connected the sensor signal wire to my LPC1768 micro-controller on P17 ( analog in ), sensor Red wire to +5V and the sensor ground wire directly to ground.

When I read the 12 bit AD convertor output I saw wildly varying output such as the following in the Pressure column:

Cycle   Level        Pressure
================================
[211]   W:[184]     F:[2200]
[212]   W:[184]     F:[2071]
[213]   W:[185]     F:[1279]
[214]   W:[184]     F:[418]
[215]   W:[184]     F:[1514]
[216]   W:[184]     F:[3002]
[217]   W:[185]     F:[1499]
[218]   W:[185]     F:[0]
[219]   W:[183]     F:[1430]
[220]   W:[184]     F:[2501]
[221]   W:[184]     F:[1965]
[222]   W:[185]     F:[1311]
[223]   W:[184]     F:[263]
[224]   W:[184]     F:[1509]
[225]   W:[183]     F:[3195]
[226]   W:[186]     F:[1518]
[227]   W:[184]     F:[74]
[228]   W:[185]     F:[1306]
[229]   W:[184]     F:[2037]
[230]   W:[184]     F:[2409]
[231]   W:[184]     F:[1478]
[232]   W:[184]     F:[30]
[233]   W:[184]     F:[1503]
[234]   W:[185]     F:[3254]
[235]   W:[184]     F:[1549]
[236]   W:[184]     F:[433]
[237]   W:[185]     F:[1025]
[238]   W:[184]     F:[1714]
[239]   W:[184]     F:[2691]
[240]   W:[185]     F:[1479]
[241]   W:[184]     F:[0]

I'm using the same software routine to read both the Level and Pressure column. The Level column is very stable unlike the Pressure column.

My questions are as follows:

  • If the sensor is supposed to output .5V with no pressure how is it that I'm reading 0?
  • Why such variations between each ADC reading?
  • Do I have to add some components to the circuit interface because of the resistance noted above in points 3,4 and 5 such as a unity gain buffer? If so, what op-amp would you recommend? Note that I'm not an electrical engineer, just a hobbyist new to op-amps.
    Thanks Joe Hass for the unity gain buffer idea.

Unit gain buffer

  • What about power supply filter capacitors? Should they be needed and if so have much?
  • Should I add pull-down or pull-up resistor?
  • Is it possible to get this to work or would I need to use a much more expensive item such a Honeywell industrial pressure sensor?

Note: This is both an electronics and software question. Right now I am working on the electrical interface.

Update: Things appear for the moment to have been solved. I had the sensor signal connected to the LPC1768 P18 which is shared as Analog In and Analog Out. The sensor signal is now connected to P17 ( Analog In only ). That change and adding a 0.1uF cap to filter the sensor output has made the output at 0 PSI appear correct. I just have to test it with an air compressor and certain PSI settings to ensure the ADC readings remain correct.

Best Answer

These problems are hard to diagnose. The first thing I would do is swap the level and pressure ADC inputs to make sure that there isn't some sort of software issue. Even if you've looked at the code a thousand times I would do this.

The impedance of your sensor is pretty high to feed directly to the ADC input. I think you should add a unity gain, non-inverting buffer between the sensor and the ADC input.

Bypass capacitors may be needed. There's not enough information to tell where they should be added or what their values should be. I would be sure to bypass the 5V supply for the sensor. You could add a small capacitor to the output of the sensor as well, assuming that the pressure is not changing rapidly.

You could also try slowing the ADC clock rate to give the sample-and-hold more time to charge. Sometimes putting the processor to sleep during a conversion can reduce noise as well.