Measuring higher voltages, Converting analog measurements – Remote Processing RPC-330 User Manual
Page 38

ANALOG INPUT
SECTION 10
Page 10-4 RPC -330
MEASURING HIGHER VOLTAGES
Voltages higher than + 5V are measur ed by inserting a
series resistor to the input. A r esistor can be connected
directly to the STB-20.
The table below shows resistor values for typical input
voltages using the 0-5V range.
Maximum
Input Voltage
Resistor
6
20K
12.5
150K
24
380K
Use the following formula to determine the series
resistance necessar y for a m aximum voltage input:
Rs = Vi * 20000 - 100000
0 - 5V range
Rs = Vi * 40000 - 100000
0 - 2.5V r ange
Rs is the re sistor value in ohms in ser ies with the inpu t.
Vi is the maximum input voltage. W hen the result of
your ca lculation is negative or zer o, a series r esistor is
not necessary.
NOTE: When an input voltage exceeds the input range,
other channel values are affected.
CONVERTING ANALOG
MEASUREMENTS
Inputs are converted to "real numbe rs" by perfor ming
scaling calculations in the program. The AIN function
returns values from 0 to 4095. To change these numbers
into something more meaningful, use the following
formula:
var = K * AI N (n)
n is the analog channel to read. K is the scaling
constant. K is obtained by dividing the highest number
in the range of units by the maximum AIN count (4095).
E x am p le 1 : T o m ea su r e t he r es ul ts of an A / D
conversion in volts and the voltage range is 0 to 5V,
divided 5 by 4095 to obtain K.
K = 5/4095
K = .001221
Your program could look something like:
1000 C = .001221 * AIN(N)
Example 2: Y ou want to measure a 0 to 200 PSI
pressure transducer w ith a 0 to + 5V output. Divide 200
by 4095 to obtain the constant K.
K = 200 / 4095
K = .0488
The code can then look like:
1000 B = .0488 * AIN(0)
Measuring 4-20 mA current loops
Curr ent loops is a convenient way to transmit a value
and still assure the integrity of the signal. If the line
should break, a 0 volt (or nearly so) is returned.
A 4-20 ma curr ent loop is converted to 1 - 5V by placing
a 250 ohm resistor across the input of the chan nel to
ground.
Cur rent loop r eadings ar e conver ted to engineer ing units
by performing scaling as described earlier. Since the
measur ement r ange is 1 to 5V , the count ran ge is
reduced by 20% to 3276.
I f p r es su r e w e r e m e as ur e d:
K = 200/3276
K = .06105
There is one addition factor. Since the lowest value read
is 1 V, this offset is subtracted from all readings. A 1 V
offset is 1/5 of 4095 counts, or 819. The program line
then becomes:
200 A=.06105*(AIN(N)-819)
Note that if the current loop line breaks, a negative value
is returned.