基于STM32单片机的智能家居系统的设计
无需注册登录,支付后按照提示操作即可获取该资料.
基于STM32单片机的智能家居系统的设计(论文17000字)
摘要
随着新世纪社会的信息化和家庭生活的智能化,对多种资源进行集中控制显得越来越重要,因此本论文提出了基于STM32单片机智能家居控制器的设计及应用。智能家居概念的引入,使得家用电器集中集控器的发展进入了全新的阶段。集控器采用综合布线的方式,可以对民用住宅、宾馆客房、写字楼、等多电器场所的所有电器进行集中控制。可控对象有灯光开关、空调、音响的开关以及某些电器的定时开启或关闭等等。本论文采用STM32单片机作为核心设计一个有触摸屏、时钟、传感器、蓝牙模块和控制总线的智能家居系统,包括上位机与下位机二部分,下位机即为控制模块与被控电器,上位机为手机蓝牙控制系统并通过手机蓝牙通讯程序发送命令给单片机。STM32单片机作为处理核心会对上位机发送的数据进行解码判断然后实现相应的动作,如密码正确则开门锁以及报警等功能。单片机还将对传感器模块传来的数据进行计算判断,在对相应的受控电器进行控制,如灯光亮度根据外界光强自动变化,触摸屏模块的触摸位置判断与信息传递。在本设计的基础上添加或完善程序及硬件设计后,便可实现家电(如空调、热水器等)控制、照明控制、室内外遥控、窗帘自控、防盗报警、定时控制及电话远程控制、计算机控制等,也就是说将系统连接到互联网,并通过计算机进行远程控制。
关键词:智能家居STM32触摸屏传感器UC/GUI UC/OS
Design of smart home system based on STM32 MCU
Abstract
With the intelligent new century the development of information society and family life, a variety of resources for centralized control becomes more and more important, so this paper puts forward the design and application of intelligent STM32 controller based on Home Furnishing. The introduction of smart Home Furnishing concept, make the household appliance development in CIMC controller into a new stage. Set control the comprehensive wiring, for residential, hotel rooms, office buildings, all electrical appliances and other electrical appliances places for centralized control. The controllable object with a light switch, air conditioning, audio switch and some electric timing to open or close and so on. This paper is the core of a touch screen, clock, using the sensor design STM32 microcontroller, intelligent control system Home Furnishing Bluetooth module and bus, including PC and the two part, the lower machine is the control module and the controlled electric appliance, computer Machine for mobile phone Bluetooth PC control system. As the processing core of the host computer to send data to decode and make the corresponding action to the.STM32 microcontroller through the Bluetooth mobile phone to send commands, such as the correct password to open the door lock or alarm. The MCU will also be on the sensor module to calculate the data of judgment, the controlled electric appliance control, such as the brightness of the light automatically according to the change of light intensity, touch and transmission of information to determine the location of the touch screen module. Add or improve the procedures and hardware design based on the design of the post, we can realize the household appliances (such as air conditioning, water heater) control, lighting control, indoor remote control curtain automatic control, anti-theft alarm, timing control and telephone remote control, computer control and so on, in another word, it means to connect the system to the Internet and control it with the internet.
Key Words: Smart Home;STM32;Touch Screen;Sensor;UC/GUI;UC/OS-II
目录
摘 要 I
Abstract II
第一章 引 言 1
1.1 设计简介 1
1.2 设计内容 1
1.3 论文结构 2
第二章 方案论证 4
2.1 总体方案介绍 4
2.2 主控芯片选择 4
2.3 触屏模块选择 5
第三章 硬件设计 6
3.1 系统原理框图设计 6
3.1.1 STM32主控模块 6
3.1.2 触摸显示屏模块 6
3.1.3 蓝牙模块 7
3.1.4 传感器模块 7
3.2 系统主要元器件介绍 7
3.2.1主控芯片STM32F103VET6 7
3.2.2 ILI9325显示控制芯片 8
3.2.3 XPT2046触摸控制芯片 10
3.2.4 热释电红外感应模块(HC-SR501) 10
3.2.6超声波模块 11
3.2.7 蓝牙模块 11
3.3 接口电路设计 11
3.3.1 STM32最小系统设计 12
3.3.2触摸屏模块 13
3.3.3 红外模块(HC-SR501) 13
3.3.4 超声波模块 14
3.3.5 光强模块(BH1750FVI) 14
3.3.6 蓝牙模块 15
第四章 软件设计 16
4.1主程序算法流程分析 16
4.2 系统初始化及使用流程分析 17
4.2.1 UC/OS-Ⅱ实时操作系统 17
4.2.2 UC/GUI嵌入式用户图像界面系统 20
4.3 子程序算法流程分析 20
4.3.1 模块初始化子程序设计 20
4.3.2 键位显示子程序及触摸程序设计 21
4.2.5 蓝牙通讯模块子程序设计 22
4.2.6 超声波模块子程序设计 24
4.2.7 光强模块子程序设计 25
4.3 软件设计小结 26
第五章 系统调试 27
5.1程序生成与系统调试 27
5.2 系统制作与实物测试 29
5.3 调试中的问题与解决方法 31
5.4 调试结果 32
总 结 35
参考文献 36
致 谢 39