毕 业 设 计
专 业: 电子信息工程
二○一○ 年 六 月
基于51单片机的洗衣机控制器设计
Based on 51serial single chip computer Controller design
for dishwasher machine
系 别:电子工程学院
2010 年 6 月
摘 要
洗碗机又称洗碟机或餐具清洗机,是一种代替人工洗涤碗、碟、杯、盘和勺等餐具的家用电器。家用洗碗机在我国具有巨大的市场潜力,随着洗碗机性能的不断改善及消费者认识的不断提高,家用洗碗机必将成为我国“21世纪厨房新亮点\。
基于模糊控制的全自动洗碗机自动控制系统,以单片机AT89S52为核心,可以实现洗碗机的智能控制,提高洗碗质量,节约能源。硬件结构框图及软件流程图是该系统的重要组成部分,在整个控制过程中,模糊控制软件起了决定性的作用
基于51单片机的洗碗控制系统,控制面板由按键、指示灯和LCD 显示器组成。按键选择洗衣机工作方式,指示灯配合按键工作,LCD 显示器则显示洗碗机洗涤和排水时间。洗碗机的整体电路模块包括键盘矩阵、指示灯、电动机控制及电源电路。控制程序设计包括定时中断服务程序、外中断服务程序及主程序。
关键词:模糊控制;洗衣机;全自动;洗衣控制系统;51单片机;控制程序
ABSTRACT
Dishwasher is also known as dining utensils cleaning machine,is an artificial substitute for washing bowls,plates,cups,plates,spoons or other utensils of household appliances.With the improving of household dishwasher and the rising of consumer awareness,household dishwasher has a huge market in china,household dishwasher is boundto become a”new hi9111ight ofthe 21st century kitchen”.
Based on fuzzy control, completely automatic washing machine control system has AT89C51single chip computer as a core, can realize intelligent control to save energy and enhance quality. The hardware diagram and software flow chart are important part of the system. The fuzzy control software play a decisive role in the whole control process.
Based on 51 serial single chip computer, control system of washing machine consists of a control panel which includes the pressing keys, displaying lamps and LED device. The pressing keys select washing operation mode, the displaying lamps cooperate with the pressing keys. LED device displays time span for washing and dehydration. The circuit module includes key matrix, lamp, motor control and power supply. The software includes interruption program and main program.
Key Words:Fuzzy control; washing machine; completely automation; control system
for washing; 51serial single chip computer; control program
目 录
1引言 ··········································································································· 1
1.1 1.2
问题的提出 ................................................................................................................... 1 课题研究的意义 .......................................................................................................... 1
2设计任务 ···································································································· 2
2.1设计的主要内容 ............................................................................................................... 2 2.2主要技术指标 ................................................................................................................... 2 3方案论证 ···································································································· 3
3.1选用单片机AT89S52 ...................................................................................................... 3 3.2选用电机驱动模块L298N ............................................................................................. 4 4硬件电路设计 ······························································································ 5
4.1系统整体框图 ................................................................................................................... 5 4.2人机交互硬件 ................................................................................................................... 5
4.2.1 液晶显示屏 ............................................................................................................ 5 4.2.2 键盘 ....................................................................................................................... 12 4.2.3 LED及蜂鸣器 ...................................................................................................... 12 4.3 电机驱动模块L298N ................................................................................................... 13
4.3.1功能特性 ............................................................................................................... 13 4.3.2引脚定义 ............................................................................................................... 13 4.4单片机AT89S52 ............................................................................................................. 14
4.4.1 AT89S52功能特性 ............................................................................................. 14 4.4.2 芯片结构 .............................................................................................................. 15 4.4.3 引脚功能 .............................................................................................................. 16
5软件设计 ·································································································· 19
5.1 主程序流程图 ................................................................................................................ 19 5.2 液晶显示子程序流程图 ............................................................................................... 20 5.3 键盘驱动程序 .............................................................................................................. 21
5.3.1 初始化子程序 ................................................................................................... 21 5.3.2 按下判断子程序 ............................................................................................... 21 5.3.3 等待抬起子程序 ............................................................................................... 21 5.3.4 键盘扫描子程序 ............................................................................................... 22 5.4 键盘子程序流程图 ........................................................................................................ 23