当前位置:首页 > 测控技术与仪器毕业论文 基于单片机的水塔水位测量控制系统设计
编号:
毕业设计(论文)说明书
题 目: 基于单片机的水塔水位
测量控制系统
院 (系): 电子工程学院
专 业: 测控技术与仪器 学生姓名: 学 号: 指导教师:
职 称:
题目类型: 理论研究 实验研究 工程设计 √ 工程技术研究 软件开发
2010年 1 月 3 日
摘 要
水是生命的源泉,离开了水,生活将变得寸步难行,所以必须要对水进行合理的利用, 利用水之前首先得控制水的供应状态,这就需要一个自动化的控制系统,对水塔中的水进行无人补给,确保生活中自来水的正常供应。由此可见,该系统是非常实用的,而且要普及到生活中,这就有必要设计一个既经济又实用的系统。
在对单片机控制技术研究的基础上,本设计采用C语言以及汇编语言联用设计的一个水塔水位测量控制系统。它包括发射电路、接收电路、单片机控制电路以及显示和控制电路。利用单片机本身40KHz信号作为发射信号,而接收方面则需要一个能对应接收40KHz左右的信号处理电路,把超声波转换成电信号,在用单片机读取该信号,完成一个测量的过程。根据超声波在测距中的原理,在信号方面利用超声波传感器作为发射和接收的源头,对水塔中的水位时时观测,在显示电路中用LCD进行动态显示,显示水位的精度为1mm。另外,键盘电路采用触点累加模式可以设置水位的上下限,当水位低于下限时,电磁阀自动打开为水塔补水,当水位到达上限时,电磁阀自动关闭,停止补水并报警。
经过多次测试验证,该系统具有较好的灵敏度和稳定度,达到了预期设计目标,有一定的实用价值。
关键词: 单片机;超声波;发射;接收
Abstract
Water is the source of life, left the water, life will become step, it must be reasonable water use, used of water must first be controlled before the water supply status, which requires an automated control system, on the towers of no water supply, to ensure the normal life of the supply of tap water. It can be seen that the system is very practical, but also to access to life, which there is a need to design an economical and practical systems.
Single-chip control technology on the basis of the study, the design uses C language and assembly language in conjunction with the design of a control system for measuring water towers. It includes transmitter, receiver circuit, single-chip control circuit, as well as display and control circuits. The use of single-chip 40KHz signal itself as a launch signal, and the receiving side needs a receiver to correspond to about 40KHz signal processing circuit, the ultrasonic signal into the single-chip to read the signals the completion of a measurement process. According to ultrasound in the range of principle, the use of ultrasound in the signal-transmitting and receiving sensor as the source of the water level of the towers from time to time in the observation, in the show circuit with dynamic LCD display, indicating the water level of accuracy of 1mm. In addition, the keyboard circuit contacts cumulative water level can be set upper and lower limits, when the water level is lower than under the limit, the solenoid valve to open automatically pay for the towers, when the water level reached the upper limit of self-closing solenoid valve, and stop almost on a daily basis and report to the police.
After several rounds of testing to verify that the system has good sensitivity and stability, to achieve the desired design objectives, a certain degree of practical value.
Key words: single-chip; ultrasonic; transmit; receive
目 录
引 言 .................................................................... 1 1. 概述 .................................................................. 1 1.1 水塔水位自动控制系统的介绍 .......................................... 1 1.2 设计任务与要求 ...................................................... 1 1.3 系统主要功能 ........................................................ 2 2 方案选择与论证 .......................................................... 2 2.1设计思路 ............................................................ 2 2.1.1显示电路的选择与论证 ............................................. 2 2.1.2显示驱动方案的选择与论证 ......................................... 3 2.2 总方案确定 .......................................................... 3 3 器件介绍 ............................................................... 4 3.1 AT89S52芯片 ......................................................... 4 3.2 CX20106A芯片 ........................................................ 7 3.3 74LS04芯片 .......................................................... 8 3.4 TS1620-1液晶数码管 .................................................. 8 4 硬件电路设计 .......................................................... 10 4.1 芯片选择 ........................................................... 10 4.2 工作原理 ........................................................... 11 4.3 单片机系统及显示电路 ............................................... 11 4.4 超声波发射电路 ..................................................... 12 4.5超声波接收电路 ..................................................... 12 4.6控制电路 ........................................................... 13 5 软件设计 ............................................................... 14 5.1程序设计 ........................................................... 14 5.1.1超声波测距器的算法设计 .......................................... 14 5.1.2主程序设计 ...................................................... 14 5.2 超声波发生子程序和超声波接收中断程序 ............................... 15 6 系统调试及技术指标 ..................................................... 17 6.1 硬件调试 ........................................................... 17 6.1.1测试仪器 ........................................................ 17 6.1.2测试步骤 ........................................................ 17 6.2 软件调试 ........................................................... 18 6.3 软硬联调 ........................................................... 18 6.3 .1测量水位 ......................................................... 18 6.3 .2测量水位超声波测距误差分析 ....................................... 19 6.4 调试遇到的问题及其解决方法 ......................................... 20 6.5 主要技术参数 ....................................................... 20 6.6 水塔水位测量控制系统使用说明 ....................................... 20
共分享92篇相关文档