5秒后页面跳转
AN1950 PDF预览

AN1950

更新时间: 2022-12-20 04:38:19
品牌 Logo 应用领域
飞思卡尔 - FREESCALE 监控
页数 文件大小 规格书
24页 298K
描述
Water Level Monitoring

AN1950 数据手册

 浏览型号AN1950的Datasheet PDF文件第2页浏览型号AN1950的Datasheet PDF文件第3页浏览型号AN1950的Datasheet PDF文件第4页浏览型号AN1950的Datasheet PDF文件第6页浏览型号AN1950的Datasheet PDF文件第7页浏览型号AN1950的Datasheet PDF文件第8页 
The function first clears the 40 pressure readings it updates  
for the Graphical History. The history then enters the loop first  
displaying eight special characters, each containing five data  
points of water level history. The function adcbyta is called to  
obtain the current averaged A/D value. The function LfNx is  
called to convert the A/D value to a water level. It is then  
compared to the calibration points, the maximum and  
minimum points, to determine if the container is full or empty.  
If true, then it displays the corresponding message. The  
current water level is compared to the previous read and  
displays the message filling if it has increased, emptying if it  
has decreased, and steady if it has not changed.  
The water level calculation has to be converted to decimal  
in order to display it in the LCD. To convert the water level  
calculation to decimal, the value is continually divided with the  
remainder displayed to the screen for each decimal place. To  
display the Rate of Water Flow, the sign of the value is first  
determined. If the value is negative, the one's complement is  
taken, a negative sign is displayed, and then the value is  
continually divided to display each decimal place. If the  
number is positive, a plus sign.  
Converting Pressure to Water Level  
Hydrostatic pressure being measured is the pressure at the  
bottom of a column of fluid caused by the weight of the fluid  
and the pressure of the air above the fluid. Therefore, the  
hydrostatic pressure depends on the air pressure, the fluid  
density and the height of the column of fluid.  
P= Pa + ρ g h  
where P = pressure  
Pa = pressure  
ρ = mass density of fluid  
g = 9.8066 m/s^2  
h = height of fluid column  
To calculate the water height, we can use the measured  
pressure with the following equation, assuming the  
atmospheric pressure is already compensated for by the  
selection of the pressure sensor being gauge:  
h = P \ ρ g  
Software Function Descriptions  
Main Function  
Level Function  
The Level function initializes the graphics characters. Once  
this is complete, it continues looping to obtain an  
The main function calls an initialization function Allinit calls  
a warm-up function, Warmup, to allow extra time for the LCD  
to initialize, then checks if buttons PB1 and PB2 are  
depressed. If they are depressed concurrently, it calls a  
calibration function Calib. If they are not both pressed, it  
enters the main function loop. The main loop displays the  
menu, moves the cursor when the PB1 is pressed and  
enters the function corresponding to the highlighted menu  
option when PB2 is depressed.  
average A/D reading, displaying the Water Level, the Water  
Flow, and a Graphical History until simultaneously depressing  
both PB1 and PB2 to return to the main function.  
The function first clears the 40 pressure readings it updates  
for the Graphical History. The history then enters the loop first  
displaying eight special characters, each containing five data  
points of water level history. The function adcbyta is called to  
obtain the current averaged A/D value. The function LfNx is  
called to convert the A/D value to a water level. It is then  
compared to the calibration points, the maximum and  
minimum points, to determine if the container is full or empty.  
If true, then it displays the corresponding message. The  
current water level is compared to the previous read and  
displays the message filling if it has increased, emptying if it  
has decreased, and steady if it has not changed.  
The water level calculation has to be converted to decimal  
in order to display it in the LCD. To convert the water level  
calculation to decimal, the value is continually divided with the  
remainder displayed to the screen for each decimal place. To  
display the Rate of Water Flow, the sign of the value is first  
determined. If the value is negative, the one's complement is  
taken, a negative sign is displayed, and then the value is  
continually divided to display each decimal place. If the  
number is positive, a plus sign is displayed to maintain the  
display alignment and the value is continually divided to  
display each decimal place.  
Calibration Function  
The calibration function is used to obtain two calibration  
points. The first calibration point is taken when the head tube  
is not placed in water to obtain the pressure for 0 mm of water.  
The second calibration point is obtained when the head tube  
is placed at the bottom of a container with a height of 160 mm.  
When the calibration function starts, a message appears  
displaying the A/D values for the corresponding calibration  
points currently stored in the flash. To program new calibration  
points, press PB1 to take 256 A/D readings at 0 mm of water.  
The average is calculated and stored in a page of flash. Then  
the user has the option to press PB1 to exit the calibration  
function or obtain the second calibration point. To obtain the  
second calibration point, the head tube should be placed in  
160 mm of water, before depressing PB2 to take 256 A/D  
readings. The average is taken and stored in a page of flash.  
Once the two readings are taken, averaged, and stored in the  
flash, a message displays the two A/D values stored.  
The most complicated part of this function is updating the  
graphics history display. The characters for the 16x2 LCD  
chosen for this reference design are 8x5 pixels by default.  
Therefore, each special character that is created will be able  
to display five water level readings. Since the height of the  
special character is eight pixels, each vertical pixel position  
will represent a water level in increments of 20 mm.  
Level Function  
The Level function initializes the graphics characters. Once  
this is complete, it continues looping to obtain an average A/D  
reading, displaying the Water Level, the Water Flow, and a  
Graphical History until simultaneously depressing both PB1  
and PB2 to return to the main function.  
Resolution = (H1 – H0) / D  
AN1950  
Sensors  
Freescale Semiconductor  
5

与AN1950相关器件

型号 品牌 描述 获取价格 数据表
AN1955 FREESCALE Thermal Measurement Methodology of RF Power Amplifiers

获取价格

AN197 SILICON SERIAL COMMUNICATIONS GUIDE FOR THE CP210X

获取价格

AN1979 FREESCALE Altimeter and Barometer System

获取价格

AN1984 FREESCALE Handling Freescale Pressure Sensors

获取价格

AN1A3Q NEC On-Chip Resistor PNP Silicon Epitaxial Transistor

获取价格

AN1A4M NEC PNP SILICON TRANSISTOR

获取价格