news 2026/4/16 12:49:08

【dz-1044】基于单片机的自动门

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
【dz-1044】基于单片机的自动门

基于单片机的自动门

摘要

在公共场所和家居环境中,自动门的便捷性与安全性已成为提升通行体验的重要因素。传统自动门常存在感应不灵敏、防夹功能缺失或调节不便等问题,可能导致通行效率低或安全隐患。尤其在人流密集场所,可靠的感应触发、及时的防夹保护及灵活的参数调节对保障通行安全至关重要。因此,研发一种低成本、高可靠性的自动门控制系统具有实际应用价值。

本设计提出了一种基于 STC89C52 单片机的自动门控制系统。系统主要功能包括:通过 HC-R04 超声波传感器检测前方人员距离,当距离小于设定最小值时自动开门,延时 5 秒后自动关门;集成分离式红外对射管实现防夹功能,遇障碍物时立即停止关门动作;借助 HX711 压力检测模块辅助检测人员存在,确保开门响应准确;通过 ULN2003A 芯片驱动步进电机模拟门体运行;支持通过按键设置距离阈值;通过 LCD1602 实时显示当前检测距离值。

该自动门控制系统的作用在于,通过多传感器协同感应提升了开门触发的准确性,防夹功能保障了通行安全,参数可调设计增强了场景适应性。为公共场所及家居环境提供了一种低成本、易操作的自动门解决方案,有效提升了通行便捷性与安全性。

关键词:单片机;自动门;STC89C52;传感器;防夹功能

Automatic door based on microcontroller

Abstract

The convenience and safety of automatic doors have become important factors in improving the travel experience in public places and home environments. Traditional automatic doors often suffer from issues such as insensitive sensing, lack of anti pinch function, or inconvenient adjustment, which may lead to low traffic efficiency or safety hazards. Especially in crowded areas, reliable induction triggering, timely anti pinch protection, and flexible parameter adjustment are crucial to ensuring safe passage. Therefore, developing a low-cost and highly reliable automatic door control system has practical application value.

This design proposes an automatic door control system based on STC89C52 microcontroller. The main functions of the system include: detecting the distance of personnel ahead through HC-R04 ultrasonic sensor, automatically opening the door when the distance is less than the set minimum value, and automatically closing the door after a 5-second delay; The integrated and separated infrared collimator achieves anti pinch function, and immediately stops closing the door when encountering obstacles; Using the HX711 pressure detection module to assist in detecting the presence of personnel, ensuring accurate door opening response; Simulate the operation of the gate body by driving the stepper motor with ULN2003A chip; Support setting distance threshold through buttons; Real time display of the current detection distance value through LCD1602.

The function of this automatic door control system is to improve the accuracy of door opening triggering through multi-sensor collaborative sensing, ensure safe passage with anti pinch function, and enhance scene adaptability with adjustable parameter design. It provides a low-cost and easy to operate automatic door solution for public places and home environments, effectively improving accessibility and safety.

Keywords:microcontroller; Automatic Door; STC89C52; Sensors; Anti pinch function

目 录

1 绪论

1.1 研究背景及意义

1.2 国内外研究现状

1.3 主要内容

2 系统总体方案设计

2.1系统总体设计

2.2 主要模块方案选择

3系统硬件设计

3.1 总体硬件框架

3.2 主控模块电路设计

3.3 超声波测距模块电路设计

3.4 压力检测模块电路设计

3.5 防夹检测模块电路设计

3.6 步进电机驱动模块电路设计

3.7 显示模块电路设计

3.8 按键模块电路设计

4 系统程序设计

4.1 编程软件介绍

4.2 系统主流程设计

4.3 LCD1602显示模块子流程设计

4.4 超声波检测模块子流程设计

4.5 步进电机子流程设计

5实物制作与功能测试

5.1 实物制作

5.2 超声波测距与自动开门功能测试

5.3 压力检测辅助开门功能测试

5.4 防夹保护功能测试

5.5 按键设置与参数调节功能测试

6 总结

参考文献

致谢

附录A 原理图

附录B PCB

附录C 主程序

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/4/12 1:26:57

vue2 单文件组件加入浏览器的title和ico的方法

加入title:代码:const router createRouter({history: createWebHistory(process.env.BASE_URL),routes, });// 在 router/index.js 的导出前添加 router.beforeEach((to, from, next) > {if (to.meta.title) {document.title to.meta.title;}next(…

作者头像 李华
网站建设 2026/4/16 11:04:56

2026年EOR名义雇主服务TOP5推荐榜单,帮助企业开启全球布局新篇章

EOR名义雇主服务在企业国际化进程中扮演了重要角色。通过EOR名义雇主服务,企业可以有效减少行政负担,轻松应对海外市场的用工挑战。这类服务帮助企业合法雇佣当地员工,确保遵守当地法律法规。随着全球化的深入,越来越多的公司意识…

作者头像 李华
网站建设 2026/4/16 9:23:34

2026年度EOR名义雇主模式TOP3服务推荐,助力企业用工转型新风尚

EOR名义雇主服务,已经成为企业用工转型的重要工具。在当前的市场环境中,灵活用工需求不断上升。EOR名义雇主能帮助企业快速适应不同的法律法规,确保合规运营。通过这种模式,企业可以有效降低招聘和管理成本。与此同时,…

作者头像 李华
网站建设 2026/4/16 9:24:21

Agentic AI的社会价值「落地障碍」:提示工程架构师的5个解决思路

Agentic AI的社会价值「落地障碍」:提示工程架构师的5个解决思路 一、引言:当AI agent走进现实,我们遇到了什么? 清晨8点的医院诊室里,张医生正对着电脑发愁——昨天刚上线的AI诊断agent给出了一个“肺炎”的结论&am…

作者头像 李华