R8
10Ω
R6
10K
6
5
-
VA
7
R12
500K
V4sensor
+
VCC
R11
1K
9
C5
0.1µF
14
-
13
12
8
VOUT
4
-
VC
10
+
R7
10Ω
11
+
VCC
R9
1K
R10
500K
R5
10K
2
3
-
VB
1
V2sensor
+
Figure 3. Amplification Scheme
Microprocessor
To provide the signal processing for pressure values, a
microprocessor is needed. The MCU chosen for this
application is the MC68HC908QT4. This MCU is perfect for
appliance applications due to its low cost, small eight-pin
package, and other on-chip resources. The MC68HC908QT4
provides: a four-channel, eight-bit A/D, a 16-bit timer, a
trimmable internal timer, and in-system FLASH programming.
The central processing unit is based on the high
PTA3
EN
RS
RW
LCD
DB0
DB1
DB2
DB3
DB4
DB5
DB6
DB7
PTA4
A
B
PTA5
CLK
HC164
HC908QT4
performance M68HC08 CPU core and it can address 64
Kbytes of memory space. The MC68HC908QT4 provides
4096 bytes of user FLASH and 128 bytes of random access
memory (RAM) for ease of software development and
maintenance. There are five bi-directional input/output lines
and one input line shared with other pin features.
R2
1K
R3
1K
Figure 4. Multiplexed LCD Circuit
Multiplexing of the microcontroller output pins allows
communication of the LCD to be accomplished with three pins
instead of eight or 11 pins of I/O lines usually needed. With an
eight-bit shift register, we are able to manually clock in eight
bits of data. The enable line (EN) is manually accepted when
eight bytes have been shifted in, telling the LCD the data on
the data bus is available to execute.
The MCU is available in eight-pin as well as 16-pin
packages in both PDIP and SOIC. For this application, the
eight-pin PDIP was selected. The eight-pin PDIP was chosen
for a small package, eventually to be designed into
applications as the eight-pin SOIC. The PDIP enables the
customer to reprogram the software on a programming board
and retest.
The LEDs are used to show pressure output data by
displaying binary values corresponding to a pressure range.
Leak detection, or water-flow speed, is displayed by blinking a
green LED at a speed relating to the speed of water flow. The
red LED displays the direction of water flow. Turning the red
LED off signifies water flowing into the tub. Turning the red
LED on signifies water flowing out of the tub, or alternatively,
there is a leak.
Display
Depending on the quality of the display required, water
level and water flow can be shown with two LEDs. If a higher
quality, digital output is needed, an optional LCD interface is
provided on the reference board. Using a shift register to hold
display data, the LCD is driven with only three lines outputted
from the microcontroller: an enable line, a data line, and a
clock signal. The two LEDs are multiplexed with the data line
and clock signal
Digital values for water height, rate of water flow, and
calibration values are displayed if an LCD is connected to the
board
AN1950
Sensors
Freescale Semiconductor
3