will be read-only starting December 31st, 2018. For more info pleae look at this Forum Post

Pressure Sensor with bridge output

Connecting such a differential sensor directly to the analog inputs of an Arduino, using the pressure sensor SPX3058D as an example.


Connect it directly to an Arduino

The output signal of a sensor with bridge outputs would normally need an opamp with an input impedance of 1M or more. It is however possible to connect them directly to the analog inputs of the Arduino (using two analog inputs for both sensor outputs). The analog inputs of the avr microcontroller (the microcontroller on the Arduino board) needs an impedance of 10k maximum for a good analog-to-digital conversion. Since those pressure sensors are not linear (and sometimes) not very accurate, it is possible to connect the sensor directly to the Arduino. I used two capacitors of 1nF from the sensor outputs to ground, to avoid problems with the high impedance.

Connecting the bridge output directly to the Arduino causes some extra inaccuracy, because of the small range of the output signal (which would normally be amplified by an Op Amp).

Measurements for the SPX3058D

This sensor has an offset of about 22mV. This offset varies. For best performance, this offset should be determined everytime during setup().
At 5V, this sensor uses 10.6 mA.

My measurements in the picture below shows the difference of the analogRead() values of the Arduino as a result of the applied pressure. I used +5V for both the sensor and the Arduino.
The sensor is obvious not linear, which is the case for all piezo bridge pressure sensors.

I did some tests with a pressure of -900 mbar to 2000 mbar. The pressure range for the SPX3058D is -500 mbar to +500 mbar, so my tests were beyond that range. After that the offset and curve of the sensor was slighty changed. But the sensor is still usable.

The picture with measurements was done with a good sensor.

Example code

With an arduino at 5V, and using the analog input at full range (0...5V), the pressure in kPa can be calculated by the difference between the analog signals. Since the sensor it not linear, some calculation is needed. The example code is for an accuracy of about 10%. For a higher accuracy, a lookup table or curve fitting has to be implemented.

After a while I decided to use the average of 5 samples. That resulted in reliable and stable pressure values.

int vOutMinus, vOutPlus, x, pressure_mbar, pressure_kPa;

delay(20);   // wait, there could be a capacitor at AVref.

vOutPlus = analogRead(0);
vOutMinus = analogRead(1);

// Calculation the pressure for 10% accuracy.
// Valid for -500 mbar to +600 mbar (-50kPa to +60kPa).

x = (vOutMinus-vOutPlus) + 5; // difference and offset.

// Curve fitting by trial and error for the SPX3058D
if (x > 0)
  pressure_mbar = (x*5) + (x*x/13);
  pressure_mbar = (x*4) - (x*x/24);

pressure_kPa = pressure_mbar / 10;

Serial.print (F("Pressure = "));
Serial.println(F(" mbar"));

Using such a sensor with ATtiny or ATmega

If such a sensor is used with an ATtiny or (non-Arduino) ATmega, the clock of the ADC should be set to a low frequency. Because of the high impedance of the sensor outputs, a low frequency for the ADC is better.

The SPX3058D Pressure Sensor

The SPX3058D was a relative pressure sensor made by Motorola. It was custom made for Miele.

The few things that are known about this sensor is:

  • maximum 6V
  • maximum 50kPa (500 mbar) differential pressure
  • pin 1 = Ground
  • pin 2 = bridge Vout+
  • pin 3 = +5V
  • pin 4 = bridge Vout-

If you look at the bottom of the sensor (the metal with the hole in the middle), and keep the pins to the left. The first pin (upper-left) is pin 1.

The sensor can measure vacuum and pressure, both up to 500 mbar differential pressure.
I don't know if the sensor is internally compensated for temperature changes.
The sensor is probably only for air pressure, not for fluids.

In 2012 this pressure sensor was still available in Europe at Neuhold Elektronik for 1.40 euros. That is about 1/10 of the normal price.