(学院)基于51单片机蓝牙控制照明系统

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

摘要随着社会的发展人们对生活质量的要求越来越高,照明在能耗中所占的比例日益增加,因而照明节能也日显重要。现在国内外普及使用的节能开关基本有声控型、触摸型、感光型等。这几种开关各有自己的弊端,如声控型不适合环境嘈杂场所、感光型开关在无人期间不能自动关闭。单片微型计算机简称单片机,是典型的嵌入式微控制器(MicrocontrollerUnit),常用英文字母的缩写MCU表示单片机,单片机又称单片微控制器,它不是完成某一个逻辑功能的芯片,而是把一个计算机系统集成到一个芯片上。单片机由运算器,控制器,存储器,输入输出设备构成,相当于一个微型的计算机(最小系统)。和计算机相比,单片机缺少了外围设备等。概括地讲:一块芯片就成了一台计算机。它体积小、质量轻、价格便宜、为学习、应用和开发提供了便利条件。同时,学习使用单片机是了解计算机原理与结构的最佳选择。单片机在工业控制领域广泛应用。单片机由仅有CPU的专用处理器芯片发展而来。最早的设计理念是通过将大量外围设备和CPU集成在一个芯片中,使计算机系统更小,更容易集成到复杂的对体积要求严格的控制设备当中。本文利用所学51单片机基础知识结合自动控制技术和蓝牙2.0通信技术设计完成一套无线遥控家电开关系统。本设计详细地讲述了51单片机控制原理和单片机编程技术,HC-06蓝牙通信技术以及自动化控制技术。整个系统以STC89C52单片机为核心,单片机实现HC-06蓝牙指令的解析与继电器开关控制指令的发出。蓝牙通信单元采用工业级的HC-06蓝牙模块来完成,蓝牙模块在整个系统中负责蓝牙指令的接收和传输;家电开关的自动控制部分采用4路继电器开关来实现,继电器开关是典型的弱电信号控制型照明系统开关。关键词:单片机、蓝牙、照明系统AbstractWiththedevelopmentofsociety,people'squalityoflifeisbecomingmoreandmoredemanding,andtheproportionoflightingintheenergyconsumptionisincreasing.Nowthepopularityofenergy-savingswitchathomeandabroad,thebasicuseofvoicecontrol,touchtype,sensitivetype,etc..Theseswitcheshavetheirowndrawbacks,suchasvoicetypeisnotsuitablefornoisyenvironment,photosensitiveswitchcannotbeautomaticallyshutdownduringtheunmanned.Asthesinglechipcomputerisatypicalembeddedmicrocontroller(MicrocontrollerUnit),usuallyabbreviatedasMCUEnglishletterssingle-chipmicrocontrolleralsoknownassingle-chipmicrocontroller,itisnotthecompletionofalogicfunctionofthechip,butacomputersystemintegratedintoachip.Thesinglechipmicrocomputeriscomposedofanarithmeticdevice,acontroller,amemory,aninputandoutputdevice,whichisequivalenttoamicrocomputer.Comparedwiththecomputer,SCM,suchasthelackofperipherals.Generallyspeaking:achipisacomputer.Theutilitymodelhastheadvantagesofsmallsize,lightweight,lowcostandconvenientconditionsforlearning,applicationanddevelopment.Atthesametime,learningtousetheMCUistounderstandtheprincipleandstructureofthecomputerthebestchoice.SCMiswidelyusedinthefieldofindustrialcontrol.SinglechipprocessordevelopedbyonlyCPUdedicatedchip.ThefirstideaistointegratealargenumberofperipheralsandCPUinasinglechip,sothatthecomputersystemissmaller,moreeasilyintegratedintothecomplexrequirementsofthecontrolofthevolumeofequipment.Inthispaper,wedesignasetofwirelessremotecontrolswitchsystembasedonthe51basicknowledgeofMCUandthetechnologyofBluetoothand2.Thisdesigndescribesindetailthe51single-chipmicrocomputercontrolprincipleandsingle-chipprogrammingtechnology,HC-06Bluetoothcommunicationtechnologyandautomationcontroltechnology.ThewholesystemisbasedonSTC89C52singlechipmicrocomputer,andtheanalysisoftheHC-06Bluetoothcommandandthecontroloftherelayswitchcontrolinstructions.BluetoothcommunicationunitusingHC-06Bluetoothmoduletocompletetheindustriallevel,theBluetoothmoduleisresponsibleforBluetoothinstructioninthewholesystemofreceivingandtransmission;automaticcontrolapplianceswitchusing4wayrelayswitchtoachievetherelayswitchcontrolisatypicaltypeofweakcurrentsignallightingsystemswitch.Keywords:MCU,Bluetooth,lightingsystem摘要........................................................................1Abstract.....................................................................11绪论.......................................................................41.1课题研究的背景.......................................................41.2课题的研究意义.......................................................52体统的总体设计.............................................................62.1选择单片机...........................................................62.2蓝牙设备.............................................................72.3检测光照.............................................................82.4继电器...............................................................83硬件的设计.................................................................93.1系统硬件概述.........................................................93.2CPU的介绍...........................................................93.3主接线图设计........................................................103.4蓝牙通信模块设计....................................................104软件系统设计..............................................................114.1系统流程设计........................................................114.2程序仿真............................................................124.2.1keil简介...................................................125系统测试..................................................................155.1蓝牙通信模块测试....................................................155.2单片机最小电路测试..................................................16总结.......................................................................16参考文献....................................................................18致谢.......................................................................191绪论随着国民经济的快速发展和社会进步,教育在全社会愈加被关注和重视,校园规模也随着受教育者的数量增加而不断扩大,教室的数量也大幅度增加。为使师生有舒适的教学和学习的环境,无论是教室的面积、设施和照度,校方在力所能及的范围内,都付出了十分的努力。但由于学校开放型的管理模式,以及全员的节能意识的淡薄,高校的教室在白天室内照度很高的情况下,仍然普遍存在开灯作业;即使室内无人或人数很少的情况下,也是全部开启室内照明。夜间许多教室,即使仅有几个学生在教室自习,但室内照明全部开启,绝不会有师生因为只有少数人而仅开几盏灯。长明灯比比皆是,人走不熄灯的现象到处存在。这种有形和无形的浪费,给校方的水电支出带来了沉重的负担。学校的水电支出约占全校经费支出的1/4—1/5,电费支出占据

1 / 19
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功