CN104317255A - Internet-of-things-based intelligent household control system - Google Patents
Internet-of-things-based intelligent household control system Download PDFInfo
- Publication number
- CN104317255A CN104317255A CN201410331291.2A CN201410331291A CN104317255A CN 104317255 A CN104317255 A CN 104317255A CN 201410331291 A CN201410331291 A CN 201410331291A CN 104317255 A CN104317255 A CN 104317255A
- Authority
- CN
- China
- Prior art keywords
- control
- smart home
- module
- internet
- user
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000004891 communication Methods 0.000 claims abstract description 41
- 230000005540 biological transmission Effects 0.000 claims abstract description 19
- 230000003993 interaction Effects 0.000 claims abstract description 16
- 238000012544 monitoring process Methods 0.000 claims description 10
- 239000004973 liquid crystal related substance Substances 0.000 claims description 6
- 238000011022 operating instruction Methods 0.000 claims description 3
- 230000006870 function Effects 0.000 description 25
- 238000000034 method Methods 0.000 description 19
- 230000008569 process Effects 0.000 description 11
- 239000000872 buffer Substances 0.000 description 9
- 238000012545 processing Methods 0.000 description 9
- 238000013461 design Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 7
- 238000001514 detection method Methods 0.000 description 6
- 230000004044 response Effects 0.000 description 5
- 230000015572 biosynthetic process Effects 0.000 description 4
- 238000011161 development Methods 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000003786 synthesis reaction Methods 0.000 description 3
- 230000003750 conditioning effect Effects 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000033228 biological regulation Effects 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 230000001629 suppression Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/418—Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM]
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B15/00—Systems controlled by a computer
- G05B15/02—Systems controlled by a computer electric
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/26—Pc applications
- G05B2219/2642—Domotique, domestic, home control, automation, smart house
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Manufacturing & Machinery (AREA)
- Quality & Reliability (AREA)
- Selective Calling Equipment (AREA)
Abstract
本发明公开了一种基于物联网的智能家居控制系统,控制系统包括基于RS-485总线的物联网通信模块,负责RS-485总线接入设备和ARM处理器之间的通讯任务;以太网远程控制模块,负责接收用户从互联网发送的控制命令,用户实现对智能家居远程控制;基于GPRS的报警和控制模块,负责接收智能家居中安防报警系统的各种报警信息并发送故障报告到用户的手机;人机交互模块,用于和用户之间进行信息传输;设备接口部分,用于连接各种设备。本发明利用多接口将家中所有电器设备统一联网、集中控制的设想,以及利用一个智能控制终端实现整体控制。
The invention discloses a smart home control system based on the Internet of Things. The control system includes an Internet of Things communication module based on the RS-485 bus, which is responsible for the communication tasks between the RS-485 bus access device and the ARM processor; the Ethernet remote The control module is responsible for receiving the control commands sent by the user from the Internet, and the user realizes remote control of the smart home; the alarm and control module based on GPRS is responsible for receiving various alarm information of the security alarm system in the smart home and sending fault reports to the user's mobile phone ; The human-computer interaction module is used for information transmission between users; the device interface part is used for connecting various devices. The present invention utilizes multi-interfaces to unify and centrally control all electrical equipment in the home, and utilizes an intelligent control terminal to realize overall control.
Description
技术领域technical field
本发明涉及物联网领域,具体涉及一种基于物联网的智能家居控制系统。The invention relates to the field of the Internet of Things, in particular to a smart home control system based on the Internet of Things.
背景技术Background technique
自动化技术和信息技术的发展,推动了智能家居的不断发展。也不断改变人们的工作和生活,人们对生活质量提高需求日渐加大。目前市场上的智能家居控制系统已经有一个比较完整的体系和功能。基于消费者对智能家居的需求,主要功能应包括家用设备控制,智能灯光控制,安防报警,门禁,红外线监控,远程服务。随着智能家居行业的发展,更多的新东西会逐渐成为智能家居控制系统的重要组成部分。智能家居控制系统,改变了人们的生活方式,使人们的生活质量发生了巨大变化,让人们享受了新奇,好玩,时尚的生活。智能家居从人们认识到慢慢接受到需要,未来人们的生活或许离不开智能家居。智能家居控制系统会将不同的家庭智能设备连接在一起,通过各种总线技术,构建成一个功能齐全,安全可靠,聪明绝顶的现代化智能系统。它可以调动人的主观能动性,促进人与生活环境之间的协调,使人们更自由地向往能够控制生活环境。从消费者的角度出发,智能家居控制系统应具备多种类型的家用设备互联的控制功能,各种远程监控系统功能,可靠的系统报警功能以及和谐的互动功能。The development of automation technology and information technology has promoted the continuous development of smart home. It is also constantly changing people's work and life, and people's demand for improving the quality of life is increasing day by day. At present, the smart home control system on the market already has a relatively complete system and functions. Based on consumers' needs for smart homes, the main functions should include household device control, smart lighting control, security alarms, access control, infrared monitoring, and remote services. With the development of the smart home industry, more new things will gradually become an important part of the smart home control system. The smart home control system has changed people's way of life, greatly changed people's quality of life, and allowed people to enjoy a novel, fun and fashionable life. From people's awareness of smart homes to their needs, people's lives in the future may be inseparable from smart homes. The smart home control system will connect different home smart devices together, and build a modern smart system with complete functions, safety, reliability and intelligence through various bus technologies. It can mobilize people's subjective initiative, promote the coordination between people and the living environment, and make people yearn more freely to control the living environment. From the perspective of consumers, the smart home control system should have the control functions of various types of household equipment interconnection, various remote monitoring system functions, reliable system alarm functions and harmonious interaction functions.
智能家居设备互联控制是智能家居控制系统的一个基本特征。在智能家居而言,对家电、电脑、光源控制、互联网和智能设备常常使用分散控制、分散管理等方式,它的明显缺点是,各种家用设备不能联网,用户不能统一控制。在这种情况下,开发出一套具有多电器接口,并将家中所有电器设备统一联网,集中控制的装置具有重要的意义。通过智能控制终端,无论在家里还是外地都可以自由控制各种家用电气设备,不能因为设备的类型多种多样而难以控制。即使家用电器的控制参数是多种多样,也有一些共同的特征。例如,所有设备都有控制开关,这样你就可以使用二进制0和1来表示这两种状态。对于某些设备的齿轮控制,灯光的亮度调节、空调温度控制等这些设备,本文通过添加控制参数,在控制命令添加中控制字段来控制这些设备。因此,对于智能家居的电气控制,控制参数的问题考虑是很重要的。The interconnected control of smart home equipment is a basic feature of the smart home control system. In terms of smart home, decentralized control and decentralized management are often used for home appliances, computers, light source control, Internet and smart devices. Its obvious disadvantage is that various household devices cannot be connected to the Internet, and users cannot control them uniformly. In this case, it is of great significance to develop a set of devices with multi-electrical appliance interfaces, which can unify the networking of all electrical equipment in the home and centrally control them. Through the intelligent control terminal, all kinds of household electrical equipment can be freely controlled whether at home or in other places, and it cannot be difficult to control because of the variety of equipment types. Even though the control parameters of household appliances are diverse, there are some common features. For example, all devices have control switches so that you can use binary 0s and 1s to represent the two states. For the gear control of certain devices, the brightness adjustment of lights, the temperature control of air conditioners, etc., this article controls these devices by adding control parameters and adding control fields in the control command. Therefore, for the electrical control of smart home, it is important to consider the problem of control parameters.
发明内容Contents of the invention
为解决上述问题,本发明提供了一种基于物联网的智能家居控制系统,利用多接口将家中所有电器设备统一联网、集中控制的设想,以及利用一个智能控制终端实现整体控制。In order to solve the above problems, the present invention provides a smart home control system based on the Internet of Things, which utilizes multiple interfaces to unify and centrally control all electrical equipment in the home, and utilizes an intelligent control terminal to realize overall control.
为实现上述目的,本发明采取的技术方案为:In order to achieve the above object, the technical scheme that the present invention takes is:
一种基于物联网的智能家居控制系统,控制系统包括:A smart home control system based on the Internet of Things, the control system includes:
基于RS-485总线的物联网通信模块,负责RS-485总线接入设备和ARM处理器之间的通讯任务;ARM处理器通过检测电路,以确定所述接入设备的生命周期中。同时有序的轮询总线上家用电器的运行状态,通过发送一个查询或控制命令来监视或控制设备的运行。并接收任何一台家用设备的反馈信息。主要的任务分类包括:接入设备检测任务,接受任务总线,总线发送任务。The IoT communication module based on the RS-485 bus is responsible for the communication task between the RS-485 bus access device and the ARM processor; the ARM processor determines the life cycle of the access device through a detection circuit. At the same time, orderly poll the running status of household appliances on the bus, and monitor or control the running of the equipment by sending a query or control command. And receive feedback from any home device. The main task categories include: access device detection tasks, bus reception tasks, and bus transmission tasks.
以太网远程控制模块,负责接收用户从互联网发送的控制命令,用户实现对智能家居远程控制;在使用时,我们必须首先验证用户是否有权限来控制家居系统,如果系统收到了正确的用户控制指令,ARM处理器将通过RS-485总线直接向相应的智能家电发送控制命令进行控制。主要的任务包括以太网数据传输的发送任务和以太网数据接收任务。The Ethernet remote control module is responsible for receiving the control commands sent by the user from the Internet, and the user realizes the remote control of the smart home; when using it, we must first verify whether the user has the authority to control the home system, if the system receives the correct user control command , the ARM processor will directly send control commands to the corresponding smart home appliances through the RS-485 bus for control. The main tasks include sending tasks of Ethernet data transmission and receiving tasks of Ethernet data.
基于GPRS的报警和控制模块,负责接收智能家居中安防报警系统的各种报警信息并发送故障报告到用户的手机;The GPRS-based alarm and control module is responsible for receiving various alarm information from the security alarm system in the smart home and sending fault reports to the user's mobile phone;
此外,用户可以远程查询和控制家居设备的运行状态。其远程控制功能和以太网控制功能相同,当系统接收到用户控制短消息后,ARM处理器将通过RS-485总线直接向相应的智能家电发送控制命令进行控制。主要的任务包括短消息发送任务和短消息接收任务。In addition, users can remotely query and control the running status of home equipment. Its remote control function is the same as the Ethernet control function. When the system receives the user control short message, the ARM processor will directly send control commands to the corresponding smart home appliances for control through the RS-485 bus. The main tasks include short message sending task and short message receiving task.
人机交互模块,用于和用户之间进行信息传输。必须经过人机交互模块作为桥梁才能完成。用户可以设置系统参数,包括工作模式的设置,报警号码的权限设置等等。主要的任务包括液晶屏菜单显示任务、按键处理任务和语音提示任务。The human-computer interaction module is used for information transmission with users. It must pass through the human-computer interaction module as a bridge to complete. Users can set system parameters, including working mode setting, alarm number permission setting and so on. The main tasks include LCD menu display tasks, key processing tasks and voice prompt tasks.
设备接口部分,用于连接各种设备。The device interface part is used to connect various devices.
其中,所述设备接口部分包括:Wherein, the device interface part includes:
常用电器接口,用于连接家用电器;Common electrical interface, used to connect household appliances;
安防设备接口,用于连接安防设备;Security equipment interface, used to connect security equipment;
监控设备接口,用于连接监控设备;Monitoring equipment interface, used to connect monitoring equipment;
其中,所述人机互换部分包括液晶显示屏,用于显示菜单并提示用户信息和操作说明;Wherein, the man-machine interchange part includes a liquid crystal display screen for displaying menus and prompting user information and operation instructions;
接收控制按钮模块,用于控制系统;Receive a control button module for controlling the system;
实时时钟,用于显示准确的时间和作为闹钟使用;Real-time clock for displaying accurate time and as an alarm clock;
存储器,用于保存系统参数和系统状态信息;Memory, used to save system parameters and system status information;
语音提示模块,用于进行语音报警。The voice prompt module is used for voice alarm.
其中,所述系统使用的核心处理器为LPC2378 ARM处理器。Wherein, the core processor that described system uses is LPC2378 ARM processor.
本发明的有益效果如下:利用多接口将家中所有电器设备统一联网、集中控制的设想,以及利用一个智能控制终端实现整体控制。The beneficial effects of the present invention are as follows: use multiple interfaces to unify and centrally control all electrical equipment in the home, and use an intelligent control terminal to realize overall control.
附图说明Description of drawings
图1为本发明实施例基于物联网的智能家居控制系统的框架图。FIG. 1 is a frame diagram of a smart home control system based on the Internet of Things according to an embodiment of the present invention.
图2为本发明实施例基于物联网的智能家居控制系统中LPC237所带外设的汇总图。FIG. 2 is a summary diagram of the peripherals of the LPC237 in the smart home control system based on the Internet of Things according to the embodiment of the present invention.
图3为本发明实施例基于物联网的智能家居控制系统中RS-485网络结构图。FIG. 3 is a structural diagram of the RS-485 network in the smart home control system based on the Internet of Things according to the embodiment of the present invention.
图4为本发明实施例基于物联网的智能家居控制系统中以太网结构图。FIG. 4 is a structural diagram of the Ethernet in the smart home control system based on the Internet of Things according to the embodiment of the present invention.
图5为本发明实施例基于物联网的智能家居控制系统中MAX232芯片接口原理图。FIG. 5 is a schematic diagram of the interface of the MAX232 chip in the smart home control system based on the Internet of Things according to the embodiment of the present invention.
图6为本发明实施例基于物联网的智能家居控制系统中人机交互部分结构图。Fig. 6 is a structural diagram of the human-computer interaction part in the smart home control system based on the Internet of Things according to the embodiment of the present invention.
图7为本发明实施例基于物联网的智能家居控制系统中主机轮询从机的工作流程。Fig. 7 is a workflow of the master polling the slave in the smart home control system based on the Internet of Things according to the embodiment of the present invention.
图8为本发明实施例基于物联网的智能家居控制系统中从机应答的工作流程图。Fig. 8 is a working flowchart of slave machine response in the smart home control system based on the Internet of Things according to the embodiment of the present invention.
图9为本发明实施例基于物联网的智能家居控制系统中DP83848I接收数据的流程图。FIG. 9 is a flow chart of receiving data by DP83848I in the smart home control system based on the Internet of Things according to the embodiment of the present invention.
图10为本发明实施例基于物联网的智能家居控制系统中DP83848I发送数据的流程图。Fig. 10 is a flow chart of sending data by DP83848I in the smart home control system based on the Internet of Things according to the embodiment of the present invention.
图11为本发明实施例基于物联网的智能家居控制系统中GPRS报警控制模块的短消息任务工作流程图。FIG. 11 is a flow chart of the short message task of the GPRS alarm control module in the smart home control system based on the Internet of Things according to the embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的及优点更加清楚明白,以下结合实施例对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the objects and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the examples. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.
如图1所示,本发明实施例提供了一种基于物联网的智能家居控制系统,控制系统包括As shown in Figure 1, the embodiment of the present invention provides a smart home control system based on the Internet of Things, the control system includes
基于RS-485总线的物联网通信模块,负责RS-485总线接入设备和ARM处理器之间的通讯任务;ARM处理器通过检测电路,以确定所述接入设备的生命周期中。同时有序的轮询总线上家用电器的运行状态,通过发送一个查询或控制命令来监视或控制设备的运行。并接收任何一台家用设备的反馈信息。主要的任务分类包括:接入设备检测任务,接受任务总线,总线发送任务。The IoT communication module based on the RS-485 bus is responsible for the communication task between the RS-485 bus access device and the ARM processor; the ARM processor determines the life cycle of the access device through a detection circuit. At the same time, orderly poll the running status of household appliances on the bus, and monitor or control the running of the equipment by sending a query or control command. And receive feedback from any home device. The main task categories include: access device detection tasks, bus reception tasks, and bus transmission tasks.
以太网远程控制模块,负责接收用户从互联网发送的控制命令,用户实现对智能家居远程控制;在使用时,我们必须首先验证用户是否有权限来控制家居系统,如果系统收到了正确的用户控制指令,ARM处理器将通过RS-485总线直接向相应的智能家电发送控制命令进行控制。主要的任务包括以太网数据传输的发送任务和以太网数据接收任务。The Ethernet remote control module is responsible for receiving the control commands sent by the user from the Internet, and the user realizes the remote control of the smart home; when using it, we must first verify whether the user has the authority to control the home system, if the system receives the correct user control command , the ARM processor will directly send control commands to the corresponding smart home appliances through the RS-485 bus for control. The main tasks include sending tasks of Ethernet data transmission and receiving tasks of Ethernet data.
基于GPRS的报警和控制模块,负责接收智能家居中安防报警系统的各种报警信息并发送故障报告到用户的手机;The GPRS-based alarm and control module is responsible for receiving various alarm information from the security alarm system in the smart home and sending fault reports to the user's mobile phone;
此外,用户可以远程查询和控制家居设备的运行状态。其远程控制功能和以太网控制功能相同,当系统接收到用户控制短消息后,ARM处理器将通过RS-485总线直接向相应的智能家电发送控制命令进行控制。主要的任务包括短消息发送任务和短消息接收任务。In addition, users can remotely query and control the running status of home equipment. Its remote control function is the same as the Ethernet control function. When the system receives the user control short message, the ARM processor will directly send control commands to the corresponding smart home appliances for control through the RS-485 bus. The main tasks include short message sending task and short message receiving task.
人机交互模块,用于和用户之间进行信息传输。The human-computer interaction module is used for information transmission with users.
必须经过人机交互模块作为桥梁才能完成。用户可以设置系统参数,包括工作模式的设置,报警号码的权限设置等等。主要的任务包括液晶屏菜单显示任务、按键处理任务和语音提示任务。It must pass through the human-computer interaction module as a bridge to complete. Users can set system parameters, including working mode setting, alarm number permission setting and so on. The main tasks include LCD menu display tasks, key processing tasks and voice prompt tasks.
所述设备接口部分包括:The device interface part includes:
常用电器接口,用于连接家用电器;Common electrical interface, used to connect household appliances;
安防设备接口,用于连接安防设备;Security equipment interface, used to connect security equipment;
监控设备接口,用于连接监控设备;Monitoring equipment interface, used to connect monitoring equipment;
如图6所示,所述人机互换部分包括液晶显示屏,用于显示菜单并提示用户信息和操作说明;As shown in Figure 6, the human-machine interchangeable part includes a liquid crystal display for displaying menus and prompting user information and operating instructions;
接收控制按钮模块,用于控制系统;Receive a control button module for controlling the system;
实时时钟,用于显示准确的时间和作为闹钟使用;Real-time clock for displaying accurate time and as an alarm clock;
存储器,用于保存系统参数和系统状态信息;Memory, used to save system parameters and system status information;
语音提示模块,用于进行语音报警。The voice prompt module is used for voice alarm.
其中,人机交互模块,作为控制系统设计的一个重要组成部分,人机交互是负责提供友好的交互界面和功能,使人和机器和谐相处的部分,通过良好的人机交互界面设计,可以增加用户依赖性。人机交互终端作为智能家居控制系统的组成部分,是一个人和设备进行信息交互的平台,智能控制系统通过它和用户之间进行信息传输。其硬件组件应该包括液晶显示屏,信息控制按钮,实时时钟,信息存储器,状态指示灯,语音提示。通过智能键查询、设备状态显示和语音提示实现智能系统和用户的交流。如图6所示为人机交互部分的结构采用DS1302芯片作为实时时钟芯片,DS1302芯片是美国DALLAS公司推出一个的高性能、低功耗的实时时钟。带RAM数据存储,可以设置日期和时间。DS1302芯片接口电路简单,价格便宜,使用方便,易于操作。实时时钟模块能够显示准确的时间,用户可以设置闹钟功能。Among them, the human-computer interaction module is an important part of the control system design. The human-computer interaction is responsible for providing a friendly interactive interface and functions to make people and machines live in harmony. Through a good human-computer interaction interface design, it can increase user dependency. As an integral part of the smart home control system, the human-computer interaction terminal is a platform for information interaction between people and equipment, through which the intelligent control system transmits information with users. Its hardware components should include LCD display, information control buttons, real-time clock, information storage, status indicator lights, and voice prompts. Realize the communication between the intelligent system and the user through intelligent key query, device status display and voice prompt. As shown in Figure 6, the structure of the human-computer interaction part uses the DS1302 chip as the real-time clock chip. The DS1302 chip is a high-performance, low-power real-time clock launched by DALLAS Corporation of the United States. With RAM data storage, date and time can be set. DS1302 chip interface circuit is simple, cheap, easy to use and easy to operate. The real-time clock module can display accurate time, and the user can set the alarm clock function.
内存模块是一种非易失性外部存储器模块,用于保存系统参数和系统状态信息,如用户设置的报警中心号码。系统采用FM24C64A串行电可擦除只读存储器(EEPROM),该模块可串联具有高扩展性,被广泛用于低电压和低功耗的领域。The memory module is a non-volatile external memory module used to save system parameters and system status information, such as the alarm center number set by the user. The system uses FM24C64A serial electrically erasable read-only memory (EEPROM). This module can be connected in series with high scalability and is widely used in the fields of low voltage and low power consumption.
接收控制按键模块是人机交互设计的重要输入接口部分,用户可以通过键盘控制系统。系统设置了16个按键,其中包括数字0-9,菜单(功能)键,确定键和四个方向键。The receiving control button module is an important input interface part of the human-computer interaction design, and the user can control the system through the keyboard. The system is provided with 16 keys, including numbers 0-9, menu (function) key, confirmation key and four direction keys.
液晶显示屏和菜单显示处理的人机交互设计的主要部分,用于显示菜单并提示用户信息和操作说明。液晶显示屏为用户提供了极大的方便,用户可以随时了解每个家用电器运行状态,以及当前出现的故障信息。用户可以通过设置菜单功能,实施供全方位的监控和控制操作。因此菜单显示以及相应的信息处理模块也是需要工作量最大的模块。本系统采用的液晶显示屏是OCM1264,自带中英文字库,方便的软件开发。通过按键操作,用户可以设置系统,检查和控制各种家用电器。The main part of the human-computer interaction design of the liquid crystal display and menu display processing is used to display the menu and prompt the user for information and operating instructions. The liquid crystal display provides great convenience for the user, and the user can know the operating status of each household appliance at any time, as well as the current fault information. Users can implement a full range of monitoring and control operations by setting menu functions. Therefore, the menu display and the corresponding information processing module are also the modules that require the most workload. The liquid crystal display used in this system is OCM1264, with its own Chinese and English fonts, which is convenient for software development. Through key operation, users can set the system, check and control various household appliances.
该模块系统与用户直接进行通信的通道。通过控制系统的设置功能,对家居环境变量进行设置,系统就会提供相应的背景音乐。如果在家里的危险情况时,语音提示报警模块。同时控制系统调用远程报警系统来通知用户,用户根据报警信息进行相应处理。系统采用的是HMA-TTS语音合成模块,该模块是一种模块化的产品,是在嵌入式系统中移植国语音合成软件SMA-TTS。体积小巧、合成音质好、功耗很低、易于使用,无需外部辅助电路。加上电源和扬声器就可以通过UART串口控制使用。也可以按照用户的需要对合成控制接口进行定制,以满足智能家居应用对语音合成要求。The channel through which the module system communicates directly with the user. Through the setting function of the control system, the home environment variables are set, and the system will provide corresponding background music. If there is a dangerous situation at home, the voice prompts the alarm module. At the same time, the control system calls the remote alarm system to notify the user, and the user performs corresponding processing according to the alarm information. The system adopts the HMA-TTS speech synthesis module, which is a modular product and is transplanted into the embedded system of the Chinese speech synthesis software SMA-TTS. Small size, good synthetic sound quality, low power consumption, easy to use, no external auxiliary circuits. It can be controlled by UART serial port with power supply and speaker. The synthesis control interface can also be customized according to the user's needs to meet the requirements of smart home applications for speech synthesis.
如图2所示,所述系统使用的核心处理器为LPC2378 ARM处理器。飞利浦生产的LPC2378 ARM处理器是一个合适的选择,性价比很高的LPC2378,具有丰富的接口,非常适合网络协议转换,并且具备多设备接口的应用程序。它是基于32位实时仿真ARM7TDMI-S内核结构,并拥有高速嵌入式的512KB闪存和58KB的SRAM,具有在系统编程(ISP)和应用编程(IAP)的能力。芯片有4个UART,3个I2C,3个SPI/SSP等串行接口,带DMA的10/100M以太网MAC接口,超过104通用IO接口。As shown in Figure 2, the core processor used by the system is the LPC2378 ARM processor. The LPC2378 ARM processor produced by Philips is a suitable choice. The cost-effective LPC2378 has rich interfaces and is very suitable for network protocol conversion and applications with multiple device interfaces. It is based on 32-bit real-time simulation ARM7TDMI-S core structure, and has high-speed embedded 512KB flash memory and 58KB SRAM, with in-system programming (ISP) and application programming (IAP) capabilities. The chip has 4 UARTs, 3 I2Cs, 3 SPI/SSP serial interfaces, 10/100M Ethernet MAC interface with DMA, and more than 104 general-purpose IO interfaces.
如图3所示,RS-485总线的电气特性是多点差分数据传输,通信接口允许多点双向通信于简单的一对双绞线上,它具有噪声抑制,高数据传输速率和可靠数据传输等特性。相对简单的硬件接口,在总线上家用设备同时只有一个处于发送状态,而其他设备则处于接收状态下。在由多个单片机组合的串行通讯网络中,使用主从式体系结构:从机器只能被动地发送命令或数据,当需要主动发送数据和命令时,由主机来控制。As shown in Figure 3, the electrical characteristic of the RS-485 bus is multi-point differential data transmission, the communication interface allows multi-point two-way communication on a simple pair of twisted pairs, it has noise suppression, high data transmission rate and reliable data transmission and other characteristics. Relatively simple hardware interface, only one of the household devices on the bus is in the sending state at the same time, while the other devices are in the receiving state. In a serial communication network composed of multiple single-chip microcomputers, a master-slave architecture is used: the slave machine can only send commands or data passively, and when it needs to actively send data and commands, it is controlled by the host computer.
本文设计的RS-485总线接口部分,是直接与嵌入式处理器的串行端口0相连接,并且通过TXD RXD两个引脚,以及一个电平转换器实现通信的。在并行传输模式下,RS-485传输线上需要连接终结电阻。采用两种不同的接线方式时,可以实现不同的功能。如果采用四条线的接线方法,只能实现一对多的数据通信。而使用两条线的接线方式,就能达到多点的双向通信。本文中的嵌入式处理器就是主设备,而其他接入的家居设备说是从设备。The RS-485 bus interface part designed in this paper is directly connected to the serial port 0 of the embedded processor, and communicates through two pins of TXD RXD and a level shifter. In parallel transmission mode, a termination resistor needs to be connected to the RS-485 transmission line. Different functions can be realized when two different wiring methods are used. If the wiring method of four lines is adopted, only one-to-many data communication can be realized. And use the two-wire wiring method to achieve multi-point two-way communication. The embedded processor in this article is the master device, while other connected home devices are said to be slave devices.
如果家居设备需要接入RS-485网络时,必须通过微控制器、检测电路和电流调理电路来实现。微控制器的一个引脚和RS-485的输出相连,通过对这个引脚电平的跳变进行检测,决定智能电器接入状态的改变。信号调理电路的功能,是隔离智能电器的输出电平和总线中的电信号。使用SN75176芯片可将单片机中的串行接口转变成RS-485接口,这样就可以实现各个接入家居电器和嵌入式开发板的串口通信。If household equipment needs to be connected to the RS-485 network, it must be realized through a microcontroller, a detection circuit and a current conditioning circuit. A pin of the microcontroller is connected to the output of RS-485, and the change of the access state of the smart electrical appliance is determined by detecting the jump of the pin level. The function of the signal conditioning circuit is to isolate the output level of the smart appliance and the electrical signal in the bus. Using the SN75176 chip can convert the serial interface in the single-chip microcomputer into an RS-485 interface, so that the serial communication of various access household appliances and embedded development boards can be realized.
本发明系统使用ARM处理器LPC2378中带DMA的10/100M以太网模块,大大提高了数据包的发送和接收速率,提高了系统发送和接收数据的实时性,减少了微处理器的工作量。ARM处理器中以太网模块的RMI接口芯片与以太网PHY芯片(DP83848I)连接。The system of the invention uses the 10/100M Ethernet module with DMA in the ARM processor LPC2378, which greatly improves the sending and receiving rate of data packets, improves the real-time performance of sending and receiving data by the system, and reduces the workload of the microprocessor. The RMI interface chip of the Ethernet module in the ARM processor is connected with the Ethernet PHY chip (DP83848I).
如图4所示,以太网模块的框图,由以下几部分组成:As shown in Figure 4, the block diagram of the Ethernet module consists of the following parts:
主机寄存器模块。用于设置以太网工作模式,可以通过读取状态寄存器,可以了解以太网工作状况。Host register module. It is used to set the Ethernet working mode, and the working status of the Ethernet can be understood by reading the status register.
总线接口是连接AHB总线和以太网DMA的接口。使模块能及时的读取SRAM,来实现读、写描述符,以及收发数据的缓冲区。The bus interface is an interface connecting the AHB bus and the Ethernet DMA. The module can read SRAM in time to realize reading and writing descriptors, as well as buffers for sending and receiving data.
DMA发送和接收数据。负责数据缓冲区和数据总线的信息传输。发送DMA管理器是把传输数据传输状态和描述符写入到存储器;模块可以重新发送该数据和处理异常终止,并且控制数据的发送。接收管理器的功能是负责检测信息,同时对特定的数据帧进行过滤,并存储有效数据。DMA sends and receives data. Responsible for the information transmission of the data buffer and the data bus. The sending DMA manager writes the transfer status and descriptor of the transfer data into the memory; the module can resend the data and handle abnormal termination, and control the sending of data. The function of the receiving manager is to detect information, filter specific data frames, and store valid data.
RMII负责与DP83848进行实时数据传输。RMII is responsible for real-time data transmission with DP83848.
基于GPRS的远程报警网络设计的目的,主要是提高智能家居控制系统的安全性,因此,远程报警需要具有高实时性和高可靠性。The purpose of the GPRS-based remote alarm network design is mainly to improve the security of the smart home control system. Therefore, the remote alarm needs to have high real-time and high reliability.
远程报警网络分为三个部分:现场采集终端,监控中心和GPRS服务中心。现场采集终端包括RS-485总线上连接的家用电器,以及各种传感器(例如温度传感器,湿度传感器等),实时将家庭安全信息数据采集并及时的传送到监控中心。监控中心将所接收的数据进行处理并分析是否报警和故障信息。如果收到一个工作不正常的状态数据,远程报警系统通过GPRS服务中心发送报警信息给用户,保证用户财产安全。The remote alarm network is divided into three parts: on-site collection terminal, monitoring center and GPRS service center. On-site collection terminals include household appliances connected to the RS-485 bus, and various sensors (such as temperature sensors, humidity sensors, etc.), which collect and transmit family safety information data to the monitoring center in real time. The monitoring center processes the received data and analyzes whether there are alarms and fault information. If a status data that is not working properly is received, the remote alarm system will send an alarm message to the user through the GPRS service center to ensure the safety of the user's property.
系统GPRS模块采用SIMCOM公司生产的SIM300CZ模块。SIM300CZ模块可以在三频/四频GSM/GPRS设备工作,提供超过10级多时隙和级4编码能力。它结构紧凑,双列直插式板对板连接器,结构紧凑,能满足各种工业应用对模块尺寸的苛刻要求;内嵌功能强大的TCP/IP协议栈,功耗低;使用增强型AT命令集的通信协议,实现语言,短消息,GPRS数据的高速传输。远程报警网络和RS-485总线网络结合设计起到远程报警和控制的功能。The system GPRS module adopts the SIM300CZ module produced by SIMCOM Company. SIM300CZ module can work in tri-band/quad-band GSM/GPRS equipment, providing more than 10 levels of multi-slot and level 4 encoding capabilities. It is compact in structure, dual-in-line board-to-board connector, compact in structure, and can meet the strict requirements of various industrial applications on module size; embedded with powerful TCP/IP protocol stack, low power consumption; using enhanced AT The communication protocol of the command set realizes the high-speed transmission of language, short message and GPRS data. The combination of remote alarm network and RS-485 bus network is designed to function as remote alarm and control.
本文GPRS的远程报警控制部分的关键是:①采用嵌入式系统来发实现送和接收短消息的功能;②现场采集终端采集异常信号进行理性分析处理,当检测到异常信息,诸如发现火情应该立即打开自动灭火装置;③摄像头捕捉图像信息通过串行端口发送给无线通信模块,然后通过GPRS发送给用户。The key points of the remote alarm control part of GPRS in this paper are: ①Use the embedded system to send and receive short messages; Immediately turn on the automatic fire extinguishing device; ③ The image information captured by the camera is sent to the wireless communication module through the serial port, and then sent to the user through GPRS.
如图5所示,控制系统和串行通信模块。通过使用继电器,对家用电气设备进行打开和关闭操作。该设备的控制终端必须由ARM控制器的I/O引脚直接控制。连接到ARM处理器的SIM300通信模块需要进行电平转换。而MAX232是最常用的电平转换芯片。As shown in Figure 5, the control system and serial communication module. By using relays, household electrical equipment is turned on and off. The control terminal of the device must be directly controlled by the I/O pins of the ARM controller. The SIM300 communication module connected to the ARM processor requires level shifting. The MAX232 is the most commonly used level conversion chip.
家居设备的即插即用通信协议Plug and Play Communication Protocol for Home Appliances
按照统一设备编号UDS对智能家电进行编码,UDS长度3个字节,不同智能家电具有不同的电气设备号。系统家庭网络设备地址分为2个字节,即网络设备ID。第一个字节代表一级地址,其中的2个位用于区分设备的种类;第二字节代表二级地址。为了方便访问控制终端能够对每个设备进行查询和控制,将每个电器和控制终端连接。控制终端为每台设备以自动方式或者手动方式分配物联网的ID,从而使每一个家居设备都有一个唯一的编号,实现远程访问该设备的目的。编码方法是:当一个新的装置连接的智能控制终端,为保留的家庭网络设备地址分配统一的设备序列号,这样就可以实现物联网设备ID与设备序列号UDS的转换。考虑到家庭网络的一级地址保留位是bit2到bit7,可以将二级地址用来表示家用电器的编号,通过一级地址编码可以区分设备类型。UDS结构定义:bit0-bit7表示设备编号,bit8-bit20表示厂商号,bit21-bit23表示版本号。The smart home appliances are coded according to the unified device number UDS. The length of the UDS is 3 bytes. Different smart home appliances have different electrical device numbers. The system home network device address is divided into 2 bytes, namely the network device ID. The first byte represents the first-level address, and the 2 bits are used to distinguish the type of device; the second byte represents the second-level address. In order to facilitate the access control terminal to query and control each device, each electrical appliance is connected to the control terminal. The control terminal assigns the ID of the Internet of Things to each device automatically or manually, so that each home device has a unique number to achieve the purpose of remote access to the device. The encoding method is: when a new device is connected to the intelligent control terminal, assign a unified device serial number to the reserved home network device address, so that the conversion between the IoT device ID and the device serial number UDS can be realized. Considering that the reserved bits of the first-level address of the home network are bit2 to bit7, the second-level address can be used to indicate the serial number of the household appliance, and the device type can be distinguished through the first-level address code. UDS structure definition: bit0-bit7 indicates the device number, bit8-bit20 indicates the manufacturer number, and bit21-bit23 indicates the version number.
RS-485总线主从机通信协议RS-485 bus master-slave communication protocol
总线中主从机通信的数据帧格式是这样定义的,数据帧组成包括帧头、设备地址、命令(功能)、数据长度、数据、校验和帧尾等字段。其格式为帧头占1个字节、设备地址占1个字节、命令(功能)占1个字节、数据长度占1个字节、数据占N个字节、校验和帧尾各占1个字节。The data frame format of the master-slave communication in the bus is defined in this way. The data frame consists of fields such as frame header, device address, command (function), data length, data, checksum and frame tail. The format is 1 byte for the frame header, 1 byte for the device address, 1 byte for the command (function), 1 byte for the data length, N bytes for the data, and 1 byte for the checksum and the end of the frame. Occupies 1 byte.
系统采用可靠的连接方式。主机每一次询问从机时,都要使用“握手”机制。主机先向从机发送握手信号,如果从机在线,则从机向主机回发应答信号。从而在主机和从机之间建立起可靠的连接,然后就可以安全地交换数据。交换数据结束后,再依次询问下一个从机。只有当主机询问某从机时,该从机才给予应答。这种机制可以避免没有次序的数据通信对整个总线网络数据传输的扰乱The system adopts a reliable connection method. Every time the master asks a slave, it uses a "handshake" mechanism. The master first sends a handshake signal to the slave, and if the slave is online, the slave sends a response signal back to the master. Thereby a reliable connection is established between the master and the slave, and data can then be exchanged securely. After exchanging data, ask the next slave in turn. Only when the master asks a slave, the slave will give a reply. This mechanism can avoid the disruption of the data transmission of the entire bus network caused by out-of-order data communication
主机发送给从机的数据帧的帧格式如下:The frame format of the data frame sent by the master to the slave is as follows:
从机回复给主机的数据帧的帧格式如下:The frame format of the data frame that the slave replies to the master is as follows:
由主机发送给从机的数据帧,根据用途主要分为以下两种类型:The data frame sent by the master to the slave is mainly divided into the following two types according to the purpose:
查询类型:主机通过发送此类型的数据帧,检测从机是否在线。从机如果在线,主机就能够获取到从机目前的运行参数。Query type: The master detects whether the slave is online by sending this type of data frame. If the slave is online, the host can obtain the current operating parameters of the slave.
控制类型:主机通过发送此类型的数据帧,可以家用电器进行档位的设定,控制该家用电器的开关。如表3.1所示主机发送给从机的数据帧中,包括查询型数据帧和控制型数据帧。与此同时,当主机向从机发送命令帧时,从机如果在线,从机需要给出应答。如表3.2所示从机回复给主机的数据帧的内容。Control type: By sending this type of data frame, the host can set the gear position of the household appliance and control the switch of the household appliance. As shown in Table 3.1, the data frames sent by the master to the slave include query data frames and control data frames. At the same time, when the master sends a command frame to the slave, if the slave is online, the slave needs to give a response. As shown in Table 3.2, the content of the data frame that the slave replies to the master.
表3.1主机发送给从机的数据帧Table 3.1 Data frame sent by master to slave
表3.2从机回复给主机的数据帧Table 3.2 The data frame that the slave replies to the master
在GPRS报警和控制任务的设计中用到了GPRS的短消息服务功能,进行文本和数字信息的传送。设计的关键是在嵌入式系统中如何实现短消息的发送和接收,关于短消息的编辑过程详细表述如下。In the design of GPRS alarm and control tasks, the short message service function of GPRS is used to transmit text and digital information. The key to the design is how to realize the sending and receiving of short messages in the embedded system. The editing process of short messages is described in detail as follows.
根据短消息的内容,将短消息分为基于PDU格式的中文短消息和非中文短消息。基于PDU格式的中文短消息其内容包含汉字。对于没有汉字内容的非中文短消息,需要使用纯英文短消息的编码。GPRS模块集成了AT命令集,通过控制AT命令集实现模块参数设置,实现了ARM处理器和无线模块之间的通信。在嵌入式系统中使用短消息功能,需要了解的消息的格式。According to the content of the short message, the short message is divided into a Chinese short message and a non-Chinese short message based on the PDU format. The content of Chinese short messages based on PDU format contains Chinese characters. For non-Chinese short messages without Chinese character content, it is necessary to use the encoding of pure English short messages. The GPRS module integrates the AT command set, and realizes the module parameter setting by controlling the AT command set, and realizes the communication between the ARM processor and the wireless module. To use the short message function in an embedded system, you need to know the format of the message.
(1)ARM处理器与GPRS模块的通信协议(1) Communication protocol between ARM processor and GPRS module
发送短消息的字符串格式包括:SCA、PDUType、MR、DA、PID、DCS、VP、UDL和UD。短消息接收的字符串格式包括:SCA、PDUType、OA、PID、DCS、SCTS、UDL和UD。SCA是一个短消息服务中心地址,包括短消息服务中心地址字节长度为len,类型1字节的短消息中心,和11的短消息服务中心地址字节地址。长度是短消息服务中心地址(91)+(683108200505f0)的长度,甚至位数的电话号码的短缺在回填土的“F”,然后翻转奇偶校验位的数目;在短消息中心地址的类型,91是最用的,在号码前加上“+”符号。pdutype是PDU的类型,占一个字节。他是信息参考,在正常情况下是00。DA是收件人的地址,Oa发件人地址,它们的格式与短消息服务中心地址SCA相同。对短消息的标准的情况下,PID签署协议,简单的PID00。DCS是一个短消息内容的数据编码方案。分为7位编码,8位编码和USC2编码的短消息内容编码。半在英语(非中文短消息)短信息7bit编码,和中文短消息内容需要USC2编码。VP是有效的信息。交易时间戳服务中心,占地七多组。UDL用户数据的长度,数量通常表示的短消息内容进行编码后的字符串。The character string formats for sending short messages include: SCA, PDUType, MR, DA, PID, DCS, VP, UDL and UD. The character string formats for receiving short messages include: SCA, PDUType, OA, PID, DCS, SCTS, UDL and UD. SCA is a short message service center address, including short message service center address byte length len, type 1 byte short message center, and 11 short message service center address byte address. The length is the length of the short message service center address (91)+(683108200505f0), even if the number of digits of the phone number is short of "F" in the backfill, and then flip the number of parity bits; in the type of short message center address, 91 is the most used, add a "+" sign before the number. pdutype is the type of PDU, occupying one byte. He is an information reference, which is 00 under normal circumstances. DA is the recipient's address, Oa is the sender's address, and their format is the same as the short message service center address SCA. For the standard case of short messages, the PID signing agreement is simply PID00. DCS is a data coding scheme for short message content. Divided into 7-bit code, 8-bit code and USC2 coded short message content code. Semi-English (non-Chinese short message) short message 7bit encoding, and Chinese short message content requires USC2 encoding. VP is valid information. The transaction timestamp service center covers an area of more than seven groups. The length of UDL user data, the number usually represents the encoded string of the content of the short message.
基于PDU模式的中文短消息发送与接收。在USC2编码标准中,中文汉字的编码占用2个字节,因此在中英文混合的短消息的编码时,需要使用基于PDU模式的短消息编码方式。下面具体说明短消息的中文编码过程。Send and receive Chinese short messages based on PDU mode. In the USC2 encoding standard, the encoding of Chinese characters occupies 2 bytes, so when encoding short messages mixed with Chinese and English, it is necessary to use the short message encoding method based on PDU mode. The Chinese encoding process of the short message will be described in detail below.
发送短消息的内容由用户定义,例如内容为“智能家居”,短消息中心地址号码是事先在系统中设置的,假设是8613843155031,对方号码假设是8613543421121。具体的编码过程如表3.3所示。The content of sending a short message is defined by the user, for example, the content is "smart home", the address number of the short message center is set in the system in advance, assuming it is 8613843155031, and the other party's number is assumed to be 8613543421121. The specific encoding process is shown in Table 3.3.
表3.3短消息内容的编辑过程Table 3.3 Editing process of short message content
因此,消息的编码后的内容,并结合PDU串应该是:08 00 08 66 7A 80 FD5B B6 5C 45 08 91 68 31 08 11 00 0D 91 68 5129 22 50 20 02 05 F0 92F2 00。按照PDU编码的规定,UCS2编码采用的是16个字节的编码。在本文中的嵌入式系统没有UCS2编码的API函数,它只能通过查表法获得。将要发送的短消息的内容预先编码,将编辑好的编码串存放在系统内存中。Therefore, the encoded content of the message, combined with the PDU string should be: 08 00 08 66 7A 80 FD5B B6 5C 45 08 91 68 31 08 11 00 0D 91 68 5129 22 50 20 02 05 F0 92F2 00. According to the regulations of PDU encoding, UCS2 encoding adopts 16-byte encoding. The embedded system in this article does not have the API function of UCS2 code, it can only be obtained by the look-up table method. The content of the short message to be sent is pre-coded, and the edited coded string is stored in the system memory.
对于短消息的接收和短消息发送与短消息内容的编码类似。The receiving and sending of the short message is similar to the encoding of the content of the short message.
以下是常用的AT命令:The following are commonly used AT commands:
AT+CMGF设置短消息息的格式,0设置为PDU格式,1设置为TEXT格式AT+CMGF set the format of the short message, 0 is set to PDU format, 1 is set to TEXT format
AT+CSCA设置短消息息的服务中心号码AT+CSCA Set the service center number of the short message
AT+CNMI将新短消息息显示到TE终端AT+CNMI will display the new short message to the TE terminal
AT+CMGL查询模块中的短消息AT+CMGL query the short message in the module
AT+CMGR读取指定编号的短消息AT+CMGR read the short message of the specified number
AT+CMGD删除指定编号的短消息AT+CMGD delete the short message with the specified number
AT+CMGS发送短消息AT+CMGS send short message
AT+CSQ获取信号强度AT+CSQ to get signal strength
(2)智能家居控制系统和用户的通信协议(2) Communication protocol between smart home control system and users
智能家居控制系统和用户的通信需要有相应有通信协议才能实现彼此通信,因此需求在用户和系统之间制定相应的短消息通信协议。The communication between the smart home control system and the user needs a corresponding communication protocol to achieve mutual communication, so it is necessary to formulate a corresponding short message communication protocol between the user and the system.
本文中制定的短消息通信协议根据短消息内容分为三类短消息:报警类短消息、查询类短消息和控制类短消息。The short message communication protocol formulated in this paper is divided into three types of short messages according to the content of short messages: alarm short messages, query short messages and control short messages.
报警类短消息是由智能家居控制终端发向特定用户的短消息,该用户的手机号码需要事先授权,保存在系统的外部存储器中。当智能家居控制系统检测到某个家居设备出现故障或者家庭出现险情,会立刻向用户发送具体的报警信息。报警类短消息的格式如表3.4所示。The alarm short message is a short message sent by the smart home control terminal to a specific user. The user's mobile phone number needs to be authorized in advance and stored in the external memory of the system. When the smart home control system detects that a certain home device fails or the family is in danger, it will immediately send specific alarm information to the user. The format of alarm short messages is shown in Table 3.4.
表3.4报警类短消息Table 3.4 Alarm short message
查询类短消息是由已授权的用户直接向智能家居控制终端发送的,用来查询智能家居中特定电器运行状态是否正常,并能够获取该电器的运行参数。查询类短消息的格式如表3.5所示。Query short messages are sent directly to the smart home control terminal by authorized users, and are used to check whether the operating status of a specific electrical appliance in the smart home is normal, and to obtain the operating parameters of the electrical appliance. The format of query short messages is shown in Table 3.5.
表3.5查询类短消息Table 3.5 Query Short Messages
控制类短消息是实现用户对智能设备的远程控制,包括设置特定智能电器的运行档位和控制该电器的运行状态。控制类短消息的格式如表3.6所示。The control short message is to realize the remote control of the smart device by the user, including setting the operating gear of a specific smart electrical appliance and controlling the operating status of the electrical appliance. The format of control short messages is shown in Table 3.6.
表3.6控制类短消息Table 3.6 Control short messages
需要注意的是,系统收到用户信息,首先要判断该用户号码是否已经授权,如果用户号码没有权限,则系统将该信息删除,以防止垃圾信息的骚扰。It should be noted that when the system receives user information, it must first determine whether the user number has been authorized. If the user number is not authorized, the system will delete the information to prevent spam harassment.
RS-485总线程序设计RS-485 bus program design
主机(嵌入式微处理器)轮询RS-485总线上接入的每个智能设备是否都在正常运转,检测电路确定哪个设备ID是处于联机状态,然后得到一个访问智能设备缓冲区Address[255],如果地址线3为智能设备,则该缓冲器的地址[3]设定为1,设备地址所有值为0的表示智能设备被移除。主机始终处于轮询从机,实时检测各从机的工作状态。当系统接收用户的查询或控制命令时,主机建立与从机握手机制,然后发送一个查询或控制命令给从机并进行处理。主机发送给从机的命令,不会循环等从机的答复。如果连续三次得不到从的的答复,则系统认为该设备已被移除,同时修改该设备的缓冲器中的对应值。如果总线通讯被禁用,则主机停止轮询工作。主机轮询从机的工作流程如图8所示。The host (embedded microprocessor) polls whether each smart device connected to the RS-485 bus is in normal operation, and the detection circuit determines which device ID is in the online state, and then obtains an access smart device buffer Address[255] , if the address line 3 is a smart device, the address [3] of the buffer is set to 1, and all values of the device address are 0, indicating that the smart device is removed. The master is always polling the slaves to detect the working status of each slave in real time. When the system receives an inquiry or control command from the user, the host establishes a handshake mechanism with the slave, and then sends an inquiry or control command to the slave for processing. The command sent by the master to the slave will not wait for the reply from the slave in a loop. If no reply from the slave is obtained for three consecutive times, the system considers that the device has been removed, and modifies the corresponding value in the buffer of the device at the same time. If bus communication is disabled, the master stops polling. The workflow of the host polling the slave is shown in Figure 8.
从机(每个接入的智能家电)始终处于数据接收状态,当接收到主机命令帧,首先确定命令帧是否数据正确,正确则与主机建立握手机制。同时分析该帧是控制命令还是查询命令。如果是控制指令,那么从机将反馈指令执行后的信息。如果查询指令,从机发送在线答复。从机应答的工作流程如图9所示。The slave (each connected smart home appliance) is always in the data receiving state. When receiving the command frame from the host, it first determines whether the data in the command frame is correct, and then establishes a handshake mechanism with the host if it is correct. At the same time, analyze whether the frame is a control command or a query command. If it is a control command, then the slave will feedback the information after the command is executed. If the query command, the slave sends an online reply. The workflow of the slave response is shown in Figure 9.
以太网远程监控程序设计Ethernet Remote Monitoring Program Design
该系统采用以太网的智能家居网络监控设备,以太网模块与ARM处理器相连,处理器做以太网服务器。为了实现智能家居控制终端可自动将查询结果和控制结果反馈给用户,接收用户远程的查询请求和控制命令,需要对以太网模块进行程序设计,主要包括以太网控制器的初始化,发送和接收数据的操作。The system uses Ethernet smart home network monitoring equipment, the Ethernet module is connected to the ARM processor, and the processor is used as the Ethernet server. In order to realize that the smart home control terminal can automatically feed back the query results and control results to the user, and receive the user's remote query request and control command, it is necessary to program the Ethernet module, mainly including the initialization of the Ethernet controller, sending and receiving data operation.
(1)初始化dp83848i以太网模块(1) Initialize the dp83848i Ethernet module
主要工作是初始化以太网模块复位,PHY和MAC的初始化、数据的发送和接收。The main work is to initialize the reset of the Ethernet module, the initialization of PHY and MAC, and the sending and receiving of data.
(2)微处理器通过以太网模块接收用户数据(2) The microprocessor receives user data through the Ethernet module
嵌入式ARM微处理器通过I/O端口4,以及以太网通信模块实现对数据的交换。接收微处理器数据自动存储在接收缓冲器中rx_databuffer,程序分析读入缓冲区中的数据,了解用户指令的类型,然后做出相应的处理。The embedded ARM microprocessor realizes the data exchange through the I/O port 4 and the Ethernet communication module. The receiving microprocessor data is automatically stored in the receiving buffer rx_databuffer, and the program analyzes the data read into the buffer, understands the type of user instruction, and then makes corresponding processing.
(3)通过以太网模块微处器将答复数据发送给用户(3) Send the response data to the user through the Ethernet module microprocessor
向用户发送数据,和接收用户数据类似,以太网模块将数据帧打包成数据包的形式存储在发送缓冲区TX_DataBuffer,然后使用命令寄存器发送数据包。发送成功后,通过检测状态寄存器状态的相应位来判断数据包是否是准确。如果该数据包传输失败,系统应该重新发送数据包。与此同时,系统应该能够检测到传输信道是否被禁用,使用命令寄存器中的TxEnable位置设启用传输通道。DP83848I接收数据的流程如图10所示。Sending data to the user is similar to receiving user data. The Ethernet module packs the data frame into a data packet and stores it in the sending buffer TX_DataBuffer, and then uses the command register to send the data packet. After sending successfully, judge whether the data packet is accurate or not by detecting the corresponding bit of the status register status. If the packet fails, the system should resend the packet. At the same time, the system should be able to detect if the transmit channel is disabled, enable the transmit channel using the TxEnable bit setting in the command register. The process of receiving data by DP83848I is shown in Figure 10.
DP83848I发送数据时,首先检测是否发送描述符数组已满,如果不满,将等发数据写入到发送描述符指向的发送缓冲区并设置传输描述符的控制字更新RxProduceIndex,通过设置控制寄存器中TxEnable位启动DMA开始发送数据包。I当数据发送完毕,触发中断;如果数据传输失败,则程序执行重发操作。如果数据连续三次发送仍然在未能发送,数据包被丢弃通并知系统发送失败,并要求系统复位以太网模块。DP83848I发送数据的流程如图10所示。When DP83848I sends data, it first checks whether the sending descriptor array is full, if not, writes the data to be sent to the sending buffer pointed to by the sending descriptor and sets the control word of the sending descriptor to update RxProduceIndex, by setting the TxEnable in the control register bit enables DMA to start sending packets. I When the data transmission is completed, an interrupt is triggered; if the data transmission fails, the program executes the retransmission operation. If the data has not been sent for three consecutive times, the data packet will be discarded and the system will be notified of the failure to send, and the system will be required to reset the Ethernet module. The process of sending data by DP83848I is shown in Figure 10.
GPRS短消息程序设计GPRS Short Message Program Design
GPRS模块集成了AT命令集,通过控制AT命令集来实现模块参数设置,实现了ARM处理器和无线模块之间的通信。在GPRS远程数据通信的过程中,主要是通过串口通信,使用UART1串口间接实现用户短消息和智能家居控制系统处理中心的通信。达到对智能家居设备“直接”控制的目的。在嵌入式系统中,短消息发送过程是:通过AT命令AT+CMGF=0设置无线通信模块为PDU模式下的工作模式,用CMGS命令发送短消息指令到GPRS无线通信模块,需要将结合串总字节数卸载CMGS命令后的,等待GPRS模块相应的信息“>”表示无线模块正在等待用户发送用户组合串(用户内容经过编码后的数据串),短消息最后发送终结的命令是使用十六进制的“0x1A”,来通知无线通信模块将短消息发送出去。The GPRS module integrates the AT command set, and realizes the module parameter setting by controlling the AT command set, and realizes the communication between the ARM processor and the wireless module. In the process of GPRS remote data communication, it is mainly through the serial port communication, using the UART1 serial port to indirectly realize the communication between the user's short message and the processing center of the smart home control system. To achieve the purpose of "direct" control of smart home devices. In the embedded system, the short message sending process is: set the wireless communication module as the working mode under the PDU mode through the AT command AT+CMGF=0, and use the CMGS command to send the short message command to the GPRS wireless communication module. Number of bytes After unloading the CMGS command, wait for the corresponding information of the GPRS module ">" indicates that the wireless module is waiting for the user to send the user combination string (the data string after the user content is encoded), and the final command to send the short message is to use sixteen Hexadecimal "0x1A" to notify the wireless communication module to send the short message.
短消息的接收过程:通过UART1中断来完成接收短消息,只要嵌入式微处理器串口检测到接收字符串信息,可以进入串口中断。通过字符串“+CMTI:"SM",N”的匹配来确定一个新的消息的到达。其中N代表新短消息到达的编号。通过指令CMGR读取指定编号短消息,如果SIM卡上有这条短消息,GPRS模块将返回此短消息的详细息到串行端口1。由于GPRS无线模块信号缘故或数据通信忙,也可能收到很多短消息。此时,可以通过CMGL指令列出未读短消息,让智能家居控制系统处理这些短消息。但GPRS无线模块的信箱毕竟有限,需要定期删除短消息。因此,读取并处理完这条短消息后,可以使用CMGD指令删除这条短消息。GPRS报警控制模块的短消息任务工作流程如图11所示。The receiving process of the short message: complete receiving the short message through the UART1 interrupt, as long as the embedded microprocessor serial port detects the received string information, it can enter the serial port interrupt. The arrival of a new message is determined by matching the string "+CMTI:"SM",N". Wherein N represents the number of arrival of the new short message. Read the short message with the specified number by command CMGR, if there is this short message on the SIM card, the GPRS module will return the detailed information of this short message to serial port 1. Due to the signal of the GPRS wireless module or the busy data communication, many short messages may also be received. At this time, the unread short messages can be listed through the CMGL command, so that the smart home control system can process these short messages. However, the mailbox of the GPRS wireless module is limited after all, and short messages need to be deleted regularly. Therefore, after reading and processing this short message, you can use the CMGD command to delete this short message. The short message task workflow of the GPRS alarm control module is shown in Figure 11.
外部中断External Interrupt
智能家居控制系统的外部中断是嵌入式系统外部设备发出的中断请求,系统中主要是按键中断。用户通过外部中断处理,实现对系统参数设置和环境模式的设置。本文中的控制系统是先去除按键的抖动,再检测I/O管脚电平的高低变化来判断的。当检测到外部按键中断信号时,智能家居控制系统就执行外部中断服务程序,响应用户的按键处理。并通知LcdRsk任务和RS-485任务来分别进行改变菜单和控制智能设备。The external interrupt of the smart home control system is the interrupt request sent by the external device of the embedded system, and the key interrupt is mainly in the system. The user realizes the setting of system parameters and environment mode through external interrupt processing. The control system in this article judges by removing the jitter of the key first, and then detecting the level change of the I/O pin. When the external key interrupt signal is detected, the smart home control system executes the external interrupt service program and responds to the user's key processing. And notify the LcdRsk task and the RS-485 task to change the menu and control the smart device respectively.
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention, it should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, and these improvements and modifications should also be It is regarded as the protection scope of the present invention.
Claims (4)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410331291.2A CN104317255A (en) | 2014-07-06 | 2014-07-06 | Internet-of-things-based intelligent household control system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410331291.2A CN104317255A (en) | 2014-07-06 | 2014-07-06 | Internet-of-things-based intelligent household control system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104317255A true CN104317255A (en) | 2015-01-28 |
Family
ID=52372498
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410331291.2A Pending CN104317255A (en) | 2014-07-06 | 2014-07-06 | Internet-of-things-based intelligent household control system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104317255A (en) |
Cited By (23)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104808500A (en) * | 2015-03-31 | 2015-07-29 | 小米科技有限责任公司 | Task setting method and device |
CN104994169A (en) * | 2015-07-14 | 2015-10-21 | 上海智臻网络科技有限公司 | Floor-sweeping robot state information query method and server |
CN105589337A (en) * | 2016-03-10 | 2016-05-18 | 山东钢铁股份有限公司 | Automatic control system of smart home |
CN105824243A (en) * | 2016-03-14 | 2016-08-03 | 成都爆米花信息技术有限公司 | Man-machine interaction device of intelligent household |
CN105843055A (en) * | 2016-03-24 | 2016-08-10 | 苏州路之遥科技股份有限公司 | Communication method of smart home system |
CN106060787A (en) * | 2016-05-16 | 2016-10-26 | 北京奇虎科技有限公司 | A method, device and equipment for sending information |
CN106292342A (en) * | 2015-05-15 | 2017-01-04 | 北京四维拓智教育科技有限公司 | Processor, external device, control system and hot-plug method thereof |
WO2017015894A1 (en) * | 2015-07-29 | 2017-02-02 | 王铭 | Mobile phone-controlled smart home system having monitoring function |
CN107436557A (en) * | 2016-05-25 | 2017-12-05 | 杨玲 | Intelligence control system |
CN107678303A (en) * | 2017-11-28 | 2018-02-09 | 广东瑞安杰智能科技有限公司 | A kind of intelligent domestic system based on electric automatization |
CN107817692A (en) * | 2017-11-30 | 2018-03-20 | 宁波高新区锦众信息科技有限公司 | A kind of intelligent home control system shown with images of gestures |
CN108549254A (en) * | 2018-06-25 | 2018-09-18 | 广州市锐尚展柜制作有限公司 | A kind of smart-interactive terminal for smart home |
CN109361562A (en) * | 2018-10-31 | 2019-02-19 | 广东电网有限责任公司信息中心 | A kind of automated testing method based on the access of related network equipment |
CN109407524A (en) * | 2017-08-17 | 2019-03-01 | 深圳市中兴微电子技术有限公司 | A kind of smart home system management method, device and computer readable storage medium |
CN109782698A (en) * | 2017-11-13 | 2019-05-21 | 惠州学院 | A kind of smart home system |
CN109976181A (en) * | 2019-04-22 | 2019-07-05 | 湖南德熠智能科技有限公司 | A kind of household appliance controlling system based on technology of Internet of things |
CN110233784A (en) * | 2019-06-18 | 2019-09-13 | 上海杉科科技有限公司 | A kind of intelligent home control system and method |
CN110850132A (en) * | 2019-12-19 | 2020-02-28 | 协成科技股份有限公司 | Electric power metering device based on wireless communication |
CN112565737A (en) * | 2020-12-01 | 2021-03-26 | 黑龙江建筑职业技术学院 | Three-dimensional display networking control method |
CN113391559A (en) * | 2021-06-30 | 2021-09-14 | 青岛海信智慧生活科技股份有限公司 | Smart home equipment control method and terminal equipment |
CN113534675A (en) * | 2021-07-30 | 2021-10-22 | 广东睿住智能科技有限公司 | Control method, control device, home system and storage medium |
CN115052026A (en) * | 2022-06-17 | 2022-09-13 | 杭州腾泰智能设备有限公司 | Intelligent control system for common-frequency variable code remote control and network remote interconnection mutual control |
US12228903B2 (en) | 2017-01-20 | 2025-02-18 | Huawei Technologies Co., Ltd. | Value-added service implementation method and apparatus, and cloud server |
-
2014
- 2014-07-06 CN CN201410331291.2A patent/CN104317255A/en active Pending
Non-Patent Citations (1)
Title |
---|
滕峻林,等: "智能家居控制系统设计", 《电子技术与软件工程》 * |
Cited By (27)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104808500A (en) * | 2015-03-31 | 2015-07-29 | 小米科技有限责任公司 | Task setting method and device |
CN106292342B (en) * | 2015-05-15 | 2018-11-02 | 北京四维拓智教育科技有限公司 | Processor, external device, control system and its hot-plug method |
CN106292342A (en) * | 2015-05-15 | 2017-01-04 | 北京四维拓智教育科技有限公司 | Processor, external device, control system and hot-plug method thereof |
CN104994169A (en) * | 2015-07-14 | 2015-10-21 | 上海智臻网络科技有限公司 | Floor-sweeping robot state information query method and server |
WO2017015894A1 (en) * | 2015-07-29 | 2017-02-02 | 王铭 | Mobile phone-controlled smart home system having monitoring function |
CN105589337A (en) * | 2016-03-10 | 2016-05-18 | 山东钢铁股份有限公司 | Automatic control system of smart home |
CN105824243A (en) * | 2016-03-14 | 2016-08-03 | 成都爆米花信息技术有限公司 | Man-machine interaction device of intelligent household |
CN105843055A (en) * | 2016-03-24 | 2016-08-10 | 苏州路之遥科技股份有限公司 | Communication method of smart home system |
CN106060787A (en) * | 2016-05-16 | 2016-10-26 | 北京奇虎科技有限公司 | A method, device and equipment for sending information |
CN107436557A (en) * | 2016-05-25 | 2017-12-05 | 杨玲 | Intelligence control system |
US12228903B2 (en) | 2017-01-20 | 2025-02-18 | Huawei Technologies Co., Ltd. | Value-added service implementation method and apparatus, and cloud server |
CN109407524A (en) * | 2017-08-17 | 2019-03-01 | 深圳市中兴微电子技术有限公司 | A kind of smart home system management method, device and computer readable storage medium |
CN109782698A (en) * | 2017-11-13 | 2019-05-21 | 惠州学院 | A kind of smart home system |
CN107678303A (en) * | 2017-11-28 | 2018-02-09 | 广东瑞安杰智能科技有限公司 | A kind of intelligent domestic system based on electric automatization |
CN107817692A (en) * | 2017-11-30 | 2018-03-20 | 宁波高新区锦众信息科技有限公司 | A kind of intelligent home control system shown with images of gestures |
CN108549254A (en) * | 2018-06-25 | 2018-09-18 | 广州市锐尚展柜制作有限公司 | A kind of smart-interactive terminal for smart home |
CN109361562A (en) * | 2018-10-31 | 2019-02-19 | 广东电网有限责任公司信息中心 | A kind of automated testing method based on the access of related network equipment |
CN109976181A (en) * | 2019-04-22 | 2019-07-05 | 湖南德熠智能科技有限公司 | A kind of household appliance controlling system based on technology of Internet of things |
CN110233784A (en) * | 2019-06-18 | 2019-09-13 | 上海杉科科技有限公司 | A kind of intelligent home control system and method |
CN110850132A (en) * | 2019-12-19 | 2020-02-28 | 协成科技股份有限公司 | Electric power metering device based on wireless communication |
CN112565737B (en) * | 2020-12-01 | 2024-01-30 | 黑龙江建筑职业技术学院 | Networking control method for three-dimensional display |
CN112565737A (en) * | 2020-12-01 | 2021-03-26 | 黑龙江建筑职业技术学院 | Three-dimensional display networking control method |
CN113391559A (en) * | 2021-06-30 | 2021-09-14 | 青岛海信智慧生活科技股份有限公司 | Smart home equipment control method and terminal equipment |
CN113534675A (en) * | 2021-07-30 | 2021-10-22 | 广东睿住智能科技有限公司 | Control method, control device, home system and storage medium |
CN113534675B (en) * | 2021-07-30 | 2024-06-11 | 广东睿住智能科技有限公司 | Control method, control device, home system and storage medium |
CN115052026A (en) * | 2022-06-17 | 2022-09-13 | 杭州腾泰智能设备有限公司 | Intelligent control system for common-frequency variable code remote control and network remote interconnection mutual control |
CN115052026B (en) * | 2022-06-17 | 2024-05-28 | 杭州腾泰智能科技有限公司 | Intelligent control system for same-frequency variable code remote control and network remote interconnection mutual control |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104317255A (en) | Internet-of-things-based intelligent household control system | |
CN102183928B (en) | Method, device and intelligent household appliance controller for controlling running mode of household appliance | |
CN101951333B (en) | Digital home intelligent terminal control system | |
CN105353715A (en) | Realization method of logic control of VB/VC (Microsoft Visual Basic 6.0/Microsoft Visual C++) and PLC (Programmable Logic Controller) on the basis of serial communication | |
CN103973643A (en) | Intelligent protocol converter | |
CN102427417A (en) | System and method for remotely controlling access equipment of Internet of things | |
CN108933716A (en) | Cloud interactive gateway, communication means and smart home system based on OpenWrt | |
CN103095703A (en) | Method and equipment and system for achieving data interaction between network and serial port | |
CN108449246A (en) | A kind of intelligent domestic system based on instant message applications Yu Internet of Things Network Communication | |
CN114039808A (en) | CAN-based multi-channel CAN/LIN/SENT forwarding protocol | |
CN104932373A (en) | Intelligent industrial network protocol wireless converter | |
CN110515662A (en) | Long-range control method, system, equipment and the readable storage medium storing program for executing of dual-system device | |
CN201689338U (en) | BACnet field controller with Modbus communication interface | |
CN202975723U (en) | Household intelligent controller and remote household control system | |
CN100423518C (en) | Embedded Home Gateway Based on Consumer Bus | |
CN202488501U (en) | Electric energy information network system for remote management | |
CN2930126Y (en) | An Embedded Home Gateway Based on Consumer Bus | |
CN108156182A (en) | A kind of communication adapter board, communication forwarding method and communication adapting system | |
WO2021098714A1 (en) | Power distribution terminal having display module, and wireless power distribution display system and method | |
CN204215239U (en) | A kind of novel Smart Home all-in-one | |
CN114488871A (en) | Control method, frequency converter and computer readable storage medium | |
CN210899158U (en) | Chip-based WiFi module with keys | |
CN202406127U (en) | Remote control system for access device of Internet of Things | |
CN205545383U (en) | Intelligent household appliance remote control system | |
CN108965072B (en) | Intelligent gateway external equipment association control method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20150128 |
|
RJ01 | Rejection of invention patent application after publication |