天津职业技术师范大学TianjinUniversityofTechnologyandEducation毕业设计专业:电气技术教育班级学号:电气0611-39学生姓名:周长稳指导教师:路海龙讲师二〇一一年六月天津职业技术师范大学本科生毕业设计基于单片机的智能节能台灯设计ThedesignofIntelligentEnergySavingTableLampBasedonMicrocomputer专业班级:电气0611学生姓名:周长稳指导教师:路海龙讲师学院:自动化与电气工程学院2011年6月摘要单片机渗透到我们生活的各个领域,几乎很难找到哪个领域没有单片机的踪迹,台灯已是千家万户的必需生活用品,当夜晚来临时,人们摸黑去开灯,非常不方便,而当离开时,人们又经常忘记关灯而造成巨大的能源浪费。本文设计制作了一种智能台灯,主要是以红外热释电处理芯片BISS0001和单片机组成的红外传感控制电路。其原理是:以人体红外辐射(波长为9.5um)为传感信号,当人体在台灯的范围内且环境光强较弱时,自动感应开灯,省去黑夜摸灯的麻烦;当人离开台灯传感器检测范围,自动感应关灯。另外当人身体太靠近桌面时,台灯自动感应,蜂鸣器发出警报,警告纠正坐姿,同时灯光控制电路控制灯光变暗,若在一定时间内未离开桌面则自动熄灭,当纠正好坐姿则消除警报,灯光变亮。其特点是自动开关灯,节约能源;且能纠正坐姿,防止近视。本文首先介绍结合了单片机的智能化电器的普遍推广推动了家用小电器台灯的智能化。然后介绍设计中用到的单片机的功能以及传感器的选择。最后进行台灯的硬件设计和软件设计。关键词:Atmega16单片机;热释电红外传感器;智能台灯;节能ABSTRACTSingle-chipmicrocomputerpenetratedintoallareasofourlives,itisverydifficulttofindtheareaofalmostnotracesofsingle-chip.Lampisnecessaryforthousandsofhouseholdslivingsupplies.Wheninthedark,thepeopleisveryinconvenienttoturnonthelights,andtheyoftenforgertoturnedoffthelightswhentheyleft,itisresultinginahugewasteofenergy.Inthispaper,anintelligentdesigntablelamp,MainlypyroelectricinfraredBISS0001chipandsingle-chipprocessorconsistingofinfraredsensorcontrolcircuit.Theprincipleisthatinfraredradiationinthehumanbodyforthesensorcircuit,automaticsensorsturnonthelightswhenthebodyofthescopeofthelampandtheenvironmentwhenaweaklight.Inanotherway,turnoffthelightsbyautomaticsensorwhenpeopleleavethelampsensordetectionrange.Inaddition,whenthebodyistooclosetothedesktop.Thebuzzeralarmtowarningtocorrectposturebythelampautomaticsensor.Inthesametime,lightingcontrolcircuittocontrollightsdimmed.ifwithinacertainperiodoftimenottoleavethedesktopthelightsautomaticallyextinguished,Thelightsbrightenandremovethealarmwhenthecorrectgoodposture.Itisfeaturesisautomaticlightswitch,energyconservation;cancorrectpostureandpreventmyopia.ThispaperfirstintroducestheintelligentcombinationofSCMappliancestopromotethegeneralpromotionofthesmallhouseholdelectricalappliancesintelligentlamp.Andthenusedtointroducesingle-chipdesignfeaturesaswellasthesensorofchoice.Thefinaltableofthehardwaredesignandsoftwaredesign.KeyWords:Atmega16Microcomputer;PIR;IntelligentTablelamp;EnergySavingI目录1引言..............................................................................................................................11.1研究背景.............................................................................................................11.2研究的意义.........................................................................................................21.2.1在节约电能方面的意义...........................................................................21.2.2对使用者的眼睛保护及坐姿的调整.......................................................31.3课题的发展现状.................................................................................................41.3.1单片机的发展现状..........................................................................................41.3.2台灯的发展现状.......................................................................................51.4研究内容.............................................................................................................62AVR单片机的特点及功能简介..................................................................................72.1系统构成框图.....................................................................................................72.2AVR单片机的特点...............................................................................................72.3单片机的串口功能.............................................................................................82.4ATmega16单片机PWM功能...............................................................................93传感器的选择及功能介绍........................................................................................123.1传感器...............................................................................................................123.1.1传感器的定义.........................................................................................123.1.2传感器的分类.........................................................................................123.1.3传感器的静态特性.................................................................................133.1.4传感器的动态特性.................................................................................133.1.5传感器的灵敏度.....................................................................................133.1.6传感器的分辨力.....................................................................................143.1.7传感器的迟滞性.....................................................................................143.2热释电红外传感器...........................................................................................143.2.1概述.........................................................................................................153.2.2热释电红外传感器工作原理.................................................................153.2.3热释电红外传感器的优缺点.................................................................163.2.4热释电红外传感器的抗干扰性能.........................................