以下为《水位控制系统设计》的无排版文字预览,完整格式请下载
下载前请仔细阅读文字预览以及下方图片预览。图片预览是什么样的,下载的文档就是什么样的。
微控制器控制课程设计
实践报告
课设题目:
水位控制系统设计
学生姓名:
袁某某、施某某
学 号:
***14、***18
***:
电子与电气***
专业班级:
18电气工程与智能控制
指导教师:
叶某某
学年学期:
2020-2021学年第二学期
摘 要
水位控制系统是以水位为被控参数的控制系统,它在工业生产的各个领域都有广泛的应用。在工业生产过程中,有很多地方需要对容器内的介质进行水位控制,使之高精度地保持在给定的数值,如在建材行业中,玻璃窑炉水位的稳定对窑炉的使用寿命和产品的质量起着至关重要的作用。水位控制一般指对某一液位进行控制调节,使其达到所要求的控制精度。
本设计采用以AT89C51单片机为核心的低成本、高精度、微型化数字显示水位控制的硬件电路和软件设计方法。整个电路采用模块化设计,由主程序、预置子程序、显示子程序等模块组成。利用滑动变阻器的阻值变化来代替水位变化,通过ADC0808芯片将模拟量变为数字量,传递给单片机,实现水位控制。在此基础上设计了系统的总体方案,最后通过硬件和软件实现了各个功能模块。
经实验证明,这套系统软硬件设计合理、抗干扰能力强、实时性良好,经过系统扩展和升级,可以有效地解决水位控制问题
关键词:AT89C51;ADC0808;显示模块;滑动变阻器
Abstract
Water level control system is a control system with the water level as the accused parameter, which is widely used in various fields of industrial production. In the process of industrial production, there are many places to control the water level of the medium in the container to maintain high accuracy in the given value. For example, in the building materials industry, the stability of the water level of the glass kiln plays a vital role in the service life and product quality of the kiln. Water level control generally refers to the control and adjustment of a certain liquid level to achieve the required control accuracy.
This design adopts the hardware circuit and software design method of low cost, high precision and miniature digital display water level control with AT89C51 chip. The whole circuit is modular design, composed of main program, pre-program, display subroutine and other modules. The resistance change of the sliding resistor is used to replace the change of water level, and the analog amount becomes digital through the ADC0808 chip and passed to the single chip machine to realize the water level control. Then, the overall scheme of the system is designed, and finally the various functional modules are realized through the hardware and software.
Experiments have proved that the software and hardware have reasonable design, strong anti-interference ability and good real-time performance, and the water level control problem can be effectively solved through the system expansion and upgrading
Keywords:AT89C51;ADC0808; display module; sliding variable resistor
目录
一、硬件电路设计 4
1、系统硬件方案 4
2、 核心芯片AT89C51单片机 4
3、 硬件电路接线图 5
4、系统仿真图 6
二、软件程序设计 7
1、系统软件总体方案 7
2、 程序流程图 7
三、 功能测试 8
1、protus仿真 8
2、实物图 9
四、总结 10
五、参考文献 11
附录 12
源程序 12
一、硬件电路设计
硬件电路的设计主要包括单片机系统及显示电路、超声波发射电路和超声波检测接收电路三部分。单片机采用AT89C51或其兼容系列。采用12MHz高精度的晶振,以获得较稳定时钟频率,减小测量误差。单片机用P1.0端口输出超声波换能器所需的40kHz的方波信号,利用外中断0口监测超声波接收电路输出的返回信号。由数码管作为显示器,ADC芯片采用ADC0808,滑动变阻器模拟液位,具有声光报警,四个按键用于设置阈值;。
1、系统硬件方案
系统方案设计液位控制是利用把水位的状态转换成模拟信号,再通过模数转换器AT89C51把输出状态直接接到单片机的I/O接口,单片机经过运算控制,输出数字信号,输出接口接数码管进行显示,实现液位的报警和键盘的显示与控制;图2即是液位控制系统:
/
图1水位控制系统
由上图可观察到通过滑动变阻器改变模拟水位变化,输出模拟信号,再通过模数转换器把输入的模拟信号转换成数字信号,通过AT89C51单片机的运算控制,在通过LED进行显示,通过报警装置进行报警,报警显示之后再通过对阀门的开启实现对水体的水位进行调节控制,阀门的驱动设备是电动机。
核心芯片AT89C51单片机
AT89C51是一种带4K字节FLASH存储器(FPEROM—Flash Programmable and Erasable Read Only Memory)的低电 内容过长,仅展示头部和尾部部分文字预览,全文请查看图片预览。
while(1)
{
a1();
x=adc0809();
x=210-x;
q[0]=16; //210/100=2 10/10=1;
q[1]=x/100;
q[2]=x%100/10;
q[3]=x%10;
if(asx){i1=1;d1=z1=0;}}
a2();
}
}
void int1(void )interrupt 1//定时器中断
{
CLOCK=~CLOCK;
}
[文章尾部最后300字内容到此结束,中间部分内容请查看底下的图片预览]请点击下方选择您需要的文档下载。
以上为《水位控制系统设计》的无排版文字预览,完整格式请下载
下载前请仔细阅读上面文字预览以及下方图片预览。图片预览是什么样的,下载的文档就是什么样的。