Philips Semiconductors Microcontroller Products Application note
AN429Airflow measurement using the 83/87C752 and “C”
1
December 1990 Revision date: June 1993
INTRODUCTION
This application note describes a low-cost
airflow measurement device based on the
Philips 83/87C752 microcontroller. Airflow
measurement—determining the volume of air
transferred per unit time (cubic feet per
minute, or cfm)—is intrinsic to a variety of
industrial and scientific processes.
Airflow computation depends on three
simultaneous physical air
measurements—velocity, pressure, and
temperature. This design includes circuits
and sensors allowing the 8XC752 to measure
all three parameters.
The design also includes seven-segment
LED displays, discrete LEDs, and pushbutton
switches to allow selective display of airflow,
temperature, and pressure. Furthermore,
airflow is continuously compared with a
programmer-defined setpoint. Should the
measured airflow exceed the setpoint, an
output relay is energized. In actual
application, this relay output could be used to
signal the setpoint violation (via lamp or audio
annunciator) or otherwise control the overall
process (e.g., emergency process
shutdown). Of course, the setpoint,
comparison criteria (greater, less than, etc.)
and violation response (relay on, relay off)
are easily changed by program modification
to meet actual application requirements.
Referring to Figure 1, the overall operation of
the airflow device is as follows.
Normally the unit continuously displays the
airflow (in cfm) on the seven-segment
displays. The discrete CFM LED is also lit to
confirm the parameter being displayed.
Pressing the TEMP pushbutton switches the
display to temperature (in degrees C) and
lights the TEMP LED. As long as the
pushbutton remains pressed, the temperature
is displayed. When the pushbutton is
released, the display reverts to the default
pressure display.
Similarly, pressing the PSI pushbutton
displays the atmospheric pressure (in pounds
per square inch) and lights the PSI LED. The
pressure is displayed as long as the
pushbutton is pressed, and the default airflow
display resumes when the pushbutton is
released.
Finally, pressing the SET-POINT pushbutton
displays the programmed airflow setpoint (in
cfm) and lights the SET-POINT LED. Again,
releasing the pushbutton causes the display
to revert to the default airflow measurement.
CONTROL PROGRAMMING IN
“C”
While, thanks to advanced semiconductor
processing, hardware price/performance
continues to improve, software development
technology has changed little over time.
Thus, given ever-rising costs for qualified
personnel, software “productivity” is arguably
in decline. Indeed, for low-unit cost and/or
low-volume applications, software
development has emerged as the major
portion of total design cost. Furthermore,
beyond the initial programming cost, “hidden”
costs also arise in the form of life-cycle code
maintenance and revision and lost
revenue/market share due to excessive
time-to-market.
Traditionally, control applications have been
programmed in assembly language to
overcome microcontroller resource and
performance constraints. Now, thanks to
more powerful microcontrollers and advanced
compiler technology, it is feasible to program
control applications using a High-Level
Language (HLL).
The primary benefit of using an HLL is
obvious—one HLL program “statement” can
perform the same function as many lines of
assembly language. Furthermore, a
well-written HLL program will typically be
more “readable” than an assembly language
equivalent, resulting in reduced maintenance
and revision/upgrade costs.
Of the many popular HLLs, the “C” language
has emerged as the major contender for
control applications. More than other
languages, C gives the programmer direct
access to, and control of, low-level hardware
resources—a requirement for deterministic,
real-time I/O applications. Furthermore, C is
based on a “minimalist” philosophy in which
the language performs only those functions
explicitly requested by the programmer. This
approach is well-suited for control
applications, which are often characterized
by strict cost and performance requirements.
Seven
Segment
LED
Seven
Segment
LED
Seven
Segment
LED
CFM TEMP PSI SETPOINT
LEDs
Pushbuttons
SU00376
Figure 1. Airflow Meter Front Panel