1、 I 智能移动探测装置智能移动探测装置 软件设计软件设计 摘要 本系统由信号检测、信号控制以及通信部分组成。系统选用 STC12C5A60S2 单片机为 核心控制器,主要由电源模块、电机驱动模块、超声波测距模块、红外避障模块、无线通 信模块(XL2401-D03) 、一氧化碳探测模块、温度检测模块构成智能移动探测装置。其中 小车驱动由 L298N 驱动电路完成,速度由单片机输出的 PWM 波控制。避障通过红外传感器 模块和超声波测距模块配合,来控制小车的移动方向。将小车摄像头采集的现场图片,通 过无线传输模块将图片传送至前方电脑,并传送现场的一氧化碳浓度及温度以达到探测的 目的。 关键词:ST
2、C12C5A60S2单片机;L298N;无线通信(XL2401-D03) ;超声波测距;红外避障 II Intelligent mobile detection device Software design Abstract This system consists of signal detection, signal control and communication. Choose STC12C5A60S2 single-chip microcomputer as the core controller system, mainly by the power supply module,
3、 motor drive module, ultrasonic distance measuring module, Infrared obstacle avoidance module ,wireless communication module (XL2401 - D03), carbon monoxide detection module, temperature detection modules intelligent mobile device. Which car drivers completed by L298N drive circuit, the speed is con
4、trolled by single chip microcomputer output PWM wave, obstacle avoidance by ultrasonic ranging module, through the mobile car, the car camera figure collection of pictures, through the wireless transmission module to transfer images to the front of the computer, and sends the scene of the carbon mon
5、oxide concentration and temperature in order to achieve the purpose of detection. Keywords: STC12C5A60S2 microcontroller; L298N; wireless communication (XL2401 - D03); ultrasonic ranging;Infrared obstacle avoidance III 目录 1 绪论 1 1.1 智能移动探测装置的意义及作用 1 1.2 智能移动探测装置的前景 1 1.3 本文工作 1 2 系统的软件设计 3 2.1 软件总体设
6、计方案 3 2.2 软件设计主程序流程图 4 2.2.1 车载系统主流程图 4 2.2.2 车载系统中断流程图 5 2.2.3 手柄显示系统主流程图及中断流程图 6 2.3 开发环境简介 7 2.4 软件设计子程序模块及流程图 8 2.4.1 小车驱动模块 8 2.4.2 超声波测距模块 . 10 2.4.3 一氧化碳检测模块 . 12 2.4.4 显示模块 . 15 2.4.5 温度检测模块 . 18 2.4.6 无线传输模块 . 21 3 软件系统调试 . 23 4 硬件设计思路及原理图 . 24 5 系统功能测试 . 25 5.1 车载系统前方超声波模块测试 . 25 5.2 车载系统左方超声波模块测试 . 25 5.3 车载系统右方超声波模块测试 . 26 5.4 车载系统避障测试 . 26 6 结论 . 28 附录 1:车载系统源程序清单 . 29 附录 2:手柄系统源程序清单 . 49 参考文献 . 57 致谢 . 58 1 1 绪论 1.1 智能移动探测装置的意义及作用 自从第一个机器人的诞生,便标志着人类在智能方面的探索将是一个新的开始,是人 类探索智能方面的