AN1950
Sensors
2 Freescale Semiconductor
Amplifier Induced Errors
The sensor output needs to be amplified before being
inputted directly to the microcontroller through an eight-bit A/D
input pin. To determine the amplification requirements, the
pressure sensor output characteristics and the 0-5 V input
range for the A/D converter had to be considered.
The amplification circuit uses three op-amps to add an
offset and convert the differential output of the MPXM2010GS
sensor to a ground-referenced, single-ended voltage in the
range of 0–5.0 V.
The pressure sensor has a possible offset of ±1 mV at the
minimum rated pressure. To avoid a nonlinear response when
a pressure sensor chosen for the system has a negative offset
(V
OFF
), we added a 5.0 mV offset to the positive sensor output
signal. This offset will remain the same regardless of the
sensor output. Any additional offset the sensor or op-amp
introduces is compensated for by software routines invoked
when the initial system calibration is done.
To determine the gain required for the system, the
maximum output voltage from the sensor for this application
had to be determined. The maximum output voltage from the
sensor is approximately 12.5 mV with a 5.0 V supply since the
full-scale output of the sensor changes linearly with supply
voltage. This system will have a maximum pressure of 4 kPa
at 40 cm of water. At a 5.0 V supply, we will have a maximum
sensor output of 5 mV at 4 kPa of pressure. To amplify the
maximum sensor output to 5.0 V, the following gain is needed:
Gain = (Max Output needed) / (Max Sensor Output
and Initial Offset) = 5.0 V / (0.005 V + 0.005) = 500
The gain for the system was set for 500 to avoid railing from
possible offsets from the pressure sensor or the op-amp.
The Voltage Outputs from the sensor are each connected
to a non-inverting input of an op-amp. Each op-amp circuit has
the same resistor ratio. The amplified voltage signal from the
negative sensor lead is V
A
. The resulting voltage is calculated
as follows:
V
A
= (1+R8/R6) * V
4
= (1+10/1000) * V
4
= (1.001) * V
4
The amplified voltage signal from the positive sensor lead
is V
B
. This amplification adds a small gain to ensure that the
positive lead, V
2
, is always greater than the voltage output
from the negative sensor lead, V
4
. This ensures the linearity
of the differential voltage signal.
V
B
= (1+R7/R5) * V
2
– (R7/R5) * V
CC
= (1+10/1000) * V
2
+ (10/1000)*(5.0 V)
= (1.001) * V
2
+ 0.005 V
The difference between the positive sensor voltage, V
B
,
and the negative sensor voltage, V
A
is calculated and
amplified with a resulting gain of 500.
VC = (R12/R11) * (V
B
– V
A
)
= (500 K/1K) * (V
B
– V
A
)
= 500 * (V
B
– V
A
)
The output voltage, V
C
, is connected to a voltage follower.
Therefore, the resulting voltage, V
C
, is passed to an A/D pin of
the microcontroller.
The range of the A/D converter is 0 to 255 counts. However,
the A/D Values that the system can achieve are dependent on
the maximum and minimum system output values:
Count = (V
OUT
– VRL) / ( VRH – VRL) x 255
where V
Xdcr
= Transducer Output Voltage
V
RH
= Maximum A/D voltage
V
LH
= Minimum A/D voltage
Count (0 mm H20) = (2.5 – 0) / (5.0 – 0) * 255 = 127
Count (40 mm H20) = (5.0 – 0) / (5.0 – 0) * 255 = 255
Total # counts = 255 – 127 = 127 counts.
The resolution of the system is determined by the mm of
water represented by each A/D count. As calculated above,
the system has a span of 226 counts to represent water level
up to and including 40 cm. Therefore, the resolution is:
Resolution = mm of water / Total # counts
= 400mm/127 counts = 3.1 mm per A/D count
Table 1. MPXM2010D OPERATING CHARACTERISTICS (V
S
= 10 V
DC
, T
A
= 25°C unless otherwise noted, P1 > P2)
Characteristic Symbol Min Typ Max Unit
Pressure Range P
OP
0—10kPa
Supply Voltage V
S
—1016Vdc
Supply Current I
O
—6.0 –mAdc
Full Scale Span V
FSS
24 25 26 mV
Offset V
off
-1.0 — 1.0 mV
Sensitivity DV/DP — 2.5 — mV/kPa
Linearity — -1.0 — 1.0 %V
FSS