基于单片机的客车超载监控系统的设计
2010年6月
摘 要
本文设计了一个客车超载监控系统,以MCS-51单片机为核心,利用反射式红外传感器、方向识别电路、报警电路、锁定电路设计,能够通过键盘手动设置乘客人数的上限值,并用LED显示器显示车内的实时乘客人数。当客车内人数超载时,系统发出声光报警,并通过继电器切断客车的电子启动装置,从而将汽车锁定,使之无法行驶。当超载解除后,声光报警也相应的解除,客车锁定解除,可以正常运行。
本设计共分两部分,硬件系统设计和软件系统设计。硬件部分利用红外传感器和方向识别电路将乘客的上、下车情况进行检测和判断并输入单片机系统。经过单片机系统将处理的数据送LED显示,声光报警电路由蜂鸣器和发光二极管组成,用继电器实现对客车启动装置的锁定。软件部分用汇编语言进行编程,采用模块化设计思想。该系统通过调试后,能够较好的完成客车超载的预警提示,并对超载情况进行相关控制。
关键词:客车;超载;监控;单片机
I
Abstract
This paper illustrates the design of a carriage overload monitoring systerm.MCS-51 MCU as core is used to design hardware circuit and software.In this subject we use infrared sensors,identify circuit and alarmcircuit latch circuit to design a carriage overload monitoring systerm that enables the keyboard to manually set limits on the number of passengers and can use LED at the same time to display the number of passengers inside.If the passenger overloading,the sound and light alarm systerm cuts off the bus through the electronic launch devices.By doing this,the overload monitoring systerm can lock the car,so that the car can’t be started.When the overload is canceled,the sound and light warning is canceled. The bus is also unlocked and can be operated normally.
The design is divided into two parts,hardware systerm design and software systerm design.The hardware systerms part uses infrated sensors and identify circuit to detect and judge the situation whether the passengers are getting on or off the bus.This systerm can display the number of passengers on LED. The sound and light alarm circuit is composed of buzzer and LEDs,the lock function of the bus’s launch devices achieves by using the relay unit.Assemble language is used in the software system and modularization design idea is adopted.The monitor system can complete an alarm beforehand for overload, meanwhile the mut uality cont rol will be adopted.
Key words: carriage;overloading;monitoring; SCM(single chip micro computer)
II
目 录
第1章 绪论 ......................................................................................................................... 1 1.1立题的意义 ................................................................................................................. 1 1.2课题研究任务及目标 ................................................................................................. 3 1.3课题主要内容 ............................................................................................................. 3 第2章 客车超载监控系统的方案论证 ............................................................................. 5 2.1系统的原理 ................................................................................................................. 5 2.2系统的组成 ................................................................................................................. 5 第3章 客车超载监控系统的硬件设计 ............................................................................. 8 3.1客车超载监控系统的检测电路 ................................................................................. 8 3.1.1传感器的选择 ....................................................................................................... 8 3.1.2反射式红外传感器检测原理 ............................................................................... 9 3.1.3方向识别电路的设计 ......................................................................................... 10 3.2单片机最小系统的设计 ........................................................................................... 13 3.2.1单片机的选择 ..................................................................................................... 13 3.2.2单片机外围电路的设计 ..................................................................................... 15 3.3显示电路的设计 ....................................................................................................... 17 3.4键盘电路的设计 ....................................................................................................... 19 3.5报警电路的设计 ....................................................................................................... 21 3.6客车锁定电路的设计 ............................................................................................... 21 第4章 客车超载监控系统的软件设计 ........................................................................... 23
III
4.1客车超载监控系统的软件设计方案 ....................................................................... 23 4.2 T0、T1中断计数程序的设计 ................................................................................. 25 4.3按键子程序的设计 ................................................................................................... 26 4.4报警与锁定子程序的设计 ....................................................................................... 27 4.5显示子程序的设计 ................................................................................................... 28 第5章 系统调试与分析 ................................................................................................... 30 5.1系统的硬件调试 ....................................................................................................... 30 5.2系统的软件调试 ....................................................................................................... 31 5.3调试故障及原因分析 ............................................................................................... 31 结论 ..................................................................................................................................... 34 社会经济效益分析 ............................................................................................................. 35 致 谢 ................................................................................................................................. 36 参考文献 ............................................................................................................................. 37 附录I 客车超载监控系统硬件系统原理图 .................................................................... 38 附录Ⅱ 客车超载监控系统程序清单 ............................................................................... 39 附录III 客车超载监控系统硬件实物图 .......................................................................... 45 附录IV 客车超载监控系统元器件清单 ......................................................................... 46
IV