设计说明书
总字数:13000+
摘要
地铁作为城市公共交通的核心载体,其运营安全性与高效性直接影响乘客出行体验与公共安全。当前地铁安全门系统多依赖复杂的 PLC 控制,成本较高且维护难度大,而简易门控方案常存在响应滞后、防夹功能缺失等问题,易引发夹伤乘客、车门误关等安全隐患。尤其在高峰时段,乘客上下车频繁,安全门的精准检测与快速响应成为保障乘客人身安全、提升运营效率的关键。因此,研发一种低成本、高可靠性、具备人体检测与防夹功能的地铁安全门控制系统,对优化地铁运营安全具有重要现实意义。
本设计提出一种基于 STC89C52 单片机的地铁安全门系统。系统核心功能包括:通过 HC-R04 超声波传感器实时检测地铁门前是否有乘客,当检测到人体信号时,单片机控制 ULN2003A 驱动芯片驱动四相五线步进电机,带动安全门自动开启;若传感器持续未检测到人体,门体开启 5 秒后自动关闭;同时,通过分离式红外对射管构建防夹监测机制,当门体关闭过程中红外光束被遮挡(即检测到夹阻),单片机立即触发电机反转,控制安全门重新开启,避免夹伤乘客;步进电机的转动角度与速度可通过程序精准控制,模拟真实地铁安全门的开关行程与速率。
该地铁安全门系统的作用在于,以低成本单片机为核心实现安全门的智能化控制:HC-R04 的人体检测功能确保乘客上下车时门体及时响应,避免误关;红外对射防夹功能有效规避安全风险;步进电机驱动方案则保障门体动作平稳精准。系统整体结构简单、响应迅速,可作为地铁安全门的简化控制方案或教学实训模型,为地铁安全门的低成本化、小型化设计提供参考,助力提升地铁运营的安全性与经济性。
关键词:STC89C52;地铁安全门;HC-R04 超声波检测;红外防夹;步进电机驱动
Design of Subway Safety Door System Based on Single Chip Microcomputer
Abstract
As the core carrier of urban public transportation, the safety and efficiency of subway operation directly affect passenger travel experience and public safety. The current subway safety door system relies heavily on complex PLC control, which is costly and difficult to maintain. Simple door control schemes often have problems such as delayed response and lack of anti pinch function, which can easily cause safety hazards such as passenger injury and door misoperation. Especially during peak hours, passengers get on and off frequently, and precise detection and rapid response of safety doors become the key to ensuring passengers’ personal safety and improving operational efficiency. Therefore, developing a low-cost, high reliability, and human detection and anti pinch function subway safety door control system is of great practical significance for optimizing subway operation safety.
This design proposes a subway safety door system based on STC89C52 microcontroller. The core functions of the system include: real-time detection of passengers in front of the subway door through HC-R04 ultrasonic sensors. When a human signal is detected, the microcontroller controls the ULN2003A driver chip to drive a four phase five wire stepper motor, which automatically opens the safety door; If the sensor continues to fail to detect a human body, the door will automatically close after 5 seconds of opening; At the same time, an anti pinch monitoring mechanism is constructed through a separated infrared reflector tube. When the infrared beam is blocked during the door closing process (i.e., pinch obstruction is detected), the microcontroller immediately triggers the motor to reverse and controls the safety door to reopen to avoid injuring passengers; The rotation angle and speed of the stepper motor can be precisely controlled through a program, simulating the opening and closing stroke and speed of a real subway safety door.
The function of the subway safety door system is to achieve intelligent control of the safety door with a low-cost microcontroller as the core: the human detection function of HC-R04 ensures timely response of the door body when passengers get on and off, avoiding accidental closing; The infrared anti pinch function effectively avoids safety risks; The stepper motor drive scheme ensures smooth and precise movement of the door body. The overall structure of the system is simple and responsive, which can be used as a simplified control scheme or teaching and training model for subway safety doors, providing reference for the low-cost and miniaturized design of subway safety doors, and helping to improve the safety and economy of subway operations.
Keywords:STC89C52; Subway safety doors; HC-R04 ultrasonic testing; Infrared anti pinch; Stepper motor drive
目 录
1 绪论
1.1 研究背景及意义
1.2 国内外研究现状
1.3 主要内容
2 系统总体方案设计
2.1系统总体设计
2.2 主要模块方案选择
3 系统硬件设计
3.1 总体硬件框架
3.2 主控模块电路设计
3.3 超声波检测模块电路设计
3.4 红外对射防夹模块电路设计
3.5 门体驱动模块电路设计
4 系统程序设计
4.1 编程软件介绍
4.2 系统主流程设计
4.3 步进电机子流程
4.4 超声波检测模块子流程
5 实物制作与功能测试
5.1 实物制作
5.2 超声波检测与自动开关门功能测试
5.3 红外对射防夹功能测试
5.4 门体驱动与多模块协同功能测试
6 总结
参考文献
致谢
附录A 原理图
附录B PCB
附录C 主程序