基于单片机的视力保护器电路的设计 下载本文

基于单片机的视力保护器电路的设计

摘要:如今这个时代被人们称为信息时代,这些年,计算机技术以不可阻挡之势迅猛发展,在工业、农业、国防、医疗、科研等众多领域发挥着重要的作用,成为各国衡量其国际竞争力的重要标准之一。单片机有着优越的控制能力,在工业控制、医疗控制,只能仪表等领域有着广泛的应用,更以有着无比的优越性从而成了微型的计算机的一个非常重要的分支。

本文主要介绍了单片机的发展概况和视力保护器的发展历程,利用单片机AT89C51设计一款性能优越的视力保护器。在AT89C51型单片机的硬件设施基础上实现测距、感光、定时、报警四大功能。其中测距模块和感光模块主要是由相应的传感器组成,实现对使用者距离和周围环境光线强度的检测和报警功能。定时模块是由单片机的运行程序构成,实现对使用者学习时间的监测和提示功能。介绍了利用Keil平台实现定时汇编语言的方法。同时也简单介绍了该技术的应用现状和发展前景。

关键词:单片机;传感器;定时器;Keil

1

Vision protector circuit design based on

single chip microcomputer

Abstract:Now this era known as the information age, these years, the technology of the computer to the irresistible trend of rapid development,and plays an important role in many fields of industry, agriculture,national defense, medical, scientific research, become one of the most important standards to measure the international competitiveness of the countries.Single chip microcomputer as an important branch of microcomputer, with its superior control function, in the industrial control, intelligent instrument system is showing its superiority.

This paper mainly describes the present situation of the development of the single chip microcomputer and the development of vision protector, using single-chip microcomputer AT89C51 design a superior performance vision protector. On the basis of type AT89C51 single chip microcomputer hardware implementation ranging, photographic, timing,alarm, four big functions. The ranging module and photosensitive module is mainly composed of the corresponding sensor, realize the user distance and ambient light intensity detection and alarm function. Timing module is made up of single chip microcomputer to run the program, implementation of the user study time monitoring and prompt functions. Introduced the method of using Keil platform implementation timing assembly language. At the same time also simply introduces the present situation of the application of the technology and development prospects.

Key words: Single chip microcomputer;transducer;timer;keil

2

目录

1.绪论..........................................................1 1.1 选题背景............................................1

1.2 视力保护器的现状及其展望............................2 1.3 主要研究内容........................................2

2.系统硬件设计.............................................4 2.1 8051单片机简介......................................4 2.2 传感器辅助坐直报警电路..............................7 2.3 8051单片机的中断系统.................................8 2.3.1中断的概念...................................8 2.3.2中断系统结构以及中断控制.....................9 2.3.3中断响应及中断处理过程......................12 2.4 光线报警电路.......................................13 2.4.1光敏电阻控制电路..........................13 2.4.2光线发声报警电路..........................13 2.5 定时报警电路.......................................14 2.5.1单片机控制电路............................14 2.5.2定时器报警发声电路........................15 3. 开发系统软件设计.......................................16 3.1 Keil C51软件简介....................................16 3.2程序的模块化划分....................................16 3.3程序模块............................................18 3.3.1超声波测距模块............................18 3.3.2外部中断模块..............................19 3.3.3定时模块..................................20 4. 结论及展望.............................................22 参考文献.......................................................23 附录.........................................................24

I

第一章 绪论

1.1选题背景

随着改革开放的发展,现如今社会对于广大社会人群要求其知识水平越来越高,特别是学生,故而现在是学生学习的高峰期,对他们的造成的学习压力也是特别繁重的。根据有关的报告显示,我国现在的盲人人数以百万计,更甚的是低度近视的以千万计。近视眼这种疾病在儿童及青少年时期极易发生,因其不注意保护自己视力,各种的坐姿和作业方式不正确。根据近年全国学生体质健康调查报告结论如下所示。更让人震惊的是,约有三十多万的人因高度近视而导致眼盲。

图1-1 视力调查表 我国因人口基数众多也因对对视力保护不够重视,故而近视眼的人数据世界第一位,同时近视眼发病的概率也是全世界最高的。学生因需经常用眼,故而在广大的近视眼人群中占据了巨大部分,有着相当多的人数。中国广大学生的近视度数还是较为偏高的,而且人数呈现出逐年递增的趋势,且递增的比例相当大。这种趋势使得社会人群普遍的关注和担忧。他们作业阅读姿势不正确和作业阅读的时间过长是导致近视眼病的主要原因,因此设计一款人性化的视力保护器对于广大学生保护眼睛来说意义重大。

1

大学生 70.34% 中学生 55.22% 小学生 22.78%