基于8051单片机的水箱水位控制系统的设计

发布时间 : 星期一 文章基于8051单片机的水箱水位控制系统的设计更新完毕开始阅读

摘 要

随着生活水平的不断提高,人们追求舒适、便利的居住环境的要求也越来越高。人们居住环境中不可或缺的是水,发明创造了大量的器具来使用水以求方便人们的生活。比如,城市楼顶蓄水池和农村居民自建房顶蓄水箱等等。但是人们在使用水的过程中伴随着也会出现许多难以处理的问题,其中水箱水位的控制尤为突出。科研中发现单片机具有多功能、高性能、低电压、低功耗、低价格的显著特点。所以利用单片机对水箱水位进行控制可以极大的减少投入,具有很高的经济价值与实用性。本设计水箱水位控制系统由主控制芯片、检测电路、手动电路、指示灯电路、时钟电路、报警装置和供水装置构成,其中主控制芯片是AT89C2051,电路通过水位传感器采集水位高度送入AT89C2051进行处理,当水箱水位高于水位上限的时候,黄灯亮,并报警,水泵机停止转动,停止向水箱送水;当水箱水位低于水位下限的时候,蓝灯亮,并报警,水泵机开始转动,开始向水箱送水;当水箱水位处于上下水位之间的时候,绿灯亮,维持原有工作状态;当水箱水位处于混乱中时,水泵机停止转动,红灯亮,并报警。电路可实现自动与手动的转换,全自动模式下,系统自动判断水位的状况,选择不同的工作状态。在手动的模式下,水泵机的运行控制可由人工自己操作。利用单片机实现水箱控制,对于提高劳动生产率和产品质量,节约能源等都有着积极意义。

关键词:单片机;水箱;水位控制

ABSTRACT

As the standard of living has continued to improve, and the quest for comfortable and convenient living environment there are increasingly high requirements. It is in the living environment is an integral part of the water, and invent a lot of utensils to use water to make it easier for people's lives. For example, a city on the roof top tanks and rural self-built roof tanks, and so on. But it was in use in the process of water will also be accompanied by a number, it is difficult to deal with the problem of the control level in the reservoir, which is particularly striking. Research has found that single-chip multi-purpose, high-performance, low-voltage, low power, low-price. Therefore, using a single chip to control level in the reservoir can greatly reduce inputs and has a high economic value and utility. The tank water level control system design from the main control chip, test the circuit, circuit, manually indicator circuit, clock circuits, alarm and water units, with the main control chip is AT C 2051 89, circuit-level water level sensors to capture high-feed AT C 89 2051, when Upper level in the reservoir water level is higher than the yellow light comes on, alarm, a water pump, and the stopped, the water tank to stop; when the water tank level drops below the low water level, when the blue light comes on, and pump alarms, begin to turn the water tank, and began to deliver water level in the reservoir, the water level is up and down between the green light comes on when the original work, and when the level in the reservoir is in a state of chaos, pump stops, red light is on, and alarm. Circuits for automatic and manual conversion, full automatic mode, the system automatically determines the water level in the work and select a different state. In manual mode, the pump can be run manually control your own actions. Using a single chip to control water tank, and for improving the productivity and quality of the product, energy conservation, and others have a positive significance.

Key words: Single chip microcomputer; water tank; water tank of control

2

目 录

第1章 绪 论 ............................................................................................................ 1

1.1 水箱水位单片机控制系统概述 ..................................................................... 1 1.2 本设计任务和主要内容 ................................................................................. 1

第2章 总体方案设计 ........................................................................................... 2

2.1 设计方框图 ..................................................................................................... 2 2.2 硬件设计原理图 ............................................................................................. 2

第3章 系统硬件各主电路设计 ......................................................................... 4

3.1检测电路 .......................................................................................................... 4 3.1.1 光电三极管 .............................................................................................. 5 3.2水泵电动机供水电路 ...................................................................................... 5 3.3报警电路 .......................................................................................................... 6 3.4控制电路 .......................................................................................................... 7 3.5手动模式控制电路 .......................................................................................... 7 3.6指示电路 .......................................................................................................... 8 3.7时钟电路 .......................................................................................................... 9

第4章 系统的软件设计 ..................................................................................... 10

4.1 系统主程序设计 ........................................................................................... 10 4.2 自动模式子程序设计 ................................................................................... 10 4.3 手动模式子程序设计 ................................................................................... 12 4.4 延时5S子程序设计 ..................................................................................... 14

结 论 ........................................................................................................................ 15 参考文献 ................................................................................................................... 16 致 谢 .......................................................................................................................... 17

3

第1章 绪 论

1.1 水箱水位单片机控制系统概述

水箱是工矿企业、民用住宅等公共供水系统不可缺少的组成部分。现实生活中家用太阳能热水器方便、节能、无污染,应用广泛,但是由于储水,排水的不当,造成了水资源的浪费,也会造成另外某些不必要的损失。为了减少这些损失,水箱水位的控制成了值得关注的问题。单片机是现代计算机和电子技术的新兴领域。单片机的单芯片的微小体积和极低的成本,可广泛地嵌入到如玩具、家用电器、机器人、仪器仪表、汽车电子系统、工业控制单元、办公自动化设备、金融电子系统、舰船、个人信息终端及通信产品中,成为现代电子系统中最重要的智能化工具。单片机具有多功能、高性能、低电压、低功耗、低价格的显著特点。所以利用单片机对水箱进行控制可以极大的减少投入,具有很高的经济价值与实用性。利用单片机实现水箱控制,对于提高劳动生产率和产品质量,节约能源等都有着积极意义[1]。

1.2 本设计任务和主要内容

本次设计的系统能够监测出水箱的水位,根据相应的要求对水箱的水位进行自动或者手动控制。系统以8051单片机作为主控制芯片,通过水泵为水箱上水和放水,通过按键对系统水位上、下限进行调整。

1.在水箱水位高于水位上限的时候,黄灯亮,并出现报警现象,水泵机停止转动,停止向水箱送水。

2.在水箱水位低于水位下限的时候,蓝灯亮,并出现报警现象,水泵机开始转动,开始向水箱送水。

3.在水箱水位处于上下水位之间的时候,绿灯亮,维持原有工作状态。 4. 在水箱水位处于混乱中时,水泵机停止转动,红灯亮,并出现报警现象。 手动/自动模式转换控制如下:全自动模式下,系统自动判断水位的状况;在手动的模式下,水泵机的运行控制可由人工操作。

1

联系合同范文客服:xxxxx#qq.com(#替换为@)