English
Language : 

Z8F2480 Datasheet, PDF (15/24 Pages) Zilog, Inc. – Load current up to 3 amps
Z8F2480 Power Monitor with an eZ80F91 Webserver
Reference Design
Calibration
The Z8F2480 Power Monitor board software measures voltage and currents by using an
internal analog-to-digital converter (ADC). The web page that the PC browser obtains
from the eZ80F91 Webserver contains javascript that converts ADC values into voltages
or currents. For this javascript to display accurate voltage/current values, equations in the
script must be calibrated for the particular Z8F2480 Power Monitor board attached to the
eZ80F91 Webserver Module. There are three equations that must be adjusted to accom-
plish this calibration, namely: voltage, high current range, and low current range.
The calibration process computes the slope and y intercept of a set of (x,y) data points that
span the range of current/voltage inputs. For each data point, the (median) value of the
ADC input is the independent variable (x), and the actual line voltage/load current is the
dependent variable (y). At least two data points are required to compute the slope and y
intercept, but multiple data points may be used to improve the accuracy of interpolated
values. As more data points are used for calibration, it will be necessary to use PC soft-
ware capable of performing a linear least-squares regression analysis. Both free and pro-
fessional analysis tools are readily available on the Internet.
When calibration is complete, the values to be modified in the javascript are shown below
for reference:
V = 0.41763816126957 * LineVoltage + 5.2586067419112;
if( LoadCurrent & 0x8000 )
{
I = 5.183353039 * (LoadCurrent & 0x7FFF) + 42.05404895723;
}
else
{
I = 0.96950933849967 * LoadCurrent + 15.774942218407;
}
Observe the following procedure to perform voltage calibration.
1. Connect an AC power supply capable of producing the desired range of line voltage
(e.g., 90 V to 240 V) to the Power Board.
2. Using a known (purely resistive) load, sweep the input voltage from min to max in 5V
or 10 V increments.
a. For each input voltage, note the value displayed on the web page and covert this
value to a raw ADC value using the following equation (which is contained in the
index.htm javascript file):
V = 0.41763816126957 * LineVoltage + 5.2586067419112;
For example, if the web page displays a voltage of 211.99 V, this voltage value
corresponds to an ADC value of:
ROUND( (211.99 - 5.25861) / 0.41764) = 495
RD002702-0814
Page 15 of 24