mb1 Generic Meter Applications v1.01 PDF
mb1 Generic Meter Applications v1.01 PDF
PROGRAMMABLE METER
FOR ANALOG SENSORS –
USER’S MANUAL
Version 1.01
Copyright
Material in this document copyrighted © 2011 FullWave, LLC.
All firmware and software used in the MB-1 copyrighted © 2011 FullWave, LLC.
Table of Contents
1 INTRODUCTION ....................................................................................................................................... 7
2 OVERVIEW ................................................................................................................................................ 7
2.1 EXAMPLES OF THE FOUR CALIBRATION APPROACHES ......................................................................... 10
3 RESTRICTIONS ....................................................................................................................................... 12
4 EXAMPLES USING ANALOG SENSORS ............................................................................................. 13
4.1 TEMPERATURE MEASUREMENTS – USING A LINEAR DEVICE ............................................................... 13
4.1.1 Overview ....................................................................................................................................... 13
4.1.2 Calibration Procedure ................................................................................................................... 14
4.2 DC CURRENT MEASUREMENTS USING A METER SHUNT ...................................................................... 15
4.2.1 Overview ....................................................................................................................................... 15
4.2.2 Calibration Procedure ................................................................................................................... 15
4.3 NOTES ................................................................................................................................................ 16
4.4 DC CURRENT MEASUREMENTS USING AN ISOLATED SENSOR .............................................................. 17
4.4.1 Overview ....................................................................................................................................... 17
4.4.2 Calibration Procedure ................................................................................................................... 19
4.4.3 Related Sensors ............................................................................................................................. 20
4.5 AC CURRENT MEASUREMENTS USING AN ISOLATED SENSOR .............................................................. 21
4.5.1 Overview ....................................................................................................................................... 21
4.5.2 Calibration Procedure ................................................................................................................... 21
4.5.3 Related Sensors ............................................................................................................................. 21
4.6 DC POWER MEASUREMENTS............................................................................................................... 22
4.6.1 Overview ....................................................................................................................................... 22
4.6.2 Calibration Procedure ................................................................................................................... 24
4.7 TEMPERATURE MEASUREMENTS – USING A NONLINEAR DEVICE ......................................................... 25
4.7.1 Overview ....................................................................................................................................... 25
4.7.2 Calibration Procedure ................................................................................................................... 27
4.7.3 Related Sensors ............................................................................................................................. 29
4.8 PRESSURE/FORCE SENSOR – USING A NONLINEAR DEVICE .................................................................. 30
4.8.1 Overview ....................................................................................................................................... 30
4.8.2 Calibration Procedure ................................................................................................................... 30
4.8.3 Related Sensors ............................................................................................................................. 32
4.9 REFLECTANCE SENSOR ....................................................................................................................... 33
4.9.1 Overview ....................................................................................................................................... 33
4.9.2 Coupler Calibration Procedure ..................................................................................................... 34
4.10 MEASURING DISTANCE – USING A LINEAR AND NONLINEAR DEVICE ................................................... 35
4.10.1 Overview .................................................................................................................................. 35
4.10.2 Calibration Procedure .............................................................................................................. 37
4.10.3 Related Sensors......................................................................................................................... 39
4.11 LIQUID LEVEL SENSOR ....................................................................................................................... 40
4.11.1 Overview .................................................................................................................................. 40
4.11.2 Calibration Procedure .............................................................................................................. 40
4.11.3 Using the Liquid Level Sensor with Alarm Functions ................................................................ 41
4.12 LIGHT LEVEL SENSOR ......................................................................................................................... 42
4.12.1 Overview .................................................................................................................................. 42
4.12.2 Interface Circuit ....................................................................................................................... 42
4.13 FIELD STRENGTH METER USING ELECTROMAGNETIC SIGNAL SENSOR ................................................. 47
4.13.1 Overview .................................................................................................................................. 47
4.14 RF AMMETER ..................................................................................................................................... 49
2
4.14.1 Overview .................................................................................................................................. 49
4.15 MEASURING TILT USING AN ACCELEROMETER SENSOR ....................................................................... 52
4.15.1 Overview .................................................................................................................................. 52
4.15.2 Error Analysis .......................................................................................................................... 54
4.15.3 Related Sensors......................................................................................................................... 56
4.16 MEASURING TILT USING A DISCRETE TILT SENSOR ............................................................................. 57
4.16.1 Overview .................................................................................................................................. 57
4.17 LOGARITHMIC SOUND PRESSURE LEVEL SENSOR ................................................................................ 61
4.17.1 Overview .................................................................................................................................. 61
4.17.2 Error Analysis .......................................................................................................................... 63
4.18 COLOR SENSOR MODULE .................................................................................................................... 68
4.18.1 Overview .................................................................................................................................. 68
4.18.2 Calibration Procedure .............................................................................................................. 68
4.18.3 Using the Color Sensor with Alarm Functions........................................................................... 71
4.19 MEASURING BLOOD ALCOHOL LEVEL - USING A NONLINEAR DEVICE ................................................. 72
4.19.1 Overview .................................................................................................................................. 72
4.19.2 Wiring....................................................................................................................................... 74
4.19.3 Calibration Procedure .............................................................................................................. 74
4.19.4 Error Analysis .......................................................................................................................... 76
4.19.5 Details ...................................................................................................................................... 77
4.19.6 Related Sensors......................................................................................................................... 77
4.20 ANGULAR RATE SENSOR (GYROSCOPE) .............................................................................................. 79
4.20.1 Overview .................................................................................................................................. 79
4.20.2 Interface Circuit ....................................................................................................................... 80
4.20.3 Calibration Procedure .............................................................................................................. 82
4.21 HALL EFFECT MAGNETIC SENSOR ....................................................................................................... 84
4.21.1 Overview .................................................................................................................................. 84
4.21.2 Coupler Port Calibration .......................................................................................................... 85
4.21.3 Panel Meter Calibration ........................................................................................................... 86
4.21.4 Related Sensors......................................................................................................................... 87
4.22 OHMMETER EXAMPLE......................................................................................................................... 88
4.22.1 Overview .................................................................................................................................. 88
4.22.2 Calibration Procedure .............................................................................................................. 88
4.22.3 Error Analysis .......................................................................................................................... 89
4.22.4 Increasing the Range ................................................................................................................ 90
4.22.5 Analog Meter Calibration ......................................................................................................... 91
4.23 MEASURING TEMPERATURE COMPENSATED PH AND OXIDATION-REDUCTION POTENTIAL ................... 93
4.23.1 Overview .................................................................................................................................. 93
4.23.2 Coupler Port Calibration .......................................................................................................... 94
4.23.3 Analog Meter Calibration ......................................................................................................... 94
4.24 YAESU FT857/ 897 EXTERNAL ANALOG METER ............................................................................... 100
4.24.1 Overview ................................................................................................................................ 100
4.25 SOME OTHER SENSORS ...................................................................................................................... 103
4.25.1 Overview ................................................................................................................................ 103
4.25.2 Humidity Sensor ..................................................................................................................... 103
4.25.3 Pressure Sensor – (Barometer) ............................................................................................... 103
4.25.4 Wind Direction Sensor ............................................................................................................ 104
5 SOME INDUSTRIAL SENSORS ........................................................................................................... 105
5.1 ELEVEN DECADE VACUUM SENSOR .................................................................................................. 105
5.1.1 Overview ..................................................................................................................................... 105
5.1.2 Coupler Port Calibration............................................................................................................. 106
5.1.3 Panel Meter Calibration .............................................................................................................. 109
5.2 ROTARY SHAFT ENCODER................................................................................................................. 111
5.3 LINEAR POSITION SENSOR................................................................................................................. 111
5.4 NON-CONTACT INFRARED TEMPERATURE SENSOR ............................................................................ 112
3
5.5 HIGH PRECISION LOW DISPLACEMENT INDUCTIVE LINEAR SENSOR ................................................... 112
5.6 TIME OF FLIGHT LASER DISTANCE SENSOR ....................................................................................... 113
5.7 SALT WATER CONDUCTIVITY SENSOR .............................................................................................. 113
5.8 LINEAR VARIABLE DISPLACEMENT TRANSFORMERS ......................................................................... 114
5.9 VOLUMETRIC FLOW SENSOR ............................................................................................................. 114
5.10 ROTARY TORQUE TRANSDUCER ........................................................................................................ 115
5.11 RPM SENSOR USING AN INDUSTRY STANDARD 4 – 20 MA CURRENT OUTPUT .................................... 116
5.11.1 Overview ................................................................................................................................ 116
5.11.2 Interface Circuit ..................................................................................................................... 116
5.11.3 Calibration Procedure ............................................................................................................ 117
6 ADDING MB-1 TO EXISTING MEASUREMENT SYSTEMS ........................................................... 118
7 INPUT SENSITIVITY AND DYNAMIC RANGE ................................................................................ 120
8 INTERPOLATION ................................................................................................................................. 120
9 SPECIAL CONSIDERATIONS WHEN USING MB-1 WITH ANALOG SENSORS ........................ 122
9.1 AN ADDITIONAL CALIBRATION POINT OF 0 FOR USE WITH ANALOG SENSORS ..................................... 122
9.2 ALLOWING A VOLTAGE OF 0 DURING CALIBRATION WITH ANALOG SENSORS .................................... 123
9.3 PROCESSING MEASUREMENTS OUTSIDE OF THE CALIBRATION RANGE ............................................... 123
9.3.1 Single Point Calibration Cases .................................................................................................... 123
9.3.2 Multipoint Calibration Cases....................................................................................................... 123
9.3.3 Dialing In actual Parameter Value during Calibration ................................................................ 124
4
Figures
FIGURE 1 – SENSOR WITH LINEAR TRANSFER FUNCTION PASSING THROUGH THE ORIGIN .......................................... 8
FIGURE 2 –SENSORS WITH LINEAR TRANSFER FUNCTIONS NOT PASSING THROUGH THE ORIGIN ............................... 9
FIGURE 3 – SENSORS WITH NONLINEAR TRANSFER FUNCTIONS ................................................................................ 9
FIGURE 4 - USING A VOLTAGE SOURCE AND POTENTIOMETER FOR CALIBRATION ................................................... 10
FIGURE 5 – POTENTIOMETER, MULTIMETER, AND RCA CABLES ............................................................................. 11
FIGURE 6 – TEMPERATURE INPUT DEVICE .............................................................................................................. 13
FIGURE 7 – LM34 FEEDING MB-1 ......................................................................................................................... 14
FIGURE 8 – METER SHUNT ..................................................................................................................................... 15
FIGURE 9 - DC AMMETER APPLICATION ................................................................................................................ 15
FIGURE 10 – PROBLEM MEASURING TRANSCEIVER POWER SUPPLY CURRENT USING SHUNT .................................. 17
FIGURE 11 - MEASURING TRANSCEIVER POWER SUPPLY CURRENT USING AN ISOLATED CURRENT SENSOR ............ 18
FIGURE 12 – HALL EFFECT CURRENT SENSOR........................................................................................................ 19
FIGURE 13 – MAXIM MAX4210E DC POWER SENSOR ........................................................................................... 22
FIGURE 14 - THERMISTOR RESISTANCE .................................................................................................................. 26
FIGURE 15 – NONLINEAR THERMISTOR – CIRCUIT AND CALIBRATION PROCEDURE................................................. 26
FIGURE 16 – VOLTAGE INPUT INTO MB-1 VS. TEMPERATURE ................................................................................. 27
FIGURE 17 – FORCE SENSOR CURVE ...................................................................................................................... 31
FIGURE 18 – INPUT CIRCUIT TO MEASURE FORCE .................................................................................................. 31
FIGURE 19 – REFLECTANCE SENSOR ...................................................................................................................... 33
FIGURE 20 – INPUT CIRCUIT TO MEASURE REFLECTANCE ...................................................................................... 33
FIGURE 21 – GREY SCALE FOR CALIBRATING REFLECTANCE SENSOR..................................................................... 34
FIGURE 22 ULTRASONIC DISTANCE SENSOR .......................................................................................................... 36
FIGURE 23 – IR DISTANCE SENSOR ........................................................................................................................ 36
FIGURE 24 – VOLTAGE VS. DISTANCE FOR IR SENSOR ............................................................................................ 37
FIGURE 25 – SENSOR REVERSED AND BIASED TO GET INCREASING VOLTAGE VS. PARAMETER ................................. 38
FIGURE 26 - VOLTAGE VS. DISTANCE FOR IR SENSOR – INVERTED CURVE.............................................................. 39
FIGURE 27- INPUT CIRCUIT TO MEASURE LIQUID LEVEL ........................................................................................ 40
FIGURE 28 –INTERFACING LIGHT SENSOR TO MB-1 ............................................................................................... 43
FIGURE 29 - GRAPHS OF DIFFERENT SENSITIVITY SETTINGS ON LIGHT SENSOR ...................................................... 44
FIGURE 30 – RF CURRENT SENSOR ........................................................................................................................ 49
FIGURE 31 – SENSOR ORIENTATION ....................................................................................................................... 53
FIGURE 32 – INTERFACE CIRCUIT FOR DISCRETE TILT SENSOR ............................................................................... 58
FIGURE 33 - INTERFACE CIRCUIT FOR DISCRETE TILT SENSOR USING D-TO-A CONVERTER ..................................... 59
FIGURE 34 - OUTPUT VOLTAGE VS. SOUND PRESSURE ............................................................................................ 62
FIGURE 35 - FIGURE 36 – COLOR SENSOR CURVES FOR RGB SCALE AND % SCALE ................................................ 69
FIGURE 37 – ALCOHOL SENSOR CURVE ................................................................................................................. 73
FIGURE 38- ALCOHOL SENSOR WIRING.................................................................................................................. 74
FIGURE 39 – INTERFACE CIRCUIT FOR ANGULAR VELOCITY SENSOR ...................................................................... 81
FIGURE 40 – MAGNETIC SENSOR TRANSFER FUNCTION .......................................................................................... 85
FIGURE 41 – CIRCUIT FOR MEASURING RESISTANCE .............................................................................................. 88
FIGURE 42 – INCREASING OHMMETER RANGE ........................................................................................................ 91
FIGURE 43 – AFFECT OF MB-1 INPUT RESISTANCE ON MEASUREMENT................................................................... 91
FIGURE 44 – PH FOR DIFFERENT TEMPERATURES VS. PH @ T=100º ........................................................................ 97
FIGURE 45 – RPM SENSOR INTERFACE ................................................................................................................ 117
FIGURE 46 – ADDING MB-1 TO EXISTING INSTRUMENTATION USING A VOLTAGE SENSOR .................................... 118
FIGURE 47 – ADDING MB-1 TO EXISTING 4-20 M A LOOP INSTRUMENTATION ....................................................... 119
5
Tables
TABLE 1 – HALL CURRENT SENSOR CALIBRATION ................................................................................................. 19
TABLE 2 – PORTION OF THE RESISTANCE VS. VOLTAGE CALCULATIONS FOR THERMISTOR ..................................... 28
TABLE 3 – VOLTAGE/TEMPERATURE CALIBRATION POINTS FOR THERMISTOR ........................................................ 28
TABLE 4 - ERROR ANALYSIS FOR TILT SENSOR ...................................................................................................... 55
TABLE 5 – LOGIC SIGNALS AND CORRESPONDING ANALOG VOLTAGE FOR DISCRETE TILT SENSOR ........................ 57
TABLE 6 – CALIBRATION POINTS FOR DISCRETE TILT SENSOR ............................................................................... 59
TABLE 7 – ERROR ANALYSIS FOR SOUND SENSOR.................................................................................................. 64
TABLE 8 – ALCOHOL SENSOR CALIBRATION POINTS .............................................................................................. 75
TABLE 9 – ERROR AT MIDPOINTS ........................................................................................................................... 76
TABLE 10 – CALIBRATION METHOD FOR MAGNETIC SENSOR ................................................................................. 86
TABLE 11 – CALIBRATION POINTS AND CORRESPONDING VOLTAGES FOR OHMMETER APPLICATION ...................... 88
TABLE 12 – ERROR ANALYSIS FOR OHMMETER EXAMPLE ...................................................................................... 89
TABLE 13 – PH CALIBRATION POINTS FOR T=100º C .............................................................................................. 94
TABLE 14 – SENSOR OUTPUT VOLTAGE AS A FUNCTION OF PH AND TEMPERATURE ................................................ 95
TABLE 15 – PH VALUES FOR DIFFERENT TEMPS CORRESPONDING TO VOUT AT T=100º CASE .................................. 96
TABLE 16 – ANALOG NEEDLE DEFLECTION FOR T=100º CASE ............................................................................... 97
TABLE 17 – ANALOG NEEDLE DEFLECTION FOR T=75º CASE ................................................................................. 98
TABLE 18 – TRANSFER FUNCTION FOR 10N PRESSURE VALUES FOR VACUUM SENSOR .......................................... 106
TABLE 19- MB-1 READINGS AND CORRESPONDING PRESSURES FOR INTEGRAL MB-1 READINGS ......................... 107
TABLE 20 – LOOKUP TABLE FOR INTERPOLATING NON-INTEGRAL MB-1 MEASUREMENTS.................................... 108
TABLE 21 – VACUUM SENSOR CALIBRATION POINTS ........................................................................................... 109
TABLE 22 - MB-1 SPECIFICATIONS OF SPECIAL INTEREST WHEN USING MB-1 WITH ANALOG SENSORS ................ 121
TABLE 23- AVAILABLE MB-1 CALIBRATION POINTS ............................................................................................ 122
6
1 Introduction
MB-1 is not restricted to Amateur Radio applications. The calibration routines that were originally
designed to improve RF power measurements were expanded allowing MB-1 to provide generalized
measurement capabilities for a wide range of other applications using analog sensors and transducers.
When combined with MB-1’s other features such as its programmable display devices, a programmable
averaging window, and its alarm trip functions, we believe that MB-1 will be useful for a variety of
different applications.
The MeterBuilder website provides an overview on using analog sensors with MB-1. You should also
read the Quick Start section of the MB-1 User’s Manual to gain a basic understanding of the meter’s
operation. Features like programming the display devices, the alarm trip functions, the averaging filter,
and most of MB-1’s other Amateur Radio features are equally applicable for use with analog sensors.
The overall steps for programming all Generic Applications are basically the same. Since the User’s
Manual provides the step by step procedure for calibrating a simple Generic Meter Application (i.e., a
simple DC voltmeter), those detailed steps are not repeated here.
The examples below are not intended to show you how to create a $10 digital thermometer using MB-1.
Instead, the intent is to illustrate how MB-1 can interface to a variety of analog sensors with different
characteristics using different techniques. If you have an analog sensor that you would like to use for a
particular application, it is likely that you will be able to interface it to MB-1 using one or more of the
approaches shown in the examples below.
2 Overview
Assume you have an application that either generates a DC voltage or you have an application from
which a DC voltage can be derived. The transfer function that relates the parameter of interest to the DC
voltage generated by the sensor can be a complex non-linear function. But if there are no discontinuities
in the transfer function, and if you can identify discrete calibration points for the parameter of interest,
you should be able to calibrate MB-1 to measure the parameter.
The different approaches for integrating analog sensors with MB-1 can be categorized into four general
categories:
Case 1: The function to be measured is linear and passes through the origin (the generated DC
voltage is 0 when parameter is 0) and you know the transfer function.
Case 2: The function to be measured is linear, does not pass through the origin, and you know the
transfer function.
Case 3: The function to be measured is nonlinear and you know the transfer function.
Case 4: The function to be measured is nonlinear, and you do not know the transfer function, but
you know that the voltage increases as the parameter increases, and you know that the DC voltage
from the sensor is within the dynamic range of the MB-1’s input circuitry.
7
Sample graphs of transfer functions for the first three cases are shown below. In Figure 1, the transfer
function is linear and passes through the origin. In this case, MB-1 needs to determine only the slope of
the transfer function. This can be accomplished by performing the calibration at any point along the line.
For example, if we use the end point, MB-1 would be calibrated at 1000 “units” when 4 volts is applied
to the coupler input. Once calibrated, MB-1 will be able to calculate the parameter value for any input
voltage from the sensor.
In Figure 2, we have two cases. Case A is linear but does not pass through the origin. Case B is linear,
and would pass through the origin if extended, but the transfer function indicates that the sensor is valid
only for parameter values greater than 200 and less than 800. In both these cases, the two end points of
the transfer function should be used for calibration. In case A, MB-1 uses the two calibration points to
determine the slope and the intercept. The same is true is case B, but in addition, since the lower
calibration point is not defined when the parameter is less than 200, this tells MB-1 what the valid lower
range of the sensor is.
Figure 3In Figure 3, we also have two cases. Both sensors are nonlinear and require multiple
calibration points to characterize the sensor. When MB-1 reads a voltage between any two calibration
points, its uses piecewise linear interpolation to calculate the parameter value. Therefore, sensors with
highly nonlinear transfer functions will require a larger number of calibration points for accurate
tracking.
Figure 1 – Sensor with Linear Transfer Function passing through the origin
8
Figure 2 –Sensors with Linear Transfer Functions NOT passing through the origin
9
2.1 Examples of the Four Calibration Approaches
This section expands on the above overview by providing some examples.
Case 1: The temperature sensor in section 4.1 application generates 10 mV per degree, and has a linear
transfer function that passes through the origin. Therefore, we know from the specs that at 100 degrees,
the device will generate an output of 1.0 volt.
To calibrate this device, all we have to do is apply 1.0 volt to the coupler port while setting the
calibration point to 100 (100 degrees). This can be done easily using a potentiometer connected to the 5
volt auxiliary power output on the MB-1 rear panel RCA jacks and then adjusting the pot until the pot’s
wiper voltage is 1.0 volt.
Figure 4 and Figure 5 below show a circuit that can accomplish this. A low resistance potentiometer
should be used so that the input resistance of the coupler ports (300 K) can be ignored. A pair of clip
leads connected to the output of the potentiometer lets you monitor the applied voltage with an external
Digital Multimeter while performing the calibration.
10
Figure 5 – Potentiometer, Multimeter, and RCA Cables
Case 2: The current sensor in section 4.4 isolates the lead whose current is being measured from the
sensor output leads, which feed the MB-1 coupler port. The current sensor output is linear but does not
pass through the origin. The sensor in this example generates an output voltage of approximately 133
millivolts per amp, but the idle current output voltage (when the current being measured = 0) is 500
millivolts. Its data sheet can be found here
Since this transfer function does not pass through the origin, we need two calibration points: one at the
low end of the scale, and one at the high end of the scale. As with the example discussed in case 1 above,
since we know the transfer function, we can “dial in” the corresponding voltages at each of the two
calibration points.
Case 3: For nonlinear sensors, if you can characterize the parameter/voltage relationship
mathematically, or if it is given in a spec sheet, you can create a simple a grouping of parameter/voltage
points that line up with MB-1’s available calibration points (see the nonlinear temperature sensor
example in section 4.7). Using the potentiometer procedure in Figure 4, you can calibrate this series of
points by setting the appropriate voltage at each calibration point.
11
To calculate measurements when the sensor voltage is at an intermediate voltage point with respect to
the discrete calibration points, the MB-1 software uses linear interpolation.
Case 4: This approach can be used if we have a sensor that can not be easily characterized
mathematically or where there is a large sample-to-sample variation. In this case, you can connect the
sensor to the coupler port, and during calibration, you can “walk” the parameter through its range of
values, saving the calibration data at discrete points. However, this approach requires the use of an
independent “reference” during calibration. The example below will clarify this.
Assume that we have distance measuring application where the transfer function is nonlinear and not
easily characterized. Also assume that there is a large sample-to-sample variation across sensors. We can
connect the DC output from the distance sensor to a coupler port. Using a simple yard stick (or meter
stick), we then move an object various distances from the senor (e.g., 1 inch, two inches, 5 inches, 20
inches, 50 inches, and 100 inches), saving the calibration data at each point. This empirical approach is
fast and simple, at least in this example, since it requires only a simple reference such as a yard stick.
And since the calibration was performed with the actual sensor, this approach also takes care of cases
where a wide sample-to-sample variation exists.
3 Restrictions
If an application you have in mind is best addressed by the empirical approach (case 4 above), and if you
have a good independent reference against which to measure the parameter of interest, you can quickly
calibrate the application and evaluate its performance without going through a lot of analysis.
However, before expending a lot of the effort on a more complex application, spend some time reading
the example in section 4.7, which addresses the issue of how a big a dynamic range can reasonably be
handled taking into account the nonlinearity of the parameter. This will give you some insight into
whether MB-1 is s a good match for your application.
For a sensor to be a candidate for interfacing with MB-1, it must meet the following criteria:
The sensor must generate a DC voltage, or you must be able to derive a DC voltage from the
sensor. The relationship between the parameter being measured and the DC voltage can be linear
or nonlinear.
The DC voltage must increase monotonically as a function of the parameter being measured
The quantity being measured must be >= 0 (since all of MB-1’s calibration points are >= 0).
However, there are simple work-arounds for this, especially if you will be designing a custom
analog scale for the application).
The voltage must be compatible with the dynamic range of the coupler ports. This issue is
discussed in more detail in section 7.
12
4 Examples using Analog Sensors
The data sheet for the LM34 can be found here. The device generates a DC output voltage that is
proportional to the temperature in Fahrenheit (10 millivolts per degree). We use the LM34D, which has
a range of 32° to 212°, which corresponds to an output voltage range of 320 millivolts to 2.120 volts.
To program MB-1 to measure temperature, connect the LM34D to the FWD port of one of MB-1’s four
coupler ports as shown below.
13
FIGURE 7 – LM34 FEEDING MB-1
1. Since we are measuring degrees in Fahrenheit, set the Units character to be displayed on the
LCD to “F” for Fahrenheit.
2. For the voltages involved in this application, you should adjust the side panel coupler trim pot to
its maximum sensitivity – at least 15 turns CW. Since the MB-1 input does not saturate until
approximately 6.14 volts when the pot is set to its maximum sensitivity, and since this
application will never generate a DC voltage that comes close to this saturation point, setting the
trim pot to its maximum sensitivity will provide the best resolution and accuracy).
3. Apply a source of 1.00 volt to the FWD port of the coupler being calibrated. This is most easily
done by “dialing in” the calibration voltage using a stable voltage source and potentiometer as
shown in Figure 4.
4. Using the Coupler setup screens, calibrate the meter at a single point at a calibration
temperature of 100°. (This corresponds to the 1.00 volt being applied from step 2.)
Since the LM34D input device has a linear transfer characteristic that passes through the origin,
calibration is required at this single point only.
14
4.2 DC Current Measurements using a Meter Shunt
4.2.1 Overview
We can use a meter shunt in series with the current we want to measure, and feed the generated voltage
across the shunt into one of the coupler ports to measure DC current.
This example makes use of a 20 amp shunt. Shunts in this current range typically generate 75 millivolts
at the full scale current. Like the example above, the transfer function is linear, and passes through the
origin, so this application also requires a single calibration point.
The circuit diagram and suggested calibration procedure is shown in the figure below.
15
application uses the same procedure with the following changes:
1. Since we are measuring current in amps, set the Units character to “A” for amps.
2. For a 20 amp full scale shunt, select a somewhat larger Full Scale value when doing the coupler
setup – 30 amps for example.
3. For the low voltages involved in this application (75 mV full scale), you should adjust the side
panel coupler trim pot to its maximum sensitivity (at least 15 turns CW).
4. During calibration, apply a source of 75 millivolts to the coupler input port being calibrated.
This is most easily done by “dialing in” the calibration voltage using a stable voltage source and
potentiometer as shown in Figure 4.
5. Using the Coupler setup screens, calibrate the meter at a single point - 20 amps. (This
corresponds to the 75 mV that is being applied from step 4.)
4.3 Notes
The 75 millivolt full scale voltage generated by the sensor is close to minimum full scale
voltage where MB-1 can still provide reasonable resolution (see section 7). To improve
resolution for this application, an amplifier could be used, but a simpler approach is to place two
shunts in series. The voltage drop, as seen by the load in minimally affected, and the full scale
voltage available to MB-1 is doubled to 150 millivolts. If you use this approach, use a low
resistance device, such as a copper or brass strip, to connect the two shunts in series.
A more flexible and less expensive approach for measuring DC current using MB-1 is given in
the next example using an isolated current sensor.
16
4.4 DC Current Measurements using an Isolated Sensor
4.4.1 Overview
This example uses an isolated current sensor that allows isolation of the sensor leads from the MB-1
ground.
For Generic Meter applications, the negative lead of the sensor output must be connected to the MB-1
ground. For example, in the meter shunt example above, the meter shunt common lead must be
connected to the MB-1 common (ground).
There are some applications where this restriction may prevent you from measuring a parameter with a
particular sensor when other grounds and common leads are also connected to MB-1’s ground. For
example, in the figure below, assume you want to measure your transceiver’s power supply current with
MB-1 using a Current Shunt as discussed in the previous example. As can be seen in the figure below,
the transceiver’s ground is already connected to MB-1’s ground via the coupler. Therefore, the series
shunt can not be used to measure the power supply current when a coupler is also connected to the
transceiver and to MB-1 since this would effectively short out the power supply. Likewise, ground loop
problems would result if we placed the shunt in the negative leg of the power supply.
17
To measure current in such applications, we can use a sensor that provides isolation between the leads
carrying the parameter to be measured and the sensor output leads that feed the MB-1 coupler port. For
the power supply current measurement example, discussed above, a Hall Effect current sensor provides
the necessary isolation as shown below.
An example of such a sensor is shown below. Its data sheet can be found here. This sensor is capable of
measuring up to 30 amps DC, which provides a good match for the typical transmit mode current draw
of 100 watt transceivers powered from 12 volt supplies. And surprisingly, this sensor is less expensive
than most 20 amp and 30 amp meter shunts.
18
FIGURE 12 – HALL EFFECT CURRENT SENSOR
VIOUT = .5 + .133 * I
Since the transfer function for this sensor does not pass through the origin (0 sensor voltage when current
= 0), we need to do calibration at two points, namely the two end points. If we set the full scale current to
30 amps, the two calibration points will then be 0 amps (MB-1’s lowest calibration point), and 30 amps
(the full scale value).
For maximum accuracy, VZERO should be measured for the actual sensor being used and substituted in
the equation as shown in the table below:
During calibration, these values can be “dialed in” with a potentiometer and the 5 volt auxiliary voltage
source as previously discussed. Adjust the coupler trim pot for maximum sensitivity since there is no
chance of overdriving the MB-1 input in this application.
19
4.4.3 Related Sensors
Other sensors capable of measuring DC current can be found here.
20
4.5 AC Current Measurements using an Isolated Sensor
4.5.1 Overview
This example is similar to the previous example, but makes use of a self powered AC current sensor that
can measure up to 100 amps AC. The sensor produces 5 volts DC at the full scale rating of 100 amps
with a linear transfer function. This sensor is electrically isolated from the AC wire whose current is
being measured. The wire is simply passed through the sensor and inductive coupling is used to generate
the DC output voltage that gets fed to MB-1.
Phidgets has a family of these sensors ranging from 10 amps AC to 100 amps AC. They all work the
same way, producing 5 volts DC at the full scale rating.
Calibration is straightforward with this coupler. Adjust the coupler trim pot for maximum sensitivity.
There is no chance of overdriving the MB-1 input in this application. During calibration, set the full
scale value to 100 (or the full scale value corresponding to your sensor).
Because the transfer function of this sensor is linear, and passes through 0, 0, this application requires
calibration at a single point, namely the full scale value. During calibration, select the full scale value
calibration point. Then apply 5 volts DC to the coupler input, saving the calibration data. That is all that
is required.
21
4.6 DC Power Measurements
4.6.1 Overview
There are some applications, for instance, battery powered equipment or solar cell powered systems,
where the delivered or consumed power measurement is more useful than either the voltage or current
measurement. This example uses the Maxim MAX4210E real time power monitoring sensor to measure
DC power directly. This chip uses a current-sense amplifier and an analog multiplier to perform a real
time multiplication of the current and voltage. The sensor outputs a DC voltage that is proportional to the
power being monitored. MB-1 can be easily calibrated to read the sensor output voltage and can display
the power measurement or process the sensor output using the MB-1 averaging, Min/Max, and alarm
functions.
The complete data sheet for this sensor can be found here.
Application notes, which are a little easier to follow, are found here.
In the figure above, the quantity we want to measure, namely delivered power, is:
PDELIVERED = VSOURCE * IS
RSENSE is a low resistance shunt that generates a voltage based on the load current:
VSENSE = RSENSE * IS
22
For the 4210E device, the sense voltage is multiplied by the amplifier gain G, which has a value of 25,
and the amplifier output is fed to one input of the multiplier.
The second input to the multiplier is a portion of the supply voltage as determined by voltage divider R2
and R3:
The maximum permissible VSENSE value is 150 millivolts. For a given load current, this determines the
maximum resistance of the shunt resistor, RSENSE. Assume that the maximum current in this application
is 10 amps. This gives us an RSENSE = .150/10 = .015 ohms.
Another constraint is that the sensor output voltage¸ VPOUT, that represents the power, must not exceed
VCC - .5v or 4.5v.
Assume that the source voltage powering the load has a maximum value of 15 volts. We can now
calculate the voltage divider ratio R3 / (R2 + R3) so that VPOUT never exceeds 4.5 volts.
If we set R2 = 120K and R3 = 10K, we get a ratio of .0769, which meets the criteria.
We now have all of the values to determine the transfer function of VPOUT vs. PDELIVERED
23
As a sanity check, at the maximum voltage level (15 volts) and current level (10 amps), VPOUT should be
less than 4.5 volts. Plugging the numbers in, we get a VPOUT of 4.32 volts, which checks out.
The above discussion can be used to determine component values for other voltage and current
combinations as well.
Since the above transfer function is linear and passes through the origin, we need to perform the
calibration at a single point. We can do the calibration at the power corresponding to the maximum
voltage and current points, namely a power level of 150 watts. At that power,
Calibration at the 150 watt point is most easily done by “dialing in” the desired voltage at the input to the
coupler using a stable voltage source and potentiometer as shown in Figure 4.
24
4.7 Temperature Measurements – Using a Nonlinear Device
4.7.1 Overview
If you have an interest in measuring parameters with MB-1 that have nonlinear input/output
relationships, this topic may be of interest to you.
The temperature application described above used a device that generated a DC voltage in a linear
relationship with respect to the temperature in Fahrenheit. In this application, we use a nonlinear
temperature device, namely a thermistor, to map DC voltage into temperature in degrees Celsius.
If we wanted to measure temperature, and a linear device like the LM34 satisfies the desired range, using
such a device simplifies things considerably, since the calibration needs to be performed at a single
point. However, we use a thermistor in this sample application since it provides a good example of how
MB-1 can be used to measure a parameter that has a nonlinear function. The device we use is a Vishay
BC1482 thermistor. The data sheet for a nearly identical device can be found here.
The resistance vs. temperature transfer function is fairly complex. It is given by the following formula:
Equation 1:
Tkelvin = 1.0 / (A + B * ln (Rtherm/10.0)
+ C * ln (Rtherm/10.0) ^2
+ D * ln (Rtherm/10.0) ^3)
where ln is the natural logarithm function and A – D are constants for a specific device:
A = 3.354016e-3
B = 2.569107e-4
C = 2.626311e-6
D = 0.675278e-7
A plot of Resistance vs. Temperature for the thermistor is shown below. As expected, the function is
nonlinear.
25
FIGURE 14 - THERMISTOR RESISTANCE
To measure temperature with MB-1, the top circuit in the figure below can be used. Since the thermistor
resistance decreases with increasing temperature, this will cause the voltage into MB-1 to increase for
increasing temperature, which is what we want (a monotonically increasing input function).
Using an Excel spreadsheet, we can calculate the voltage at the Tip of the top circuit as a function of
temperature. A graph of the function is shown below.
26
FIGURE 16 – VOLTAGE INPUT INTO MB-1 VS. TEMPERATURE
5000
4500
4000
Vtip (millivolts)
3500
3000
2500
2000
1500
1000
500
0
-100 -50 0 50 100 150 200 250 300 350 400
Tcelcius
If you are considering using MB-1 for a nonlinear application like this, you should have an idea of what
your input/output function looks like because you want to make sure you have a reasonable resolution
over the range you wish to measure. We see that the above graph starts to saturate noticeably above
150º. While the voltage still increases as the temperature ranges from 300º to 350º, the voltage change
per degree gets smaller and would result in reduced resolution in this range. However, in the range 0º to
100º C, the slope is fairly large, and we could expect reasonable resolution and accuracy within this
range.
To calibrate this application, we need a series of calibration points (in Celsius) and the corresponding
voltage that the circuit in Figure 15 will generate for each of the calibration points. Available MB-1
calibration points that make sense for this application are: 0º, 10º, 20º, 30º, ... 100º. To generate the
table, we have to know the resistance of the thermistor for each of the calibration points. Since the
thermistor forms a simple voltage divider with the 3.5K resistor, if we could determine the thermistor
resistance for each calibration point (0º, 10º, 20º, ...), we can then determine the corresponding voltage
that the coupler input would see. But solving for R, the Thermistor resistance, in terms of the
temperature in Equation 1 is difficult. Instead, we can use Excel to determine the corresponding voltage
values by creating a table with fine granularity and then interpolating.
A portion of the table is shown below, where we calculate TCELSIUS in terms of the voltage at the
voltage divider tap. The two rows in red are rows that span the T= 10º calibration point. We can see that
27
10º will correspond to a voltage somewhere between 7.40 volts and 7.50 volts, which are the
corresponding entries in the first column.
Excel has FORECAST function that simplifies doing the linear interpolation for these two rows. It is
used in the rightmost column, and determines that the voltage corresponding to 10º is .7487 volts.
This approach is repeated for each of the 11 calibration points, and yields the values in Table 3 below.
Using the above table, we simply need to dial in the corresponding voltage, VDC, at the various TCELCIUS
calibration points, and use the calibration setup screens to record these points.
We have left out some detail, such as accounting for the variability from the ideal curve among
thermistor samples, but hopefully, the general concept is clear.
Application-specific programs can always be written for any measurement application. In fact, many
examples are shown on Professor Anderson’s Embedded Processor website
28
(http://www.phanderson.com/), including several applications for measuring temperature. However, the
novel concept of the Generic Application feature of MB-1 is that measurements can be performed on
parameters that have complex parameter vs. voltage relationships without the need to write an
application-specific program. The calibration can be achieved either through use of calculated voltages
at various calibration points, as we did here, or with the use of a reference measuring device (in this
example a thermometer would be used).
This generalized measurement approach will not likely do better than a custom application designed
explicitly to measure a single type of parameter, but the tradeoff is obviously one of complexity and
speed of implementation.
29
4.8 Pressure/Force Sensor – Using a Nonlinear Device
4.8.1 Overview
In the previous temperature application, we did a bit of analysis to generate a temperature vs. voltage
chart that was needed for the calibration. The pressure sensor in this example is highly nonlinear as well.
The specification for this sensor is detailed enough so that we could generate a force vs. voltage curve.
However, in this example, we will use the empirical approach by applying a series of known forces to
the sensor during calibration.
30
Figure 17 – Force Sensor Curve
To measure the pressure with MB-1 using this sensor, the circuit in the figure above can be used. Since
the sensor resistance decreases with increasing pressure, this will cause the voltage into MB-1 to
increase for increasing pressure – again what we want – an output whose voltage increases as a function
of the parameter being measured.
If we wanted to calculate the voltages corresponding to various pressures, that would be straightforward.
For example, when the pressure is 20 grams, the resistance is 30K.
31
The voltage at the tap of the sensor and the 10 k resistor would be:
We could repeat the calculations at a number of points corresponding to MB-1 calibration points, for
example, 20 grams, 30 grams, ... 10,000 grams. We could then calibrate MB-1 as we did for the non-
linear temperature sensor above, namely selecting each calibration point, dialing in the corresponding
voltage with a potentiometer, and saving the calibration data potentiometer as shown in Figure 4.
But this is a case where the empirical approach is easier (assuming we have some way to apply a series
of accurate forces during calibration). The advantage of the empirical approach is that it automatically
compensates for any variation in the sensor as well as the accuracy of the 5 volt supply and fixed 10K
resistor.
It turns out that the Lincoln Memorial Reverse penny (mid 1982 to present) weighs 2.5 grams. Therefore
various combinations of 4 to 40 pennies will give us a reasonable calibration source from 10 grams to
100 grams.
One liter of water weighs 1000 grams (1 kilogram). (You get the point – depending upon what you are
measuring, actual calibration using a known “input” can yield the quickest and most accurate results).
32
4.9 Reflectance Sensor
4.9.1 Overview
This example makes use of a QTR-1A reflectance senor. This is another example where the sensor
characteristics are a little vague, so it is difficult to come up with an exact transfer function. We
therefore use the empirical approach in this example to calibrate the sensor.
Below is a picture of the Reflectance Sensor. Information on the sensor can be found here.
33
The sensor connections to MB-1 are shown above. As the reflectance increases, the current flow in the
transistor increase, which decreases VOUT. Since the MB-1 measurements must track the direction of
VOUT with respect to the up/down sense of the parameter, we will define low measurements to have
high reflectance (toward white), and high measurements to have low reflectance (toward black). An
inverting Op Am could be inserted if desired to change the sense of the direction.
Below is a simple grey scale created with Microsoft Word. A full size copy is available on the
Downloads page.
To calibrate the sensor, we set a full scale value of 10 during the coupler setup routine, and then save
calibration data points at integer values ranging from 0 – 10. The calibration is done at each calibration
point with the sensor viewing the corresponding grey scale value in the above chart at a fixed distance.
34
Analog Meter Calibration:
A Linear scale with a full scale value of 10 can be used for this application. Legends for “Low
Reflectance” and “High Reflectance” are included on each end of the scale to clarify the meaning of low
and high readings. A sample scale is shown here.
In the examples above, we have dealt with linear sensors and nonlinear sensors, and examined different
approaches for performing the calibration. This example shows distance measurement applications. Both
linear and nonlinear sensors are available for measuring distance. We briefly discuss the linear device
but concentrate on the nonlinear device, because it brings in a new wrinkle – namely the fact that the
output voltage, while well within MB-1’s input range, is decreasing as a function of distance, and MB-
1 requires that the input voltage that it reads increases as the parameter being measured increases. We
have not had to deal with this issue so far.
This sensor, shown in Figure 22, is an ultrasonic device that produces a linear output voltage per unit
distance.
There is nothing new we can learn from calibrating this device compared with the above examples. We
can either program a single point (for example 980 mV corresponding to a calibration point of 100
inches), or we can use the empirical method, (although you might need to take into account the beam
width issues as the distance increases if using the empirical method).
35
Figure 22 Ultrasonic Distance Sensor
This sensor, shown in Figure 23, is an IR sensor with a highly nonlinear transfer function.
The input/output curve for this device is shown in Figure 24. As you can see, for the useful part of the
curve (where distance is > 6 cm), the output voltage decreases as distance increases. (Measurements
can not be made below this point because the sensor output voltage must be unique for each parameter
value, and that is not the case for the transfer function if the region where the distance is less than 6 cm.
is included.)
36
Figure 24 – Voltage vs. Distance for IR Sensor
There are two ways to deal with the “upside down direction” of the transfer function.
The reciprocal of the curve in Figure 24 – Voltage vs. Distance for IR Sensor, above 10 cm, is a
monotonically increasing function. If we calibrated the meter to measure the reciprocal of the distance,
this would require us to calculate the reciprocal of the measured value to get the actual distance
parameter – not elegant. However, you could make a custom analog meter face with two scales. The first
scale would be the actual parameter being measured (the reciprocal of distance). The second scale would
be the corresponding distances, which could be read directly from the second analog scale (which
would read from high to low).
4.10.2.2 Invert the output and Bias it so that the voltage seen by MB-1 is always positive
This can be done with op amps, but the approach we show below accomplishes the same thing, and is
quick and easy to implement. If we reverse the normal polarity of the two sensor output leads, and place
a 5 volt DC source in series with the sensor output leads so that the voltage will always be positive and
37
monotonically increasing, this solves the problem. (The voltage sources must float with respect to MB-
1’s ground).
A simplified diagram is shown below, where BAT1 and BAT2 could easily be implemented with wall
warts and 7805 voltage regulators. The resultant voltage vs. distance curve is shown in Figure 26.
Figure 25 – Sensor Reversed and Biased to get increasing voltage vs. parameter
38
Figure 26 - Voltage vs. Distance for IR Sensor – Inverted Curve
39
4.11 Liquid Level Sensor
4.11.1 Overview
This application uses a PN-6573P-8 eTtape liquid level sensor that has a useful operating range from
approximately 1 inch to 8.5 inches. The resistance of the sensor decreases as the height of the fluid
column increases. The sensor resistance is approximately 385 ohms when the fluid level is 0 and
approximately 60 ohms when the fluid level is at its maximum value of 8.5 inches with a resistance
gradient of 40 ohms per inch.
However, the resistance specs are rated at ±10%, and a plot of the actual resistance vs. level is not
perfectly linear. Therefore, this is a good application for the empirical approach, which is simple to do
accurately with this application.
Below is a picture of the sensor. The data sheet can be found here:
40
To measure the level of a liquid with MB-1 using this sensor, the circuit in the figure above can be used.
Since the sensor resistance decreases as the level of the liquid increases, this will cause the voltage into
MB-1 to increase for increasing pressure – which is what we want. By picking the fixed resistor value
approximately half way between the upper and lower resistance range of the sensor, we maximize the
voltage swing seen at the input of the coupler port, which gives us good resolution.
To perform the calibration, first set the corresponding coupler trim pot to maximum sensitivity (max CW
travel). Since the input stage of MB-1 can not saturate with an input voltage of less than 6.14 volts, and
since we are using a 5 volts supply, setting the trim pot sensitivity to its maximum value will result in
maximum accuracy and resolution without the possibility of saturating MB-1’s input circuitry. Go into
the coupler Setup screen, define the coupler type as GENERIC, and set the full scale value to 8 units.
Place the sensor in a container of adequate height. Add water at each one inch increment from 1 to 8, and
save the calibration data at each of these points.
If you would like to obtain the full range of the sensor (8.5 inches), you can set the full scale value to 9
during the setup. However, since the sensor is not capable of measuring a liquid above 8.5 inches, you
will have to calculate what the voltage would have been at 9 inches. This can be done by extending the
data curve in the data sheet until it reaches 9 and extrapolating what the sensor resistance would have
been at 9 inches. Knowing that value and the value of the fixed resistor above, you can calculate the
input voltage at the coupler input for this point, and dial in the last calibration point using a pot and 5 the
volt auxiliary source. If you want to extend the range above 8, for best accuracy, you should calculate the
output resistance curve for your sensor and use it rather than the nominal curve.
If you add the calibration point for 9 inches, you have used a hybrid approach to calibration for this
sensor - the empirical method for the first 8 points, and a calculated value for the last point (9 inches).
41
4.12 Light Level Sensor
4.12.1 Overview
The sensor used in this example is a ROHM BH1620FVC integrated circuit. It generates a DC current
proportional to the light intensity level, and has a range of more than 5 decades (1 lumen to > 100,000
lumens). In this example, we show how to take a sensor with a very wide range and display
measurements that fall into each of the five decades with good resolution on an analog meter.
This example also shows how we can measure quantities larger than the maximum full scale value that
MB-1 accommodates (30,000).
http://media.digikey.com/Photos/Rohm%20Photos/EVAL.BH1620FVC.jpg
Below is a picture of the light sensor. The data sheet can be found here:
The sensor has a power and ground lead, two digital inputs to control the sensitivity, and a current output
lead that gets connected to an appropriately sized resistor to generate a voltage proportional to the light
intensity. The generated voltage is fed to an MB-1 coupler input for calibration and measurement.
42
Figure 28 –Interfacing Light Sensor to MB-1
The appropriate logic signals are applied to leads GC1 and GC2 to provide three different sensitivity
settings. The output voltage is a function of the sensitivity setting according to the following equation:
Vout = S * EV * R
We will use the lowest sensitivity setting when measuring the highest light intensity (100,000 lumens). To
calculate the resistance value, we want Vout to be less than 5 volts when the Illumination is 100,000. This
limitation is required for the sensor current source to function properly when being powered with 5 volts.
For Vout to be less than 5 volts when the full scale light intensity is present, R must be less than 8.8K. We
will therefore use a standard value of 6.8K.
Taking into account MB-1s’ input sensitivity and dynamic range, the table below shows the usable range for
each sensitivity setting in yellow. For example, for the high sensitivity setting (which is used to measure low
43
light levels), we will be able to measure from 1 lumen to 1000 lumens, which will generate a VOUT from 3.876
millivolts to 3.3876 volts.
Graphs for each of the sensitivity settings are plotted on log scales in the chart below. Since the sensor is
powered from 5 volts, the portion of the graphs where the output exceeds 5 volts is not applicable.
44
Adjust the coupler trim pot for maximum sensitivity. There is no chance of overdriving the MB-1 input
in this application.
Since we want to measure up to 100.000 units in this application, and since the maximum full scale
value that MB-1 supports is 30,000, for the highest range, we will set the full scale value to 10,000 and
interpret all digital readings as the measurement value divided by 10. This will be used with the sensor’s
lowest sensitivity setting (i.e., highest light intensity). For reading intermediate light levels, we use the
medium sensitivity setting and will read the numerical values from MB-1directly with no correction.
Finally, for the lowest light readings, we use the sensor’s highest sensitivity setting. This requires us to
multiply the digital readings displayed on MB-1 by 10 to determine the actual light intensity.
We can see from the transfer function equation that the equation is linear and passes through the origin.
Therefore, we need to calibrate this application at a single point, namely the full scale value of 10,000.
This is most easily done by “dialing in” the calibration voltage of 3.876 volts using a stable voltage
source and potentiometer as shown in Figure 4.
Even though this meter face has three scales, during the Panel Meter calibration, you should specify only
one linear scale, not three. The Panel Meter full scale value should be set to 10,000. When reading the
analog meter, you should use the top scale, middle scale or bottom scale when the sensor sensitivity
setting is set to low, medium, or high respectively. We use this approach since we have calibrated our
“coupler” above to generate a full scale digital value of 10,000 for all three sensitivity settings.
45
To summarize the approach we have used, when reading numerical values from MB-1 (LEDs or LCD), a
multiplier factor of .1, 1, or 10 needs to be applied to the reading based on the sensitivity setting of the
sensor. When reading the analog meter, the reading can be read directly from the appropriate scale
without correction.
46
4.13 Field Strength Meter using Electromagnetic Signal Sensor
4.13.1 Overview
Any circuit that generates a DC voltage in the presence of an RF field can be used in this example. Many
circuits can be found with a Google search. This example makes use of an Electromagnetic Field sensor
specifically designed for this purpose.
Below is a picture of the RF sensor. Specifications for this sensor can be found here:
The sensor has only three leads: power, ground, and VOUT. Since the specifications for this device simply
indicate that VOUT increases as the RF field increases, the best we can do is make a relative field
strength meter. The device specs state that the range of operation is from 50 Hz to 100 MHz. The sensor
also has a built in sensitivity pot, and comes with its own “antenna”, but that can be replaced with your
own antenna to provide increased sensitivity.
Since we are using this as a relative strength indicator and since V OUT from this sensor can never exceed
5 volts, this is an easy sensor to calibrate.
Adjust the coupler trim pot for maximum sensitivity. There is no chance of overdriving the MB-1 input
in this application. The full scale value we select is arbitrary. We will select a full scale value of 1000,
which provides good resolution.
We need to perform the calibration for this sensor at a single point, namely the full scale value. Apply a
calibration voltage of 5 volts to the coupler port and save the calibration data. Alternatively, you may set
the calibration voltage to a lower value if you want to increase the sensitivity of the sensor/antenna
combination. Calibration is most easily done by “dialing in” the desired voltage using a stable voltage
source and potentiometer as shown in Figure 4.
47
Analog Meter Calibration:
Any linear scale analog meter with a full scale rating of 1 mA or less will work fine in this application. A
sample Field Strength Intensity scale is shown here with three scales: 0- 10, 0- 100, 0 – 1000. Since we
have built in a large amount of resolution during the coupler calibration step, we provide three ranges to
make use of that resolution.
Notes: A homebrew unit that can be used with MB-1 that has provisions for amplification can
be found on N9ZIA’s web site.
48
4.14 RF Ammeter
4.14.1 Overview
Like an RF power coupler and the other sensors discussed above, an RF Current Sensor is really just
another form of an analog sensor. When you bring up the Coupler Setup screen however, you will see
that there is a separate choice for the RF Ammeter setup (AMPS) as shown in the setup screen below.
This has to do with the way MB-1 processes analog voltages that are either below or above the voltages
corresponding to the lowest and highest calibration points respectively. This is discussed in detail in 9.3.
Suffice it to say here that for multipoint calibrations for both RF Power couplers and RF Ammeter
couplers, MB-1 will compute power and current measurements respectively for all encountered
voltage levels, including voltages lower or higher than the voltages corresponding to the smallest and
largest calibration points. That is not the case for multipoint calibrations identified as GENERIC in the
setup screen.
Below is a picture of the RF Current sensor used in an MFJ RF current meter. You will also find circuits
for several RF current sensors on the Internet. They are relatively easy to build.
49
Even though an ideal current sensor has a linear transfer function that passes through the origin, and
could therefore be calibrated at a single point, there is some advantage in terms of accuracy to calibrating
the coupler at multiple points for the same reason we calibrate an RF Power coupler at multiple points:
namely real world couplers are not ideal devices.
RF Sensor Calibration:
The following figure and table are taken from the MB-1 User’s Manual. The figure shows one method of
calibrating this application using a reference RF power meter in tandem with the RF current sensor.
When driving a 50 ohm resistive load, the RF current can be calculated knowing the power level as read
from the reference Power Meter. Multiple values are selected in the table below to ensure that we
characterize the coupler over its low, medium, and high operating range.
Reference RF
Watt Meter
Transmitter RF Sensor
being
Max PWR out = 1000w calibrated 50 Ohm
Dummy Load
As mentioned above, RF currents less than the lowest calibration point of .1 amps and higher than the
largest calibration point of 4 amps (in the above example) will still be measured and displayed by MB-1.
In these cases, MB-1 uses the transfer function characteristics at the lowest and highest calibration points
respectively to compute the values.
50
Note – when performing the coupler setup, be sure to follow the procedure for setting the coupler trim
pot to ensure that you do not drive the MB-1 Amplifier/Mux into saturation. This procedure is described
in detail in the MB-1 User’s Manual.
51
4.15 Measuring Tilt using an Accelerometer Sensor
4.15.1 Overview
This example will measure tilt from 0 degrees to 90 degrees. The sensor used is a dual axis sensor, but
we will use only a single channel. A good discussion of how tilt can be measured using an
accelerometer is given here, but the main point is that the displacement that accelerometer would
undergo on a given axis if the acceleration was 1g is identical to the displacement that the accelerometer
undergoes when the board is oriented 90 degrees. At that point, the sensor is undergoing 1g due to
gravity even though the sensor is not moving.
Below is a picture of the accelerometer sensor. The data sheet can be found here:
The figure below shows how the sensor would be mounted. When the inclination angle is 90º (X arrow
pointing straight down), the X axis acceleration is 1g.
52
Figure 31 – Sensor Orientation
Hookup is straightforward:
Lead Description
ST Self Test (see data sheet)
YP Not used
XP Not Used
XA = 2.5 + 1.0 * a
a = XA - 2.5
53
where XA is the analog output voltage in volts and a is the acceleration in g units.
This is a linear function, but the above equation applies for acceleration, not tilt. From the above
equation, we know that the output voltage at 0 degrees (no tilt) will be the idle output voltage of 2.5 volts
(VCC/2). At 90 degrees, the sensor sees an acceleration of 1g. Therefore, the analog output voltage will
be 2.5v + 1000 mv/g * 1g = 3.5 volts. But between the two end points, the output voltage varies as the
arcsine of the acceleration (see Application notes for details). Therefore
Using the approach we have used in other examples, we want to determine the corresponding voltage
that corresponds to a particular calibration point. Assume that we will calibrate this sensor at 10 degree
points: 0º, 10º, 20º, 30º, ... 90º. We need to determine the corresponding voltage, XA, corresponding to
these points. Therefore, we need to solve for XA in the above equation.
The calibration points and the corresponding sensor output voltages are shown below:
Angle XA
(degrees) (analog voltage)
0 2.50000
10 2.67365
20 2.84202
30 3.00000
40 3.14279
50 3.26604
60 3.36603
70 3.43969
80 3.48481
90 3.50000
The error analysis is summarized in the table below. The numbers in red from the first two columns in
the table below are copied from the table above, which are the calibration points.
The next column, Midpoint Angle is the midpoint between the two angles in the row below and above
the entry in column 1. This is the measurement value that MB-1 will declare when the voltage from the
sensor is exactly half way between the XA calibration points in column 2. These voltages are shown in
the Midpoint Voltage column.
The next column subtracts the idle voltage of 2.5 volts. We then take the arcsine of that value to
determine the actual angle that corresponds to the midpoint voltage. This is shown in the Interpolated
54
Measurement Angle column. The last column shows the error due to interpolation, which is the
difference between the Midpoint Column entry and the Interpolated Measurement Angle column.
The worst case error occurs at the higher angles and is slightly more than 2 degrees.
Adjust the coupler trim pot for maximum sensitivity. There is no chance of overdriving the MB-1 input
in this application.
To calibrate this application, set the full scale value to 90 “units”. Then perform calibration at the
calibration points shown in the above table in columns 1 and 2. This is most easily done by “dialing in”
the calibration voltage for each of the ten calibration points using a stable voltage source and
potentiometer as shown in Figure 4.
55
4.15.3 Related Sensors
There are a whole series of sensors that can measure acceleration. Some of these can be found
here.
This data sheet has the specifications for and Inductive Angle Sensor that generates an analog voltage
that varies linearly with respect to the angular displacement, and can therefore be used with MB-1.
56
4.16 Measuring Tilt using a Discrete Tilt Sensor
4.16.1 Overview
Some sensors have logic outputs that represent the state of the parameter being measured. An example of
such a sensor is the SHARP GP1S036HEZ, which provides 4 output states using two logic outputs.
Below is a picture of the discrete tilt sensor. The data sheet can be found here
The logic outputs, PT1 and PT2, indicate the sensor’s orientation as either an upright, right, down or left
as shown in the table below:
Table 5 – Logic Signals and Corresponding Analog Voltage for Discrete Tilt Sensor
Orientation PT1 PT2 VOUT (Volts) MB-1 Reading
(ordered in
increasing
value)
2.037 0
1 1
2.5 1
0 1
3.437 2
1 0
0 0 5.0 3
57
The circuit diagram below shows how we can derive 4 discrete analog voltages from this sensor for the
four discrete orientations. We can then use the derived analog voltages to interface to MB-1.
The two transistors, Q1 and Q2 in the interface circuit, are turned on or off by the PT1 and PT2 sensor
outputs.
By picking appropriate values of R1, R2, and R3, we can generate 4 different DC voltages at VOUT
corresponding to the sensor’s four orientations. (This assumes a 0 volt drop across Q1 and Q2 when
turned on. In practice, you would want to measure VOUT for the four states to determine the actual
calibration values to account for the VCE drops and resistor tolerances).
To calibrate this application, set the full scale value to 3 “units”. Then perform calibration at the
calibration points shown in the table below. These are the two rightmost columns from the table above.
Digital readings of 0, 1, 2, and 3 correspond to orientations of down, right, left and up respectively.
58
Table 6 – Calibration Points for Discrete Tilt Sensor
Orientation in Vout (volts)
Numeric Form
0 2.037
1 2.5
2 3.437
3 5.0
Admittedly, driving LEDs in place of R1 and R2 is a much simpler way to use this particular sensor. But
if you encounter a sensor with multiple logic outputs that represent the parameter being measured, if you
want to display the parameter in numeric form or on an analog scale, an approach similar to this one
could be used.
Notes:
In effect, the above interface circuit is a simple D-to-A converter. We could have used an 8 bit D-to-A
converter such as the Analog Devices AD558 instead. When operated at 5 volts, this device generates a
full scale voltage of 2.56 volts. A simplified schematic, using this device for the discrete tilt sensor is
shown below. We use only the 2 most significant bits. Therefore, the four generated output voltages will
be approximately 0, 2.56v/4, 2.56v/2, and 2.56v. If the AD558 was used to interface to this application,
these would represent the voltages for the four calibration points.
Figure 33 - Interface Circuit for Discrete Tilt Sensor using D-to-A Converter
For the connections shown in the above diagram, these four voltages in increasing order would represent
positions of UP, RIGHT, LEFT, and DOWN respectively. Using the D-to-A solution for interfacing to
59
MB-1 starts to make more sense as the number of logic outputs representing the parameter being
measured increases above two.
60
4.17 Logarithmic Sound Pressure Level Sensor
4.17.1 Overview
This example uses a Phidgets1133 Sound Sensor, which produces a DC output voltage that is a nonlinear
function of the sound level. The sensor is rated at sound pressure levels of 50 dB to 100 dB with a
frequency range from 100 Hz to 8 kHz. But as stated on the Phidgets website, these sensors are not
industrial grade sensors and should not be expected to perform as such. This example will use this sensor
to display sound pressure directly in logarithmic units (dB).
Below is a picture of the sound sensor. The data sheet can be found here:
From the data sheet, the equation of the Sound Pressure Level with respect to output voltage, V OUT, is
shown below.
61
Figure 34 - Output voltage vs. Sound Pressure
110
100
90
SPL (dB)
80
70
60
50
40
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2
Vout (volts)
For calibration, we need to know the voltages that correspond to the SPL values from 50 dB to 100 dB.
Solving for Vout in the above equation:
62
A chart of the voltages for these points is shown below.
The entries in red in the above table correspond to available MB-1 calibration points. At these points, the
calibration should be exact. However, the entries in black will undergo linear interpolation. Since the
transfer function is nonlinear, we know there will be some error at these points. For an application of this
type, it is worth evaluating the magnitude of the errors at the intermediate points so that you can
determine if the accuracy across the usable range will meet your needs.
The first two columns in the table below are copied from the table above, and represent the exact SPL
and VOUT values calculated using the data sheet formula. The next column (Delta) is the difference
63
between VOUT for the next 10 dB step and the current SPL value. For example, the Delta entry for the
SPL=50 row is VOUT (@ 60dB) - VOUT (@ 50dB). The next column is simply 1/10th of that value.
Since MB-1 uses linear interpolation, adding the 1/10 th step to VOUT at 50 dB represents the VOUT value
at which MB-1 will declare the measurement to be 51 dB. Adding a 2/10ths step to VOUT at 50 dB
represents the voltage at which MB-1 will declare the measurement to be 52 dB, etc. These are the
entries shown in the blue column below.
You can see, for example, that the exact VOUT that corresponds to SPL=51 is 0.057823047. But with
linear interpolation, MB-1 will declare a measurement of 51 dB at the voltage in the corresponding blue
column. You can see that the values are somewhat different.
The blue column therefore represents the voltages at which MB-1 will declare the measurement value to
be an integral value in the 50 dB to 100 dB range. For the voltage entries in this column, we then
calculate the exact SPL values corresponding to those voltages using the data sheet formula. With the
exception of the entries in red (at each 10 dB point), the Nominal SPL value in column 1 and Actual SPL
value in the green column will differ due to the interpolation. The difference is the error introduced by
the interpolation at that point. The error values are shown in the last column.
This approach is repeated for each integer value in the active range (50 dB to 100 dB). As can be seen
from the last column, none of the errors is greater than .73 dB.
Interpolated
Vout for
which
1/10th MB-1 will
Delta for Delta declare
this 10 for this the Nominal
Nominal dB 10 dB SPL value in Actual Error
SPL Vout (Exact) range Range column 1 SPL Value (dB)
50 0.0544818 0.04432 0.00443 0.05448 50 0
51 0.057823047 0.058913 51.3138528 0.313853
52 0.061369177 0.063345 52.5323713 0.532371
53 0.065132781 0.067776 53.6684596 0.66846
54 0.069127197 0.072208 54.7325669 0.732567
55 0.073366579 0.07664 55.7332736 0.733274
56 0.077865951 0.081071 56.6777117 0.677712
57 0.082641257 0.085503 57.5718736 0.571874
58 0.08770942 0.089934 58.4208425 0.420843
59 0.093088399 0.094366 59.2289679 0.228968
60 0.0987973 0.08036 0.00804 0.0988 60 0
61 0.104856223 0.106833 61.3138528 0.313853
62 0.111286769 0.11487 62.5323713 0.532371
63 0.118111683 0.122906 63.6684596 0.66846
64 0.12535515 0.130942 64.7325669 0.732567
65 0.133042839 0.138978 65.7332736 0.733274
66 0.141201993 0.147014 66.6777117 0.677712
67 0.149861526 0.15505 67.5718736 0.571874
64
68 0.159052124 0.163086 68.4208425 0.420843
69 0.168806357 0.171123 69.2289679 0.228968
70 0.1791588 0.14573 0.01457 0.17916 70 0
71 0.190146109 0.193732 71.3138528 0.313853
72 0.201807251 0.208304 72.5323713 0.532371
73 0.214183539 0.222877 73.6684596 0.66846
74 0.227318831 0.23745 74.7325669 0.732567
75 0.241259674 0.252023 75.7332736 0.733274
76 0.256055471 0.266595 76.6777117 0.677712
77 0.271758654 0.281168 77.5718736 0.571874
78 0.288424871 0.295741 78.4208425 0.420843
79 0.306113181 0.310314 79.2289679 0.228968
80 0.3248863 0.26426 0.02643 0.32489 80 0
81 0.344810654 0.351312 81.3138528 0.313853
82 0.365956951 0.377739 82.5323713 0.532371
83 0.388400092 0.404165 83.6684596 0.66846
84 0.412219609 0.430591 84.7325669 0.732567
85 0.437499912 0.457017 85.7332736 0.733274
86 0.464330588 0.483443 86.6777117 0.677712
87 0.492806715 0.50987 87.5718736 0.571874
88 0.523029206 0.536296 88.4208425 0.420843
89 0.555105159 0.562722 89.2289679 0.228968
90 0.5891482 0.47921 0.04792 0.58915 90 0
91 0.625279097 0.637069 91.3138528 0.313853
92 0.663625757 0.684991 92.5323713 0.532371
93 0.704324113 0.732912 93.6684596 0.66846
94 0.747518389 0.780833 94.7325669 0.732567
95 0.793361651 0.828754 95.7332736 0.733274
96 0.842016355 0.876676 96.6777117 0.677712
97 0.89365492 0.924597 97.5718736 0.571874
98 0.948460337 0.972518 98.4208425 0.420843
99 1.00662682 1.020439 99.2289679 0.228968
100 1.0683605 1.06836 100 0
Adjust the coupler trim pot for maximum sensitivity. There is no chance of overdriving the MB-1 input
in this application.
To calibrate this application, set the full scale value to 100 “units”. Then perform calibration at the
following points: 50, 60, 70, 80, 90, and 100 using the corresponding voltage levels shown in red (VOUT
Exact) in the table above. This is most easily done by “dialing in” the calibration voltage for each of the
six calibration points using a stable voltage source and potentiometer as shown in Figure 4.
65
Analog Meter Calibration:
A Linear scale with a full scale value of 100 could be used for this application. However, Panel Meters
can use the linear scale setup procedure only if the starting value on the scale is 0. If you used a scale
with a range from 0 – 100, this would give you a dead zone from 0 – 50 since the sensor calibration just
covers the range of 50 – 100 dB, which is the usable range of the sensor. If you use an existing meter
face, this is the most straightforward approach. But if you decide to design your own meter face, you can
essentially create a linear scale from 50 – 100, and calibrate the analog meter as a nonlinear meter scale
during the Panel Meter calibration setup procedure. The nonlinear scale option must be used since the
scale’s starting value is not 0.
Above, we show a custom meter scale for this application. The majority of the scale covers the usable
range: 50 – 100. A small portion of the scale, the section highlighted in yellow, is allocated for “don’t
care” calibration points that are required as part of the nonlinear scale calibration when the scale does not
start at 0. This will become more apparent below.
To calibrate this scale for use with MB-1 using the Panel Meter calibration routine, set the full scale
value to 100, and set the number of calibration points to 10. During Panel Meter calibration, you will be
prompted to calibrate the meter scale at 10 points: 10, 20, 30, ... 100.
For calibration points 10 – 40, you must advance the needle beyond its 0 resting point. Furthermore, you
must advance the needle forward slightly after calibrating each of these “phantom points” since the
software integrity checks require the ADC value to be monotonically increasing for all of the calibration
66
points (including these "don't care" points). As long as each of the four calibration points, 10 - 40, are
in the yellow region, and each calibration point has a larger deflection than the preceding calibration
point, you will be OK.
Once you reach the calibration points for 50 dB and above, calibrate the meter in the normal fashion by
simply “dialing the needle” to each calibration point on the scale and pressing the SELECT menu button
to save the calibration point. After calibration, any value from 50 - 100 will read correctly. Any value
less than 50 will read in the yellow portion of the scale, effectively indicating an underrange (which is a
valid indication for this application).
67
4.18 Color Sensor Module
4.18.1 Overview
This application uses a TCS230 color sensor that produces an output voltage that varies linearly with
respect to the color intensity of one of three colors (red, green, blue). The color to be monitored is
selected by applying logic 0 or logic 1 signals to terminals S0 and S1 as shown in the data sheet.
Below is a picture of the TCS230 sensor. The data sheet can be found here.
The analog output voltage (VCOLOR) vs. color density is shown below for two different scale
arrangements. These graphs are applicable when the reference voltage is set to 4.95 volts. If you want to
set the reference voltage exactly to this value, you can use the MB-1 5 volt auxiliary power with an
appropriate voltage divider, but this value is close enough to 5 volts so that the 5 volt auxiliary power
source can be used directly without much impact.
68
Figure 35 - Figure 36 – Color Sensor Curves for RGB Scale and % Scale
69
We can represent the color intensity using one of two scale arrangements:
1. The color intensity can be represented as an 8 bit value of the R, G, or B intensity. In this case, the
scale would range from 0 – 255.
2. The color intensity can be represented as a percent in the range 0% to 100%. 100% would indicate
that color being monitored is at its maximum intensity. In this case, the scale would range from 0 –
100.
We have used Excel’s Trend Line feature in the above graphs with a linear fit. The R 2 = 1 value tells us
that the linear fit is an exact fit (i.e., the data points in the spec sheet lie on a straight line). We will use
the trend line equation on the top graph to display the color intensity as an 8 bit value. We will use the
trend line equation on the bottom graph to display color intensity as a percent.
Since the equation does not pass through the origin for either scale arrangement, we need to do
multipoint calibration. Since the equation is linear, only two points are required. For example, to cover
the full range of the RGB transfer function (which ranges from 0 – 250), we can perform the calibration
at the two closest available MB-1calibration points, namely 0 and 300.
RGB – 8 bit value (Displayed Measurement value 0 – 255) - The closest MB-1 calibration point to 0
(x axis) is 0. The closest MB-1 calibration point that encompasses the entire range on the high end is 300
(x axis).
Using the formula from the top graph, the voltages corresponding to these two points are as follows:
Percentage value (Displayed Measurement value 0 – 100%) - The closest MB-1 calibration point to 0
(x axis) is 0. The closest MB-1 calibration point that encompasses the entire range on the high end is 100
(x axis).
Using the formula from the bottom graph, the voltages corresponding to these two points are as follows:
Regardless of which scale we use (R, G, B, or percent), the two calibration points can be dialed in with a
stable voltage source and potentiometer as shown in Figure 4. You will not be able to achieve the 5.7072
volt setting in the RBG scale using just the potentiometer connected to MB-1’s 5 volt auxiliary power
output. You can either use a larger voltage source to power the pot during calibration or you can
temporarily connect any 1.5 volt battery in series with the pot wiper during calibration. This will give
your pot/battery arrangement a range of approximately 1.5 volts to 6.5 volts.
70
If you use the percentage scale, both calibration voltages can be achieved directly using just the auxiliary
5 volt source from MB-1.
71
4.19 Measuring Blood Alcohol Level - Using a Nonlinear Device
4.19.1 Overview
The MQ-3 Alcohol Sensor samples the concentration of alcohol in an air sample and changes its
resistance as a function of the alcohol concentration. A picture is shown below.
While this example measures the alcohol concentration in air, the conversion to Blood Alcohol Content
(BAC) should be fairly straightforward if I understand the Wikipedia article on the topic.
This spec sheet is somewhat different than the ones used in previous examples. Instead of graphing
resistance vs. alcohol concentration, the device specs show a resistance ratio vs. alcohol concentration.
The ratio is:
RS/RO
where RS is the sensing resistance for a given alcohol concentration, and Ro is the sensor resistance
when the alcohol concentration is at a know reference value (.4 mg/Liter). I believe that the reason this
was done is because there is a large variation in the sensor resistance reference points among samples.
For example, at the reference level of .4 mg/Liter, the sensor resistance can vary anywhere from 1 Meg
to 8 Meg depending on the sample. So to use this sensor, you have to be able to determine its resistance
for the reference concentration of .4 mg/Liter.
What is guaranteed in the spec however, is the Rs/Ro ratio. So again, this sensor presents some new
issues that we did not have to handle in the earlier examples.
The spec sheet is shown below. The manufacturer spec sheet graphs the data on log scales. We plotted
the data on linear scales for this example.
72
Figure 37 – Alcohol Sensor Curve
The blue data series is the piecewise graph of the actual points from the manufacturer’s spec. Since this
was almost a straight line on a log graph scale, it is worth a little effort to determine if we can
characterize the data with an equation. Excel’s trend line feature is useful for this. This Excel feature is
usually used to predict trends – future data points, from the derived equation. But if you can get one of
Excel’s trend types to give a very close match to the data points, you can then get access to the actual
trend line equation generated by Excel and use that equation to aid in calibration.
The generated trend line is shown in red in the above figure. Excel also computes what is called an R 2
value. The closer that value is to 1.0, the better the fit of the trend line. The data in the red box shows
both the equation of the trend line and the R2 value, which is in fact very close to 1. Therefore, we can
assume that we have an accurate formula that characterizes our sensor, and we will use that instead of a
few discrete data points.
We used the Excel Power trend type to fit these data points. Unless you’re a Math major, try all of the
Excel trend types, one at a time using trial and error to see which, if any, gives the best R2 value. That is
the approach we used.
73
4.19.2 Wiring
The wiring for the alcohol sensor is shown below. Since the resistance of the sensor decreases as the
alcohol concentration increases, we wire the alcohol sensor to the voltage source, which will cause the
voltage fed to the MB-1 coupler port to increase as the alcohol concentration increases.
The spec applies when the Fixed R resistance is 200K. The input resistance of an MB-1 port is
approximately 300K, so placing a 680K resistor in parallel gives a 209K, which is probably close
enough to satisfy the spec sheet requirement for a 200K load.
The heater on the sensor can draw up to 750 milliwatts. If you decide to use the 5 volt auxiliary outputs
on MB-1 to power the sensor, turn off the external Bar Graph display if on so as not to overload the
Auxiliary power bus. (Any external 7-segment displays can be left on, since the current draw on those is
not as high as the external Bar Graph).
Rs/Ro = 0.5176x-0.6735
From that, we can determine the actual sensor resistance as a function of Ro.
Rs = Ro * 0.5176x-0.6735
74
Remember that Ro is the sensor resistance when the alcohol concentration is a know reference value (.4
mg/Liter), and can vary from 1 Meg to 8 Meg sample-to-sample.
For this example, assume that we have a sensor with a known Ro value of 2 Meg. We can now
determine the voltage seen by the MB-1 coupler port as a function of alcohol concentration. (Remember
that x in the equation above is the alcohol concentration (the X axis)).
If we plug the numbers into Excel, it provides us with the expected voltages for all of the calibration
points within the sensor advertised range of 0.05mg/L-10mg/L.
75
At this point, we can use the approach of connecting a stable voltage source to the end points of a pot,
and feeding the wiper output of the pot into MB-1 as we did in some of the earlier examples. The
calibration data would be saved for each point in the above table.
The data below shows the midpoint voltage at which the software interpolates the intermediate values
between calibration points, and the actual voltages for the calibration mid points using the trend formula.
76
Surprisingly, the error at the midpoints is very small – less than 2%. Given the complexity of the trend
line equation and the series resistance term that the voltage divider introduces, it is very surprising that
the error is so small. This is probably not typical of what you would see for an “arbitrary nonlinear
sensor” when used with MB-1. But the point here was to go through some error analysis – something
you will want to do if you are thinking of using the MB-1 Generic Meter function for a serious
application.
4.19.5 Details
You may have noticed that we never addressed how to determine the calibration of the alcohol sensor
itself – in other words, what is its Ro value of a given sample since it can range from 1 Meg to 8 Meg.
Good point. This appears to be a harder problem than it sounds like.
If one were serious about performing this calibration, I suppose you could get some liquor of a known
proof and an enclosed container of known volumes such that when all of the liquor evaporates, the
concentration would be .4 mg/ Liter. This is an approximation at best, but hopefully this example
provided some additional insight on using MB-1 with the family of gas sensors listed above.
77
General Monitors Toxic Gas Detector Data Sheet
78
4.20 Angular Rate Sensor (Gyroscope)
4.20.1 Overview
This example makes use of an Angular Rate Sensor. These sensors generate an output signal that varies
linearly with respect to the angular velocity around some axis. Below is a picture of the sensor. The data
sheet can be found here:
This angular rate sensor will measure the angular velocity in degrees per second around the Z axis as
shown in the figure below. The sensor’s maximum and minimum range is range is 100° per second
clockwise and 100° per second counter clockwise.
79
When the device is stationary, the device outputs a reference voltage of approximately 1.35 volts. As the
device is rotated CCW, the output voltage decreases from the idle reference voltage by .65 millivolts per
degree per second. As the device is rotated CW, the output voltage increases from the idle reference
voltage by .65 millivolts per degree per second. This corresponds to a voltage range from (1.35 - .065 =
1.285 volts) to (1.35 + .065 = 1.415 volts) corresponding to an angular velocity of -100° per second to
+100° per second respectively. Therefore, the range in the analog output voltage is only 130 millivolts.
MB-1 can read to millivolt resolution at the low end when the input voltage to MB-1 is small. This is the
region where MB-1 applies the maximum gain of 32 from the Amplifier/Mux that processes the coupler
input voltage. But since the working voltage range from the output of this sensor is in the vicinity of 1.35
volts, MB-1’s resolution will be in the multi millivolt range, which is not good enough to give resolution
of 1° per second. Therefore, to provide the improved resolution, we will insert an interface circuit
between the sensor and the MB-1 coupler input to amplify the signal excursion.
The blue line in the graph below shows the sensor output voltage for the full range of angular velocities.
The green line in the graph below shows the sensor output after it has been processed by the Amplifier
circuit in Figure 39. The circuit has a gain of 19 ( 1 + (180K/10K) ). A gain of 19 was chosen since it
maximizes the + and – excursion around the idle voltage (1.35 v) without bottoming out at 0. The
amplification is provided by op amp2 (right).
Op amp 1 (left) simply provides a low impedance source of approximately 1.35 volts (a virtual ground)
so that the op amp 2 can amplify the delta between the sensor’s idle voltage and the sensor’s output
when an angular velocity is being measured. Since the idle voltage from the sensor is not exactly 1.35
volts, adjustable resistor R1 is included so that the virtual ground output of op amp1 can be adjusted to
match the actual idle voltage of the sensor during calibration.
80
Figure 39 – Interface Circuit for Angular Velocity Sensor
81
4.20.3 Calibration Procedure
Since MB-1 is 0-based, we must start the low end of the range at 0. If we set up the calibration with a
full scale value of 200, our digital readings on MB-1 will vary from 0 – 200. To read the actual angular
velocity using the digital displays, subtract 100 from MB-1’s digital reading.
If you are adding an analog meter to MB-1 for this application, the scale can be created with the actual
sensor limits (100 deg/sec CCW to 100 deg/sec CW) allowing the analog meter to be read directly.
If we add a trend line to the amplified signal and display its formula, we get:
where v is the angular velocity. Since the curve is a straight line, we need to calibrate at only two points.
(We need two points instead of one since the equation does not pass through the origin (0, 0)).
With the 100 deg/sec offset discussed above, the equation becomes:
If we plug in the two closest available MB-1 calibration points (0 and 200), this gives the following
calibration point input/output values:
During calibration, these values can be “dialed in” with a potentiometer powered from the 5 volt
auxiliary voltage source as previously discussed.
82
The figure below shows such a scale. A full size copy can be found here.
83
4.21 Hall Effect Magnetic Sensor
4.21.1 Overview
This example uses a Hall Effect Magnetic Sensor whose DC output voltage varies linearly with respect
to the magnetic field. Below is a picture of the sensor. The data sheet can be found here.
If you are looking for a good reference on Hall Effect Sensors, check this documentation from the
Honeywell Corporation.
This sensor is designed to read both polarities of a magnetic field from approximately -500 gauss to
+500 gauss. The sensor comes with two Neodymium magnets that are capable of generating a
magnetic field of at least 500 gauss with both polarities when moved close to the sensor.
The transfer function is shown on the red data series in the chart below. The red curve does not satisfy
the MB-1 requirement that the sensor voltage increase monotonically as the parameter value increases.
But the definition of the magnetic polarities is arbitrary with respect to the sensor. If we reverse the sense
of the polarity, we get the transfer function shown in the blue data series in the chart below. The transfer
function in blue can therefore be used by MB-1 for calibration. All that this reversal means is that we
now define the direction of the magnetic field that causes the sensor voltage to increase from its idle (0
gauss) value of 2.5 volts as positive, and vice versa.
84
Figure 40 – Magnetic Sensor Transfer Function
4.5
3.5
3
Vout vs. Φ (normal polarity)
Vout
1.5
0.5
0
-500 -400 -300 -200 -100 0 100 200 300 400 500
Φ
The above curves are idealized. The sensor sheet indicates that the actual range of the output sensor is .2
volts to 4.7 volts.
Minimum sensor voltage (approximately .2 volts) at maximum detectable magnetic field with
negative polarity.
Maximum sensor voltage (approximately 4.7 volts) at maximum detectable magnetic field with
positive polarity.
Since MB-1 calibration points are all positive, we define the calibration points as follows:
Therefore, when reading the MB-1 numeric displays, 500 must be subtracted from the MB-1 reading to
determine the value of Φ as shown below:
85
Φ (in Gauss) = MB-1 Reading -500
We use the empirical method for calibration as shown in the table below:
86
4.21.4 Related Sensors
There are a whole series of sensors that can measure magnetic fields. Some of these can be
found here.
Another magnetic sensor, the Analog Devices AD22151, has more advanced capabilities than most of
the sensors listed above. The Analog Devices sensor allows you to control the sensitivity of the sensor. It
can also be configured for unipolar or bipolar operation.
87
4.22 Ohmmeter Example
4.22.1 Overview
This example uses the simple circuit shown below to measure an unknown resistance. VOUT, the voltage
at the tap of the voltage divider, increases as the unknown resistance increases.
We can calculate the voltage for several resistance values corresponding to available MB-1 calibration
points. These are shown in the table below.
To calibrate this application, we simply dial in the corresponding voltages for the various calibration
points in the above table using a stable voltage source and potentiometer as shown in Figure 4.
88
4.22.3 Error Analysis
We can take a look at how well the linear interpolation will at the midpoint of the above calibration
points. The R and VOUT columns from the above table are repeated in the table below in the first two
columns. Because MB-1 uses linear interpolation between calibration points, MB-1 will declare the
measurement value to be half way between the corresponding calibration points in the left column when
the voltage is exactly half way between the corresponding voltage levels in the VOUT column.
Each entry in the VMID column is the midpoint voltage for the current row and the following row. For
example, the first VMID entry is the voltage half way between the voltage calibration points for 1 and 2
ohms.
RDECL is the resistance value that MB-1 will declare when the voltage equals the corresponding VMID
entry. For example, a resistance of 1.5 ohms, which is the midpoint of the first two resistance entries,
will be declared when the measured voltage is .007488 volts.
RACT is the actual resistance that would result in at the corresponding VMID voltage. This is
calculated simply using the voltage divider formula.
ERR is the error in ohms between the actual resistance RACT, and the declared resistance,
RDECL, for each midpoint. Finally, the last column represents the error as a percentage of the
nominal R value. The result is reasonable tracking between the MB-1 measurement value and
the actual resistance value with a maximum error of 3.84%. For the majority of entries, the
error is less than 1%.
89
100 0.454545 0.505051 112.5 112.3596 0.140449438 0.125
125 0.555556 0.603865 137.5 137.3626 0.137362637 0.1
150 0.652174 0.698427 162.5 162.3656 0.134408602 0.082781
175 0.744681 0.789007 187.5 187.3684 0.131578947 0.070225
200 0.833333 0.99359 250 248 2 0.806452
300 1.153846 1.291209 350 348.1481 1.851851852 0.531915
400 1.428571 1.547619 450 448.2759 1.724137931 0.384615
500 1.666667 1.770833 550 548.3871 1.612903226 0.294118
600 1.875 1.966912 650 648.4848 1.515151515 0.233645
700 2.058824 2.140523 750 748.5714 1.428571429 0.19084
800 2.222222 2.295322 850 848.6486 1.351351351 0.159236
900 2.368421 2.434211 950 948.7179 1.282051282 0.135135
1000 2.5 2.559524 1050 1048.78 1.219512195 0.116279
1100 2.619048 2.67316 1150 1148.837 1.162790698 0.101215
1200 2.727273 2.77668 1250 1248.889 1.111111111 0.088968
1300 2.826087 2.871377 1350 1348.936 1.063829787 0.078864
1400 2.916667 2.958333 1450 1448.98 1.020408163 0.070423
1500 3 3.038462 1550 1549.02 0.980392157 0.063291
1600 3.076923 3.112536 1650 1649.057 0.943396226 0.057208
1700 3.148148 3.181217 1750 1749.091 0.909090909 0.051975
1800 3.214286 3.245074 1850 1849.123 0.877192982 0.047438
1900 3.275862 3.304598 1950 1949.153 0.847457627 0.043478
2000 3.333333 3.541667 2500 2428.571 71.42857143 2.941176
3000 3.75 3.875 3500 3444.444 55.55555556 1.612903
4000 4 4.083333 4500 4454.545 45.45454545 1.020408
5000 4.166667 4.22619 5500 5461.538 38.46153846 0.704225
6000 4.285714 4.330357 6500 6466.667 33.33333333 0.515464
7000 4.375 4.409722 7500 7470.588 29.41176471 0.393701
8000 4.444444 4.472222 8500 8473.684 26.31578947 0.310559
9000 4.5 4.522727 9500 9476.19 23.80952381 0.251256
10000 4.545455 4.616477 12500 12037.04 462.962963 3.846154
15000 4.6875 4.724702 17500 17162.16 337.8378378 1.968504
20000 4.761905 4.800307 25000 24038.46 961.5384615 4
30000 4.83871
The highest resistance we can measure with the above configuration is 30K. To increase the range, the
fixed resistor in Figure 41 can be increased. Figure 42 below shows the transfer function for two
different values of the fixed resistor. The curve in blue shows the transfer function when R = 1K, which
was the case covered in the above example. The curve in red shows the transfer function when the fixed
R = 10K. With the 10K resistor, we can get an upper usable range close to 1 Megohm. The tradeoff is
that the resolution at the lower end (e.g., 1 – 100 ohms) suffers somewhat.
90
Figure 42 – Increasing Ohmmeter Range
3 Fixed R = 1K
Vout
2 Fixed R = 10K
0
1 10 100 1,000 10,000 100,000 1,000,000
Unknown R
To implement the higher range, since the maximum available MB-1 calibration point is 30,000, scaling
would be required during the initial calibration. For example, we could define the actual measured value
as the calibration value * 10. This means that we would perform the 300K calibration at the MB-1
calibration point of 30,000 (the highest available MB-1 calibration point). Then, all numeric readings on
MB-1 would have to be multiplied by 10 by the user to determine the actual resistance value being
measured. This would likewise apply to all other calibration points.
In the figure below, it can be seen that at the higher resistance values, the 300K input resistance of the
MB-1 coupler port becomes significant. This resistance can be accounted for by calculating the transfer
function taking into account the Unknown R in parallel with the MB-1 input resistance. This will give
reasonable results for resistances up to 1 Meg. Above that value, the 300K resistance of the MB-1 input
starts to dominate.
91
display functions are independent, there is no reason why the analog scale can not be linear. The figure
below shows a linear scale that can be used in the above example. A full size copy can be found here.
92
4.23 Measuring Temperature Compensated pH and Oxidation-
Reduction Potential
4.23.1 Overview
This sensor interfaces with either a PH probe or an Oxidation-Reduction Potential (ORP) probe and
generates a DC voltage that varies linearly with respect to the either the PH or ORP value respectively.
This example covers the PH case because it is the more complex of the two cases. PH measurements
require that the temperature be taken into account to arrive at the correct pH value. The ORP sensor does
not have the temperature issue.
A picture of the sensor is below. The data sheet can be found here.
There are a couple of new issues encountered in this example. The first issue is that the highest PH, 14,
is not an available MB-1 calibration point. The other issue, as mentioned above, is that the voltage
produced by the PH sensor is affected significantly by temperature. Therefore, it is desirable to provide a
method that generates temperature corrected pH measurements.
Calibration Procedure
We handle the first issue by picking a maximum calibration point of 20, which is the first available MB-
1 calibration point above 14. We will see that the transfer function for this sensor is linear. Therefore, if
we calibrate at two points, namely pH values of 0 and 20, the maximum allowable PH value of 14 will
simply be a PH value that lies on the straight line transfer function. Note that during actual operation, the
PH sensor will never produce a voltage that represents a PH greater than 14.
Temperature Dependence:
The temperatures that will be handled by this example are 0º, 25º, 50º, 75º, and 100º. Other temperatures
could have been chosen as well. We will set up the coupler calibration for the highest temperature, 100º,
since this is the case that produces the largest voltage excursion from the sensor across the full pH range
(more on that below). This approach ensures that that the voltage excursions for the other temperatures
will be within the100º calibration range, and therefore represent measurements that can be processed by
MB-1 without bottoming out or topping out.
93
We will handle the temperature issue by creating an analog face that has scales for the 100º case as well
as the other temperatures listed above. To read the temperature corrected pH value, all that is required is
to read the scale corresponding most closely to the temperature of the sample being measured.
The transfer function for the pH sensor, taking both the pH and temperature into account is:
Since the equation is linear but does not pass through the origin, we need to calibrate the sensor at two
points. As discussed above, the two points that will be used are 0 and 20. The calibration points are
shown below.
pH VOUT (volts)
0 0.0407194
20 7.0672354
Note that the largest voltage in the table above is 7.067 volts, which is above the maximum voltage that
can be applied to an MB-1 coupler port without saturating it when the coupler trim pots is set to maxim
sensitivity (see Table 22). To ensure that the MB-1 Amp/Mux does not saturate during calibration or
operation, use the Coupler Setup feature that allows you to view the output of the A-to-D chain while
adjusting the trim pot. Set the output of the Amp/Mux chain to approximately 30,000 with a voltage of
7.067 volts applied.
The actual calibration is most easily done by “dialing in” the calibration voltage at the above two
calibration points using a stable voltage source and potentiometer as shown in Figure 4. Note that the
MB-1 5 volt auxiliary power output cannot be used in this case since we need a voltage level greater than
5 volts. A 9 volt battery or other stable higher voltage source can be used instead.
Below is a table that shows the sensor output voltage as a function of pH and temperature. As mentioned
above, it can be seen that the 100º case has the largest VOUT excursion across the complete pH range.
The items below in red correspond to our two calibration points.
94
Table 14 – Sensor Output Voltage as a function of pH and Temperature
VOUT VOUT VOUT VOUT VOUT
pH (T=100) (T=75) (T=50) (T=25) (T=0)
0 0.0407194 0.2054763 0.3702332 0.5349901 0.699747
1 0.3920452 0.5332654 0.6744856 0.8157058 0.956926
2 0.743371 0.8610545 0.978738 1.0964215 1.214105
3 1.0946968 1.1888436 1.2829904 1.3771372 1.471284
4 1.4460226 1.5166327 1.5872428 1.6578529 1.728463
5 1.7973484 1.8444218 1.8914952 1.9385686 1.985642
6 2.1486742 2.1722109 2.1957476 2.2192843 2.242821
7 2.5 2.5 2.5 2.5 2.5
8 2.8513258 2.8277891 2.8042524 2.7807157 2.757179
9 3.2026516 3.1555782 3.1085048 3.0614314 3.014358
10 3.5539774 3.4833673 3.4127572 3.3421471 3.271537
11 3.9053032 3.8111564 3.7170096 3.6228628 3.528716
12 4.256629 4.1389455 4.021262 3.9035785 3.785895
13 4.6079548 4.4667346 4.3255144 4.1842942 4.043074
14 4.9592806 4.7945237 4.6297668 4.4650099 4.300253
20 7.0672354
Remember that we calibrated the coupler port for the T=100º case. Therefore, the digital display
readings on the MB-1 are valid only for the T=100º case. However, if we create an analog scale for this
application using the T=100º case, and use the full meter movement range for that case, the analog scales
for all other temperatures can be temperature corrected by determining what fraction of the analog
needle displacement each scale occupies with respect to the T=100º case. Below, we show how to
determine the temperature corrected scales.
We can use the sensor equation to determine what the pH value is for the temperatures other than
T=100º that correspond to VOUT @ T=100º for each integral pH value (column 2 in the table above).
These pH values are shown in the table below for the four temperatures for which we will be creating
additional analog scales.
95
Table 15 – pH Values for Different Temps corresponding to VOUT at T=100º Case
pH(T=100) pH(T=75) pH(T=50) pH(T=25) pH(T=0)
0 -0.50263 -1.08303 -1.76075 -2.56252
1 0.569174 0.07169 -0.50922 -1.19645
2 1.640978 1.226409 0.74232 0.169625
3 2.712782 2.381127 1.993856 1.5357
4 3.784587 3.535845 3.245392 2.901775
5 4.856391 4.690563 4.496928 4.26785
6 5.928196 5.845282 5.748464 5.633925
7 7 7 7 7
8 8.071804 8.154718 8.251536 8.366075
9 9.143609 9.309437 9.503072 9.73215
10 10.21541 10.46415 10.75461 11.09822
11 11.28722 11.61887 12.00614 12.4643
12 12.35902 12.77359 13.25768 13.83037
13 13.43083 13.92831 14.50922 15.19645
14 14.50263 15.08303 15.76075 16.56252
The data from the above table is charted below along with the trend line equations that show pH for T=
0º, T=25º, T=50º, and T=75º (Y axis) vs. the pH at 100º (X axis).
96
Figure 44 – pH for different Temperatures vs. pH @ T=100º
The top scale in the analog meter face shown below uses the T=100º case as the reference, and spans the
entire range of the meter movement. Therefore each pH unit for the T=100º is 1/14th the scale deflection
as shown below.
97
9 0.642857143
10 0.714285714
11 0.785714286
12 0.857142857
13 0.928571429
14 1
From the chart above (Figure 44), we know the relationship for the pH at a given temperature with
respect to the pH at 100º. These are just the Trend Line equations. We use the Trend Line equation for
the T = 75º case below. This table shows the corresponding values for integral pH values at 75º and the
corresponding pH at 100º. For example, take the pH = 0 case at 75º. This corresponds to a pH value of
.4689 at 100º (using the VOUT from the sensor as the reference). Since we know the full analog meter
deflection equation for the T=100º case, we can determine the % deflection for the pH = 0 case at 75º. It
is .0334. This is done for the other pH values at 75º, and for the other temperatures.
98
A full size copy can be found here
99
4.24 Yaesu FT857/ 897 External Analog Meter
4.24.1 Overview
These two Yaesu radios have an external jack that is intended to drive an external analog meter. A full
size meter scale of the one shown below can be found here.
This meter face can affixed to an analog meter with a full scale current rating of 1 mA or less. The meter
can then be connected directly to the Yaesu output in a conventional manner. In this case, you should
insert an appropriate size potentiometer in series with the meter movement. This will allow you to set the
meter movement for full scale deflection using the Yaesu calibration feature, which outputs a signal
corresponding to the maximum drive signal.
If you want to make use of the MB-1 alarm functions or Min/Max functions to do some additional
processing of the Yaesu parameters, you could instead connect the Yaesu analog output to an MB-1
coupler input and calibrate that input as a generic meter function. The analog meter with the Yaesu
scales would then be driven by MB-1. Why would you want to do this?
Let’s assume you got a radio back from repair due to an infrequent but annoying momentary loss in
sensitivity. If the MB-1 was monitoring the analog meter output, you could set up the Yaesu to display
the S meter function in receive mode on the analog output. You could then activate a low power signal
source (e.g., the calibrator from an older vintage radio) to provide a stable readable signal for the Yaesu
to receive, and monitor the signal level as reported by the Yaesu with MB-1’s Min/Max function. In such
a set up, you would expect little if any variation in the signal level. If, after an overnight test, the Max
function reads 80 (e.g., 80% full scale) and the Min function reads 15 (e.g., 15% of full scale) your radio
still has the problem.
100
Similar tests could be done to detect other intermittent conditions, such as an RF Power dropout during a
long data transmission.
Admittedly this is a somewhat contrived example, but it may spark some ideas on using the Generic
Meter function for applications that might not be initially obvious.
Here is how we would configure MB-1 to interface to the Yaesu and analog meter.
First, it is important to recognize that the Yaesu will generate the same full scale signal to drive an
external meter to full scale regardless of which of the 7 parameters are being measured. Therefore, the
easiest approach to take is to view the Yaesu output as a relative signal with a value ranging between 0
(no meter deflection) and 100 (full scale meter deflection). In this case, we simply have to calibrate the
Generic (coupler input) for a full scale value of 100, and likewise, calibrate the external panel meter as a
single linear scale analog meter with a full scale value of 100. In effect, this makes MB-1 transparent –
i.e., the analog meter should respond as if it was connected directly to Yaesu output signal. We can use
the linear scale Panel Meter calibration in this example since we are relying on the meter scale
calibrations to give us the correct reading.
Coupler Calibration
1 Connect the Yaesu along meter output to the FWD port of one of the 4 coupler ports.
2 Adjust the coupler trim pot for maximum sensitivity. There is no chance of overdriving the MB-
1 input in this application.
3 Bring up the coupler calibration menu for the coupler port being used.
4 Specify the coupler type as a GENERIC meter application.
5 Set the full scale value to 100 units.
6 Configure the Yaesu to apply a full scale signal on its analog meter output port.
7 Select a single calibration point of 100 and save the calibration data for the full scale signal
being applied by the Yaesu.
8 Save the coupler calibration settings to EEProm.
1 Connect the panel meter with the Yaesu scales to an unused panel meter port.
2 Enter the Panel Meter Setup screen and choose the appropriate panel meter port.
3 Set the calibration type to Linear.
4 Adjust the panel meter trim pot slightly beyond full scale deflection.
5 Select the number of Power Scales to 1.
6 Set the full scale value to 100.
7 Set the number of SWR scales to 0.
8 Proceed with calibration. Calibration is done at a single point, namely the full scale value (100).
Simply dial the front panel pot until the meter needle reads full scale and save the calibration
point.
9 Save the Panel Meter calibration data in EEProm.
This completes the calibration. When you select the coupler port connected to the Yaesu output and the
analog meter with the Yaesu, MB-1 will drive the analog meter. The Yaesu menus determine the actual
transmit mode and receive mode parameters whose values are being output from the Yaesu external jack.
101
This is transparent to MB-1 since the full scale values of all of the parameters on the analog scale
correspond to the full scale meter deflection.
Since MB-1 is simply measuring the input signal and linearly driving the analog meter, if you wanted to
use the Min/Max function, the Min/Max values would represent percent of full scale deflection. If you
did a long term test as in the above example to monitor for an intermittent sensitivity problem, you
would have to approximate the value on the appropriate scale to translate the Min/Max readings into
actual values, but in this example, since we are looking for a signal dropout, interpreting the Min/Max
readings as percentage full scale values is adequate to determine if a problem was detected.
102
4.25 Some other Sensors
4.25.1 Overview
This section lists some miscellaneous sensors we have come across. The approaches discussed in the
examples above will work for these sensors as well.
This sensor generates a DC output voltage that varies linearly with respect to humidity.
103
This sensor measures absolute pressure, and has a range of 20 to 250 kilopascals. Barometric pressure is
approximately 100 kilopascals with limited variation around that value. Because of the broad
measurement range, the resolution is approximately 1 kilopascal per 10 millivolts. If you set you lower
and upper ranges to 80 kilopascals and 125 kilopascals during calibration, you should be able to get
reasonable resolution.
The analog meter scale for the Barometer must be calibrated as a nonlinear scale since the starting value
is not 0. See the discussion for the Panel Meter calibration in the Logarithmic Sound Pressure Level
Sensor example above.
This sensor measures wind direction by outputting a DC voltage that ranges from 5% to 95% of power
supply voltage. This corresponds to 250 millivolts to 4.75 volts for 5 volt power. When facing North, the
sensors outputs its minimum voltage. The voltage increases linearly as the direction changes to East,
South, West, etc.
104
5 Some Industrial Sensors
The following sensors are used primarily in industrial applications. Detailed descriptions are
provided for those sensors that cover some new interfacing topics.
This example uses an 11 decade Inficon vacuum sensor that can measure pressure from approximately
10-8 to 103 millibars. This corresponds to a ratio of 1011, a range that can only be handled reasonably if
we use a logarithmic scale.
The data sheet can be found here. The operating instructions, which contain additional specifications,
can be found here.
The operating instructions provide the transfer functions for a variety of pressure units. The example
below uses the millibar equation. The implementation for the torr and Pascal units are similar.
The data points and graph for the 11 decade range transfer function are shown below:
105
Table 18 – Transfer Function for 10N Pressure Values for Vacuum Sensor
Pressure VOUT
(millibars) (volts)
1.00E-08 2.0000
1.00E-07 2.6000
1.00E-06 3.2000
1.00E-05 3.8000
1.00E-04 4.4000
1.00E-03 5.0000
1.00E-02 5.6000
1.00E-01 6.2000
1.00E+00 6.8000
1.00E+01 7.4000
1.00E+02 8.0000
1.00E+03 8.6000
VOUT vs Pressure
10.0000
9.0000
8.0000
7.0000
6.0000
Vout
5.0000
4.0000
3.0000
2.0000
1.0000
0.0000
1.00E-08 1.00E-07 1.00E-06 1.00E-05 1.00E-04 1.00E-03 1.00E-02 1.00E-01 1.00E+00 1.00E+01 1.00E+02 1.00E+03
Pressure (millibars)
As can be seen from the above table, the sensor output voltage increases at a rate of 600 millivolts per
decade.
106
It would be nice to display numerical values from MB-1 ranging from -8 to +3 corresponding to
-8
pressures of 10 to 103 respectively. But since MB-1 does not display negative values, we will use the
following translation:
Table 19- MB-1 Readings and Corresponding Pressures for Integral MB-1 Readings
MB-1
Pressure Numerical
(millibars) Reading
1.00E-08 0
1.00E-07 1
1.00E-06 2
1.00E-05 3
1.00E-04 4
1.00E-03 5
1.00E-02 6
1.00E-01 7
1.00E+00 8
1.00E+01 9
1.00E+02 10
1.00E+03 11
To convert an MB-1 numerical reading to a pressure, one would take the numerical reading
But this equation is correct only for the integral values displayed on MB-1 as shown in the above table.
We have to use the actual transfer function to determine the pressure value between integer MB-1
values.
P = 10 (1.667×Vout – 11.33)
Since each decade increase of pressure increases VOUT by 600 millivolts, we can create a lookup table to
interpolate non integral MB-1 readings for all 11 decades. If we break each decade into 20 segments, we
can calculate an exact pressure/voltage relationship for those 20 points. The voltage step for each of
these 20 segments is 600 millivolts / 20, or 30 millivolts, which is the value used in the second column in
the table below. The third column shows the calculated pressure for the voltages in the second column
using the above formula.
The following table summarizes the MB-1 readings, the sensor output voltage VOUT, and the calculated
-8 -7
pressure for 20 segments equally spaced between P = 10 and P = 10 .
107
Table 20 – Lookup Table for Interpolating non-integral MB-1 Measurements
MB-1 Calculated
Reading VOUT Pressure
0 2 1.01 E-08
0.05 2.03 1.13 E-08
0.1 2.06 1.27 E-08
0.15 2.09 1.43 E-08
0.2 2.12 1.60 E-08
0.25 2.15 1.79 E-08
0.3 2.18 2.01 E-08
To use this table, simply take the decimal portion of the MB-1 reading, and determine the coefficient in
the third column. (This coefficient will be the same for each of the 11 pressure decades.) For example,
-5 -4
assume that MB-1 reads 3.65. We know that the pressure is between 10 and 10 millibars. If we look
up the fractional part in the above table (.65), we see that an MB-1 digital reading of 3.65 corresponds
approximately to a coefficient of 4.51. Therefore, an MB-1 reading of 3.65 corresponds to a
pressure of 4.51 x 10-5 millibars. This lookup approach is workable but somewhat cumbersome. We
come up with a better approach that will allow a direct reading of the pressure when using an analog
meter calibrated for this application. This is discussed below.
Calibration Point:
Since the transfer function equation is linear but does not pass through the origin, we need to calibrate
the sensor at two points. The two end points in the MB-1 column in the table above are 0 and 11. Since
11 is not an available MB-1 calibration point, we will use the next higher available calibration point of
20. Since the transfer function is linear, if we use calibration points of 0 and 20, the maximum allowable
3
Pressure value of 10 millibars (corresponding to an MB-1 reading of 11) will simply be a value that lies
108
on the straight line transfer function. Note that during actual operation, the vacuum sensor will never
3
produce a voltage that represents a pressure greater than 10 .
Note that the largest voltage in the table above is 14.00 volts, which is above the maximum voltage that
can be applied to an MB-1 coupler port without saturating it when the coupler trim pots is set to maxim
sensitivity (see Table 22). To ensure that the MB-1 Amp/Mux does not saturate during calibration or
operation, use the Coupler Setup feature that allows you to view the output of the A-to-D chain while
adjusting the coupler trim pot. Set the output of the Amp/Mux chain to approximately 30,000 with a
voltage of 14.00 volts applied.
The actual calibration is most easily done by “dialing in” the calibration voltage at the above two
calibration points using a stable voltage source and potentiometer as shown in Figure 4. Note that the
MB-1 5 volt auxiliary power output cannot be used to drive a pot for calibration since a voltage level
greater than 5 volts is required. Two 9 volt batteries in series or other stable higher voltage source
feeding a potentiometer can be used instead.
109
Each decade, or major tic mark, simply occupies 1/11th of the full scale range. Between each decade, we
-8 -8 -8
include 4 minor tic marks. For example, the four tic marks to the right of 10 are 2 x10 , 4 x10 , 6
-8 -8
x10 , and 8 x10 . To account for the logarithmic behavior of the sensor, the minor tic marks must be
N
positioned according to the log of the tic mark value. For example, for a linear scale, the 2 x10 tic mark
would be placed at 20% of the displacement between the major tic marks. But for this logarithmic
sensor, it must be placed at log (2) = .301 or 30.1% of the distance between the major tic marks.
N
Likewise, minor tic mark 4 x10 must be placed at log (4) = .602 or 60.2% of the distance between the
tic marks, and so forth.
Since the coupler has been calibrated for a full scale value of 11, when calibrating the Panel Meter, the
scale type should be set to linear with a full scale value of 11.
110
5.2 Rotary Shaft Encoder
The Advanced Micro Controls AMCI DC25 encoder is an Absolute Single Turn sensor that generates a
DC voltage proportional to the angular displacement.
The Unimeasure family of Linear Position Sensors measure linear distance by measuring the amount a
cable is extended from the sensor. These units measure distances from as small as 2 inches to as large as
2000 inches. These units are basically high resolution multi-turn potentiometers.
111
5.4 Non-Contact Infrared Temperature Sensor
The Omega OS136 sensor measures the temperature of a surface within in the optical field of view,
which is 6:1 for this sensor. The sensor is internally calibrated for a fixed emissivity of .95.
This sensor can be ordered in different temperature ranges (either 0 ° – 400°F, or 300°F – 1000°F), and
different output formats. The output formats that will work with MB-1 are: V1 (0- 5 volts DC), V2 (0 –
10 volts DC), MVC: 10 mV/°C, and MVF: 10 mV/° F.
The Balluff M8 Linear Sensor provides accurate measurements for small linear displacements in the
millimeter range, with repeatability in the micrometer range. These sensors are used primarily in
industrial applications. The sensor shown above generates an analog output from 0 – 10 volts
corresponding to displacements of .5mm to 1.5 mm.
112
5.6 Time of Flight Laser Distance Sensor
The Banner Series of Analog Sensors have a large variety of uses in process control. One such sensor,
referred to as a “Time of Flight” distance sensor, is shown above. The data sheet can be found here.
This sensor determines the distance by emitting light from a laser diode, which bounces off the target,
and is detected by a sensor collocated with the laser. Using the speed of light and the round trip time, the
distance can be measured very accurately. The sensor generates a 0 – 10 volt DC output that varies
linearly with respect to the calculated distance, and easily processed by MB-1.
The A4120 Alliance for Costal Technologies Conductivity Sensor is a high precision conductivity sensor
for making measurements in salt water. The sensor produces a linear output of 0 – 5 volts DC
corresponding to a conductivity of 0 – 75 millimhos/cm.
113
5.8 Linear Variable Displacement Transformers
The P3 America LVDTs work by driving a transformer primary with AC voltage and measuring the
voltage induced in two secondary transformers. The induced voltage is proportional to the displacement.
The displacement (or stroke lengths) for these sensors is 2mm to 50mm.
Some LVDTs contain interface circuitry to convert the secondary AC voltages into DC voltages that are
more easily processed. These AP3 sensors provide such an interface.
The Omega FPR Flow Sensor measure flow and comes in two models:
.5 GPM to 15 GPM
1.5 GPM to 50 GPM
Both models have a 4-20 mA analog output that is proportional to the flow rate.
The specifications for these sensors can be found here. The manual can be found here.
114
5.10 Rotary Torque Transducer
The Interface Rotary Torque Transducer, rated at ± 200 Newton Meters, generates a DC voltage
proportional to the torque. The analog output is 0 to -5 volt output for CCW torque, and a 0 to +5 volt
output for CW torque. To measure torque in both directions, an isolated and regulated 5 volt DC-to-DC
converter, or equivalent, needs to be inserted in series with the transducer output since MB-1 requires
that the coupler input voltages to be positive. To measure torque in one direction only, the transducer
output can be connected directly to MB-1.
115
5.11 RPM Sensor using an Industry Standard 4 – 20 mA Current
Output
5.11.1 Overview
Many industrial sensors use an industry standard current loop interface of 4-20 mA to encode the
magnitude of the parameter being measured. One such sensor is the ST420 DI from Electro Sensors. A
picture of the sensor and its pulser disc are shown below. The pulser disc contains magnets that are
sensed by the magnetic pulse detector in the sensor. In addition to the pulse detector, the sensor contains
the signal processing circuitry to convert the magnetic pulse counts into a smooth 4 – 20 mA output.
The data sheet for this sensor is found here. The User’s Manual for this sensor provides some additional
information that specifies the relationship between RMP and the output current.
116
Figure 45 – RPM Sensor Interface
Even though the VOUT vs. RPM transfer function is linear, it does not pass through the origin. Therefore,
we must perform the calibration at two calibration points. The lower RPM value of 2 and the higher
RPM value of 200 are both available MB-1 calibration points, and can therefore be used directly as
shown in the table below.
Calibration is most easily done by “dialing in” the calibration voltages at the corresponding calibration
points as shown in Figure 4.
117
6 Adding MB-1 to Existing Measurement Systems
In some cases, you may wish to add MB-1 to an existing system that already includes a sensor and
display instrumentation. You might want to do this to display the measurement on one of MB-1’s display
devices to complement the display on the existing instrumentation. You may also want to use one or
more of MB-1’s processing functions such as Min/Max, Averaging, and Alarm functions that might not
be provided by the existing instrumentation.
If the existing sensor is generating an output voltage, MB-1 can be placed in parallel with the existing
instrumentation as shown in Figure 46 as long as the 300K input resistance of the MB-1 input circuitry
does not adversely impact the existing instrumentation.
However, if you are using a 4 – 20 mA loop sensor, incorporating MB-1 into the system will take a bit
more effort.
The top circuit in Figure 47 shows an existing 4-20 mA loop-based measurement system, including the
power source, the loop sensor, and the instrumentation. In the bottom circuit, a 10 ohm resistor, which
will have minimal impact on the operation of the existing measurement system, has been added in series
with the loop, and the sensed voltage is processed by the circuit shown in this Maxim application note.
The circuit, consisting of two ICs, converts the 4-20 mA sensed current through the 10 ohm resistor to 0
to 5 volts DC respectively, which is a suitable input to drive MB-1.
118
Figure 47 – Adding MB-1 to Existing 4-20 mA Loop Instrumentation
119
7 Input Sensitivity and Dynamic Range
If the DC voltage derived from the parameter you are trying to measure is approximately 6.14 volts or
more full scale, you can derive the full 15 bit resolution from MB-1 (15 bits applies to the values on the
low end of the range of MB-1’s Amp/Mux). Depending upon the accuracy you want to achieve, as long
as the derived DC voltage is at least 2 volts full scale, you will still get a minimum low range resolution
of 10 bits. If you only need to resolve your measurements to 1 part in 10 or one part in 20, even a much
lower maximum voltage from your sensor can be tolerated. Of course, if the maximum DC voltage
generated from your application is very low, you can always add an Operational Amplifier to generate a
suitable signal for MB-1’s input circuitry. Some references are given in the web site.
8 Interpolation
When you set up a Generic Meter Application, all voltages that are at intermediate voltage levels with
respect to the calibration points are linearly interpolated to calculate the parameter being measured.
The power meter functions associated with RF couplers use a square law interpolation (calculated value
is the square of the input voltage). With power measurements, all voltages that are at intermediate
voltage levels with respect to the calibration points are interpolated using a square law interpolation. If
you have a Generic Application whose derived voltage is approximately the square root of the parameter
being measured, you will gain additional accuracy at intermediate calibration points by calibrating your
application as a conventional power meter instead of as a Generic Meter Application.
If you decide to use this approach, you will have to remember that the meter still thinks it is an RF power
meter in this mode, so you will have to ignore parameters that have no meaning for your Generic
Application, such as SWR (or better yet, program the display devices so that these values are not
displayed). Ignore the w suffix (for watts), on the LCD, and you should be OK using the RF power
mode for a “square law” Generic application.
120
TABLE 22 - MB-1 SPECIFICATIONS OF SPECIAL INTEREST WHEN USING MB-1 WITH ANALOG SENSORS
General
Maximum Number of Calibration Points Coupler 60 – Same values as power points for power
points calibration with the addition of a calibration point
for 0.
Alarm Trip Point - High Value 1 - 30,000 (High must be > Low)
121
Table 23- Available MB-1 Calibration Points
The table above shows the values that a Generic Application can be calibrated at. Not surprisingly, these
values correspond to the power calibration points used for RF power couplers with one exception
discussed below. If your application falls outside of this range, simply apply a scaling factor when
interpreting the output (e.g., x .001, x1000, etc).
122
9.2 Allowing a Voltage of 0 during Calibration with Analog
Sensors
Another difference you will see is that when calibrating a Generic Meter Application, it is valid for the
very first calibration point to have DC voltage of 0 associated with. This applies to the very fist
calibration point used in the Setup routine, and is not limited to calibration point 0. (As contrasted to
the RF Ammeters and Power couplers, whose lowest calibration point is .05, the calibration setup
routines will declare any calibration point with a calibration voltage of 0 as invalid since an RF Power
or RF Ammeter coupler should always produce a nonzero DC output voltage for all calibration
points).
If the sensor voltage is lower than the lowest calibration voltage or higher than the highest calibration
voltage, MB-1 will bottom out or top out as the voltage is reduced or increased respectively. Unlike the
single point case described above, MB-1 does not have enough information to reliably estimate the
parameter undergoing measurement when the sensor voltage is outside of the calibration range.
For example, take the Tilt Sensor application described above. The table is repeated below. When the
sensor voltage is lower than 2.500 volts, the measurement will bottom out at 0 degrees. If the voltage is
greater than 3.500 volts, the measurement will top out at 90 degrees.
Angle XA
(degrees) (analog voltage)
0 2.50000
10 2.67365
20 2.84202
30 3.00000
40 3.14279
50 3.26604
60 3.36603
70 3.43969
80 3.48481
90 3.50000
123
9.3.3 Dialing In actual Parameter Value during Calibration
If you look at the detailed calibration steps in the MB-1 User’s Manual, you will see that line 4 of the
LCD displays the actual value being applied during calibration. In some cases, it is difficult to perform
calibration at the exact calibration point, and this feature allows you to dial in the actual parameter value
with the front panel pot. (It is assumed that this value is close to the nominal calibration point). By
accounting for the actual value of the parameter being calibrated, MB-1 can then create a more accurate
calibration table.
This can be done for Power couplers and RF Ammeters since either a square law (power couplers) or
linear law (RF Ammeters) can be assumed and use to reliably correct the calibration point. When used
with analog sensors, MB-1 can not make any assumptions, and thus this correction capability does not
apply to Generic Meter Applications.
124