Getting a stable value from sensor

arduinoavrcprogramming

I am working with Omron Pressure sensor D6F-PH .
When i try to read the pressure value i am unable to get a stable value.
I tried averaging but even that doesn't help.
Could somebody suggest me a trick/ techniques to help in my situation.

Best Answer

The first thing to do is look carefully at the electronics around the sensor, particularly its power feed. Make sure the ground is solid and well connected back to where the measurement is being done, and that the supply is clean.

I'd put maybe two ferrite chip inductors in series with the supply, and 20 µF or so to ground after each. That should smooth out ripples from switching noise and the like. If the supply voltage is not well regulated, then use a bit higher unregulated supply voltage, add the ferrite chip inductors and caps, but have that feed into a LDO which then feeds the transducer.

Once you have the electrical side clean, the rest is firmware. You said you "averaged" the values, which implies a naive box filter. Sample the signal as fast as your micro can handle, then apply maybe two poles of

  FILT <-- FILT + FF(NEW - FILT)

Each of these is the digital equivalent of a R-C low pass filter. Figure out what step response you really need, and adjust the filters accordingly. This has been discussed many times here before. For example, I go into detail on such filters at https://electronics.stackexchange.com/a/30384/4512.