基于51单片机的多功能智能小车的探讨

2019-09-10 07:22:44陈文鑫
现代信息科技 2019年23期

摘  要:本次设计一个具备红外循迹、超声波避障及红外遥控智能小车。选择四轮驱动方式,以STC89C52RC芯片为核心控制。采用L298D集成电路驱动直流电机,用单片机产生PWM信号控制电机转速从而调速,通过超声波实现避障,返回距离数据,在此基础上接入红外控制,单片机解码后,自动选择小车功能。本设计结构简单,较容易实现,但具有高度的智能化、人性化,一定程度上体现了智能属性。

关键词:智能车;STC89C52RC;PWM控制;红外循迹;超声波避障;红外遥控

中图分类号:TP23;TP368.1       文獻标识码:A 文章编号:2096-4706(2019)23-0025-05

Discussion on Multifunctional Intelligent Car Based on 51 Single Chip Microcomputer

CHEN Wenxin

(Sichuan Agricultural University,Ya’an  625014,China)

Abstract:An intelligent car with infrared tracking,ultrasonic obstacle avoidance and infrared remote control is designed. Four wheel drive mode is selected,and STC89C52RCchip is used as the core control. L298D integrated circuit is used to drive DC motor,PWM signal is generated by single chip microcomputer to control motor speed so as to adjust speed. Obstacle avoidance and distance data are realized by ultrasonic wave. On this basis,access infrared control. After decoding by single chip microcomputer,the car function is automatically selected. The structure of the design is simple and easy to realize,but it has a high degree of intelligence and humanization,reflecting intelligence to a certain extent.

Keywords:smart car;STC89C52RC;PWM control;infrared tracking;ultrasonic obstacle avoidance;infrared remote control

1  硬件电路原理及设计

1.1  STC89C52RC最小系统

本文的设计中采用了一款十分常用的51系列单片机作为处理器,其特点是价格低廉、使用方便,且可与其他处理器进行通讯。

系统时钟:晶振频率/12,本设计采用11.0592M晶振,因此系统时钟为0.9216us,约为1us。

I/O口资源:4个通用8位准双向I/O口(P0、P1、P2、P3,其中P3为特殊功能口)。

通讯:一对全双工串行通讯口(P3.0、P3.1),可与其他单片机或上位机进行通讯。

中断:2个外部中断(/INT0、/INT1),2个定时器中断(T0、T1),1个串行通讯中断,共5个中断资源并有2级中断优先级可供配置。

程序存储:该单片机提供8K的Flash程序存储器供用户编写程序。

STC89C52RC最小系统电路图如图1所示。

1.2  电源供电稳压模块

1.2.1  原理

7805三端稳压集成电路对先对输入电压进行采样,之后反馈回调节电路调节输出级的阻抗。当输出电压偏低时,调节输出级的阻抗变小,从而减小输出管压降;当输出电压偏高时,调节输出级的阻抗变大,从而增大调整管压降,这样就维持了输出电压的稳定。……

登录APP查看全文