基于单片机的的智能药盒的设计

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

摘要

随着社会的发展和人们生活水平的提高,人们对生活的健康质量也追求越来越高,为了方便老年人吃药,结合当前智能药盒蓬勃的发展状况,本文介绍了一种基于单片机的家庭用智能药盒的设计。首先,本文介绍了此系统所涉及的硬件的结构和工作原理,主要包括STC90C51单片机、LCD1602液晶和单片机的定时/计数器。其次,介绍了系统硬件的模块化设计和软件的编程思想。最后是对系统进行调试之后得出最后的结果。在第一部分着重介绍了单片机的各项参数、内部结构、引脚功能,LCD1602的硬件电路、显示原理和各项命令,定时/计数器和蜂鸣器原理的简单介绍。在第二部分则系统地介绍了各模块之间的运作模式和工作流程。最后调试完善后得到的系统运行基本模式为:系统基于单片机控制,通过对单片机STC90C516定时器中断的设计,使其完成对时钟运行的控制,并通过LCD1602液晶显示出来。当系统检测到有时间设置功能键或用药设置功能键有输入时,进入关中断调时及设置状态,之后开中断并按下定时键记录当前设置的时间及用药量的值。在调节好系统时间之后,系统时间向前运行的过程中不断将系统实时时间与记录时间作比较,两者相等时发出警报并显示所设置的用药量,一分钟后系统实时时间与记录时间不在相等则自动退出提醒,如此实现每天四次用药及每次四种用药服用量的提醒,比较适合普通家庭使用。

关键词:智能药盒;STC90C516;时钟;1602显示

Abstract

With the development of society and people's living standards improve,more and more people pursue a higher level of health.In order to facilitate the old to take medicine,in combination with the vigorous development situation of smart pillbox,this paper introduces a design of domestic smart pillbox based on STC90C516 SCM(Single chip microcomputer).First,this paper introduces the system structure and working principle of hardware involved,mainly includes SCM,LCD1602 and the counter timer of the SCM.Secondly,the paper introduces the system hardware modular design and soft programming ideas.Finally,get the final result after debugging.The first part introduces the various parameters of SCM,the internal structure and pin functions,as well as hardware circuit and various commands of LCD1602,the principle of LCD1602,counter timer and buzzer.The second part introduces the operation model and work process between each module systematically.After the completion of debugging,the system basic operation mode is:the system is based on STC90C516,through the design of STC90516 timer interrupt,the system control the clock running forward,and display the time on the LCD1602.When the system detects that the time setting keys or the dosage keys have input,close the interrupt and setting the value of time or dosage,then open the interrupt and press the time-setting keys down to record the time and dosage,As the system time running forward,comparing record time with the current time,when two values are equal activate the alarm and display the dosage value,a minute latter,the two values are not equal,the system close the alarm,this is the way of reminding a person to take four kinds of medicine four times a day it`s suitable for ordinary families.

Key words: smart pillbox STC90C516 clock LCD1602

目录

摘要....................................................................... Abstract .................................................................. I 1 绪论.. 0

1.1 选题目的和意义 0

1.2 目前智能药盒的现状 0

1.3 本文的结构 (1)

2 系统总体方案设计 (2)

2.1 设计要求 (2)

2.2 总体设计思路 (2)

2.3 系统结构设计 (4)

3 硬件电路的设计 (5)

3.1 单片机最小系统 (5)

3.1.1. STC90C51RC/RD+系列单片机简介 (5)

3.1.2. 晶振电路 (8)

3.1.3. 复位电路 (9)

3.2 显示电路 (10)

3.3 键盘电路 (12)

3.4 蜂鸣器报警电路 (13)

3.5 发光二极管电路 (13)

3.6 定时模式装入初值的计算 (14)

4 系统软件设计 (15)

4.1 系统主程序 (15)

4.2 系统软件子程序 (17)

4.2.1. 按键扫描子函数 (17)

4.2.2. 中断子函数 (18)

5 系统的调试 (19)

5.1 软件调试 (19)

5.2 硬件调试 (20)

5.3 调试结果 (23)

6 结论与展望 (25)

相关文档
最新文档