news 2026/6/10 16:16:35

【dz-1048】基于单片机的自动避障小车

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
【dz-1048】基于单片机的自动避障小车

摘要

在智能移动设备快速发展的当下,自动避障技术作为移动设备自主导航的核心,对提升设备的自主性、安全性和工作效率具有重要意义。传统的手动控制小车不仅依赖人为操作、响应存在延迟,还存在操作繁琐、适用场景有限等问题,难以满足自动化、智能化移动的需求。​

基于 STC89C52 单片机的自动避障小车,整合了 HC-SR04 超声波传感器、SG90 舵机、SDC9150 直流电机驱动模块、CN-TTS 语音播报模块、LCD1602 显示屏及按键,实现了小车的自动避障与智能行驶。系统核心功能包括:通过 HC-SR04 超声波检测前方障碍物,若前方有障碍物,启动 SG90 舵机带动超声波检测左侧是否有障碍物,左侧无障碍物则左转,左侧有障碍物则启动舵机检测右侧,右侧无障碍物则右转,右侧有障碍物则小车退后,再依次检测左右是否有障碍物;通过 SDC9150 直流电机驱动模块驱动直流电机,控制小车的行驶状态;借助 CN-TTS 语音播报模块播报小车左转、右转或后退等动作;利用 LCD1602 显示障碍物距离值;支持通过 1 个按键启动小车。​

该系统的实现,有效提升了小车的自动避障能力和智能化行驶水平,减少了人工干预,确保了小车在复杂环境中的稳定运行,为智能移动设备的研发提供了高效、可靠的解决方案,同时为同类自动避障设备的设计提供了参考,具有较高的实际应用价值。​

关键词:STC89C52;自动避障小车;超声波传感器;智能行驶;语音播报

ABSTRACT

With the rapid development of intelligent mobile devices, automatic obstacle avoidance technology, as the core of autonomous navigation for mobile devices, is of great significance for improving the autonomy, safety, and work efficiency of devices. Traditional manually controlled cars not only rely on human operation with delayed responses but also have problems such as cumbersome operation and limited applicable scenarios, making them difficult to meet the needs of automated and intelligent movement.​

The automatic obstacle-avoiding car based on the STC89C52 microcontroller integrates HC-SR04 ultrasonic sensors, SG90 servos, SDC9150 DC motor driver modules, CN-TTS voice broadcast modules, LCD1602 displays, and buttons, realizing automatic obstacle avoidance and intelligent driving of the car. The core functions of the system include: detecting obstacles in front through HC-SR04 ultrasonic waves. If there is an obstacle ahead, start the SG90 servo to drive the ultrasonic wave to detect whether there is an obstacle on the left. If there is no obstacle on the left, turn left; if there is an obstacle on the left, start the servo to detect the right. If there is no obstacle on the right, turn right; if there is an obstacle on the right, the car retreats and then detects whether there are obstacles on the left and right in turn; drive the DC motor through the SDC9150 DC motor driver module to control the driving state of the car; broadcast actions such as the car turning left, right, or retreating with the help of the CN-TTS voice broadcast module; display the obstacle distance value using LCD1602; support starting the car through one button.​

The implementation of this system effectively improves the car's automatic obstacle avoidance ability and intelligent driving level, reduces manual intervention, ensures the stable operation of the car in complex environments, provides an efficient and reliable solution for the research and development of intelligent mobile devices, and also offers a reference for the design of similar automatic obstacle-avoiding equipment, with high practical application value.​

Keywords:STC89C52; Automatic obstacle-avoiding car; Ultrasonic sensor; Intelligent driving; Voice broadcast

目录

第 1 章 绪论

1.1 研究的目的及意义

1.2 国内外发展情况

1.3 本文主要研究内容

第2章 设计思路与方案论证

2.1 主要元器件选择

2.1.1 主控芯片选择

2.1.2 超声波传感器选择

2.1.3 舵机选择

2.1.4 直流电机驱动模块选择

2.1.5 语音播报模块选择

2.1.6 显示模块选择

2.1.7 按键模块选择

2.2整体设计方案

第 3 章 硬件设计

3.1 主控电路模块

3.2 超声波传感器电路

3.3 舵机电路

3.4 直流电机驱动电路

3.5 语音播报模块电路

3.6 显示模块电路

3.7 按键模块电路

第4章 系统程序设计

4.1 编程软件介绍

4.2 系统主流程设计

4.3 LCD1602显示模块子流程设计

4.4 独立按键子流程设计

4.5 直流电机速度调节子流程设计

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

4.7 舵机子流程设计

4.8 语音播报模块子流程设计

第 5 章 实物测试

5.1 整体实物测试

5.2 超声波传感器功能测试

5.3 语音播报模块功能测试

5.4 显示模块功能测试

5.5 按键功能测试

5.6 自动避障整体功能测试

第 6 章 总结与展望

6.1 总结

6.2 展望

致谢

参考文献

附录

附录一:原理图

附录二:PCB

附录三:主程序

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

网络工程师有哪些岗位可以选择?技术决定下限,方向决定上限!

很多人眼里的网络工程师是这样的: 配交换机、路由器 拉网线、做 VLAN、调 ACL 排查网络故障 做割接、加设备、上链路 但现实是: 如果你只停留在“配置设备”的层面,职业天花板会非常低。 真正决定你职业高度的,不是你会多少命令,而是: 你站在网络体系的哪一层? 你解决的…

作者头像 李华
网站建设 2026/6/10 10:58:16

内网横向——VulnStack-2靶场万字详细解析教程(MSF渗透,黄金票据利用)

本教程围绕 VulnStack-2 靶场展开,从外网信息收集、漏洞利用获取初始权限入手,逐步讲解内网横向移动、黄金票据提权的完整渗透流程,带你沉浸式体验真实内网攻防场景。 文章目录靶场介绍攻击技术网络配置信息内网网段设置NAT网段设置靶机设置W…

作者头像 李华
网站建设 2026/6/9 21:02:27

立体仓库“数字堆垛”:重力仿真让货架承重利用率提12%

堆垛规划是立体仓库高效运营的核心,货架承重利用率直接决定仓储容量、运营成本与存储安全。传统立体仓库堆垛依赖人工经验分配货位,仅简单根据货物重量粗略摆放,无法精准测算货物堆放后的重力分布,为规避货架过载风险,…

作者头像 李华
网站建设 2026/6/10 11:29:59

微软紧急更新修复Office 0Day漏洞(CVE-2026-21509)

漏洞影响范围微软发布带外安全更新,修复了一个正在被积极利用的Office 0Day漏洞(CVE-2026-21509)。该安全功能绕过漏洞影响多个Office版本,包括Microsoft Office 2016、Microsoft Office 2019、Microsoft Office LTSC 2021、Micro…

作者头像 李华
网站建设 2026/6/10 11:44:29

ChatGPT引用马斯克AI生成的Grokipedia是否陷入“内容陷阱“?

Grokipedia是由埃隆马斯克的人工智能公司xAI创建的wikipedia式知识库,其独特之处在于所有内容均由Grok AI自主编写。该平台从互联网采集原始数据,经过综合处理后生成百科全书式条目。 "内容陷阱" 的潜在风险 近期观察发现,ChatGP…

作者头像 李华
网站建设 2026/6/10 11:29:43

宠物交流平台的设计与实现(11811)

有需要的同学,源代码和配套文档领取,加文章最下方的名片哦 一、项目演示 项目演示视频 二、资料介绍 完整源代码(前后端源代码SQL脚本)配套文档(LWPPT开题报告)远程调试控屏包运行 三、技术介绍 Java…

作者头像 李华