基于单片机的红外测距系统-柴玉国

  • 格式:doc
  • 大小:7.34 MB
  • 文档页数:54

-

--

- .

-word资料-

毕业设计(论文)

题 目:基于单片机的红外测距系统

院: 电子信息学院

专业班级:电气工程及其自动化2010级01班

指导教师: 厉谨 职称: 讲师

学生姓名: 柴玉国

学 号: -

--

- .

-word资料-

摘 要

现代科学技术的发展,进入了许多新领域,而在测距方面先后出现了激光测距、微波雷达测距、超声波测距及红外线测距。

为了实现物体近距离、高精度的无线测量,本文采用红外发射接收模块GP2D12作为距离传感器,单片机作为处理器,编写A/D转换、显示以及与PC机的通信程序,开发了一套便携式的红外距离测量系统,系统可以高精度的实时测量距离,并且将所得距离量通过数码管直接显示出来。本系统结构简单、运行可靠、测量精度高、方便使用,另外本系统形成了一套完善的软硬件开发平台,可以进行扩展、移植和做进一步的开发。

关键词:红外测距,STC52单片机,A/D转换,

-

--

- .

-word资料-

ABSTRACT

The development of modern science and technology, into many new areas,

has a laser The development of modern science and technology, into many

new areas, has a laser range finder in the ranging aspects, ranging of

microwave radar, ultrasonic ranging and infrared ranging.

In order to achieve the objects at close range, high-precision wireless

measurement, I used the infrared transmitter receiver module as the

distance sensor, microcontroller as the processor to write the A / D

conversion, display and communication with the PC program, developed a

will to push infrared distance measurement systems, high-precision real-time

system can display the measured distance, and distance measuring can be

sent through the serial port to a PC display processing, the system structure is

simple and reliable, small size, high accuracy, ease of use, while this system

the formation of a complete set of hardware and software development

platform can be extended, transplantation, and further development.

KEYWORDS: Infrared distance, STC89C52microcontroller, A / D conversion

-

--

- .

-word资料-

目 录

第一章绪 论 ............................................................................ 1

1.1设计背景....................................................................... 1

1.2红外线简介 .................................................................... 2

1.3红外传感器概述 .............................................................. 3

1.3.1红外传感器的分类 .................................................... 3

1.3.2 红外线传感器的应用 ............................................... 6

第二章红外测距的方法和原理 ........................................................ 7

2.1几种红外测距原理及选择 .................................................... 7

2.1.1 相位测距原理 ......................................................... 7

2.1.2 PSD测距原理 ........................................................ 8

2.1.3 带运动机构的双象比较法原理 .................................... 8

2.1.4 时间差测距法原理 .................................................. 8

2.1.5 反射能量法原理 ..................................................... 8

2.1.6三角法红外测距原理 ................................................. 8

2.1.7 红外测距原理的选择 ............................................... 9

第三章、红外测距的基本结构及系统框图 ......................................... 10 -

--

- .

-word资料- 3.1 红外测距的过程 .......................................................... 10

3.2 红外测距系统框图 ......................................................... 12

4.1单片机最小系统模块 ....................................................... 13

4.1.1STC89C52单片机 .................................................... 13

4.1.2单片机的最小系统 .................................................. 18

4.2数据传输模块(程序下载电路) ......................................... 22

4.2.1 USB转串口 .......................................................... 22

4.2.2 MAX232芯片 ........................................................ 24

4.2.3小结 .................................................................. 27

4.3电源电路..................................................................... 27

4.4数码管显示电路 ............................................................ 28

4.4.1 74HC595 ............................................................. 28

4.4.2数码管 ............................................................... 30

4.4.3数码管显示电路原理图 ............................................ 32

4.5 ADC0832 ..................................................................... 32

4.6 GP2D12测距模块 .......................................................... 34

第五章软件模块设计 ................................................................. 36