CN110784536A - Wireless light control method based on ZigBee - Google Patents
Wireless light control method based on ZigBee Download PDFInfo
- Publication number
- CN110784536A CN110784536A CN201911024266.9A CN201911024266A CN110784536A CN 110784536 A CN110784536 A CN 110784536A CN 201911024266 A CN201911024266 A CN 201911024266A CN 110784536 A CN110784536 A CN 110784536A
- Authority
- CN
- China
- Prior art keywords
- coordinator
- network
- zigbee
- control
- system platform
- 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
- 238000000034 method Methods 0.000 title claims abstract description 25
- 238000004891 communication Methods 0.000 claims abstract description 9
- 230000005540 biological transmission Effects 0.000 claims abstract description 7
- 241000282414 Homo sapiens Species 0.000 claims description 19
- 238000013461 design Methods 0.000 claims description 7
- 230000006855 networking Effects 0.000 claims description 5
- 238000012544 monitoring process Methods 0.000 claims description 4
- 238000007781 pre-processing Methods 0.000 claims description 3
- 230000007613 environmental effect Effects 0.000 abstract 1
- 238000005516 engineering process Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 3
- 238000010276 construction Methods 0.000 description 2
- 238000013480 data collection Methods 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
- H04L67/125—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/70—Services for machine-to-machine communication [M2M] or machine type communication [MTC]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W84/00—Network topologies
- H04W84/18—Self-organising networks, e.g. ad-hoc networks or sensor networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Circuit Arrangement For Electric Light Sources In General (AREA)
Abstract
本发明公开的一种基于ZigBee的无线灯光控制方法,运用ZigBee射频通信协议、串口助手、服务器(PC机),实现了以串口助手为手动控制端,以控制系统平台上的传感器为自动控制端,以ZigBee无线网络为传输介质,以CC2530作为控制中心。通过串口将串口助手与ZigBee网络中的协调器连接起来,串口助手接收用户操作信息,并通过串口将数据发送到协调器,协调器收到数据后通过无线发送方式将数据发送到控制系统平台,并根据数据控制电灯电路;或者通过控制系统平台上的传感器采集到环境信息,并通过无线发送方式将数据发送到协调器,协调器收到数据后通过无线发送方式将数据发送到控制系统平台,并根据数据控制电灯电路。
A ZigBee-based wireless lighting control method disclosed by the invention uses the ZigBee radio frequency communication protocol, serial port assistant and server (PC) to realize that the serial port assistant is used as the manual control terminal, and the sensor on the control system platform is used as the automatic control terminal. , using ZigBee wireless network as the transmission medium and CC2530 as the control center. The serial assistant is connected with the coordinator in the ZigBee network through the serial port. The serial assistant receives the user operation information, and sends the data to the coordinator through the serial port. After the coordinator receives the data, it sends the data to the control system platform by wireless transmission. And control the light circuit according to the data; or collect environmental information through the sensors on the control system platform, and send the data to the coordinator through wireless transmission. After the coordinator receives the data, it sends the data to the control system platform through wireless transmission. And control the light circuit according to the data.
Description
技术领域technical field
本发明属于人工智能技术领域,涉及一种基于ZigBee的无线灯光控制方法。The invention belongs to the technical field of artificial intelligence, and relates to a ZigBee-based wireless lighting control method.
背景技术Background technique
物联网技术的发展将人类带入了“智能”生活,尤其家庭物联网应用已经成为各国物联网企业全力抢占的制高点。目前,常用的灯光控制大多为传统的手动机械开关、红外遥控开关以及声光控开关,但如今人们对灯光产品的要求已经不仅仅局限于照明,更多是便捷的操作,多样的控制方式和强烈的视觉感受。显然,传统的灯光控制存在布线发杂、安全性低、浪费资源等多个缺点,已经不能满足现代化的控制需求。智能照明系统结合传统的灯光,结合ZigBee无线技术,传感器应用技术,和先进的制造工艺,实现智能远程控制,极大满足人们对照明的需求以及很好地节约资源。The development of the Internet of Things technology has brought human beings into a "smart" life, especially the application of the Internet of Things in the home has become the commanding heights of the Internet of Things enterprises in various countries. At present, most of the commonly used lighting controls are traditional manual mechanical switches, infrared remote control switches and acousto-optic switches, but now people's requirements for lighting products are not only limited to lighting, but more convenient operation, various control methods and Strong visual experience. Obviously, the traditional lighting control has many shortcomings such as complicated wiring, low safety, waste of resources, etc., and can no longer meet the needs of modern control. The intelligent lighting system combines traditional lighting, ZigBee wireless technology, sensor application technology, and advanced manufacturing technology to realize intelligent remote control, which greatly meets people's needs for lighting and saves resources.
发明内容SUMMARY OF THE INVENTION
本发明的目的是提供一种基于ZigBee的无线灯光控制方法,该方法基于ZigBee无线技术实现远程手动控制灯光的工作状态,以及通过对人体和光强的检测实现自动控制灯工作状态;以减少电缆的铺设面积和降低布线的复杂程度,避免了因红外发射造成的开关误触。The object of the present invention is to provide a wireless lighting control method based on ZigBee, which realizes remote manual control of the working state of lighting based on ZigBee wireless technology, and realizes automatic control of the working state of lights by detecting the human body and light intensity; to reduce cables The laying area and the complexity of the wiring are reduced, and the switch accident caused by infrared emission is avoided.
本发明所采用的技术方案是,一种基于ZigBee的无线灯光控制方法,具体包括如下步骤:The technical solution adopted in the present invention is a ZigBee-based wireless lighting control method, which specifically includes the following steps:
步骤1,ZigBee组网;Step 1, ZigBee networking;
ZigBee的组网过程主要包含:协调器硬件搭建、网络设备初始化、建立一个新网络;协调器是网络中第一个设备,网络的建立,初始化,确定网络的个域标识符和物理信道,给其他节点分配独一无二的网络短地址。The networking process of ZigBee mainly includes: coordinator hardware construction, network device initialization, and establishment of a new network; the coordinator is the first device in the network, the establishment and initialization of the network, the determination of the individual domain identifier and physical channel of the network, and the Other nodes are assigned unique network short addresses.
步骤2,控制系统平台硬件设计;Step 2, the hardware design of the control system platform;
控制系统平台中采用主控芯片CC2530负责控制系统平台或者是路由节点数据的采集、预处理、发送以及接收相关命令;控制本节点相关输出设备、人体红外传感器、光敏传感器、继电器、照明灯及无线信号接收器;The main control chip CC2530 is used in the control system platform to be responsible for the control system platform or routing node data collection, preprocessing, sending and receiving related commands; control the node's related output devices, human infrared sensors, photosensitive sensors, relays, lighting and wireless. signal receiver;
步骤3,利用步骤1和步骤2所得结构进行灯光控制。
本发明的特点还在于,The present invention is also characterized in that,
步骤1中协调器采用CC2530芯片为主芯片,协调器中还包括JTAG接口、电源模块、串口接口、LED模块以及按键模块,采用USB接口供电,按键模块控制协调器是否允许新网络加入,当需要在建立好的ZigBee网络中加入新设备时,需打开网络允许才能给新加入的设备分配网络地址。In step 1, the coordinator uses the CC2530 chip as the main chip. The coordinator also includes a JTAG interface, a power module, a serial interface, an LED module and a button module. The USB interface is used for power supply. The button module controls whether the coordinator allows a new network to join. When adding a new device to the established ZigBee network, it is necessary to enable the network permission to assign a network address to the newly added device.
步骤1中协调器进入无线监控状态后,当有新设备加入时,网络会分配一个16位的网络地址,这个地址在网络中是唯一的,用于设备鉴别和发送数据。In step 1, after the coordinator enters the wireless monitoring state, when a new device is added, the network will assign a 16-bit network address, which is unique in the network and is used for device identification and data transmission.
步骤1中的16位网络地址中的父设备地址分配如下:The parent device address in the 16-bit network address in step 1 is assigned as follows:
假设父设备可拥有的最大设备数为Cm,Cm拥有的最大路由子设备数为Rm,网络的最大深度为Lm,则父设备所能分配子区段地址数为:Assuming that the maximum number of devices that the parent device can have is C m , the maximum number of routing sub-devices that C m has is R m , and the maximum network depth is L m , the number of sub-segment addresses that the parent device can allocate is:
若Rm=1,Cskip=1+Cm*(Lm-d-1);If R m =1, C skip =1+C m *(L m -d-1);
若Rm不为1,则Cskip=(1+Cm-Rm-Cm*Rm^(Lm-d-1))/(1-Rm);If R m is not 1, then C skip =(1+C m -R m -C m *R m ^(L m -d-1))/(1-R m );
子节点为父设备的第n个子路由器的短地址分配:The child node assigns the short address of the nth child router of the parent device:
Achild=Aparent+(n-1)*Cskip+1,n=1A child =A parent +(n-1)*C skip +1, n=1
Achild=Aparent+(n-1)*Cskip,n>1A child =A parent +(n-1)*C skip , n>1
子节点为父设备的第n个子控制系统平台的短地址分配:The child node is the short address assignment of the nth child control system platform of the parent device:
Achild=Aparent+Rm*Cskip+n。A child =A parent +R m *C skip +n.
步骤3中的无线灯光控制过程中包括手动控制和自动控制两种方式;The wireless lighting control process in
在手动控制方式中,用户在PC机的串口助手中输入指令,该指令以串口通信的方式传递给协调器,协调器将信息转化为无线信号传递给无线信号收发器,CC2530主控板依据得到的信息控制照明灯的开关;In the manual control mode, the user enters an instruction in the serial port assistant of the PC, and the instruction is transmitted to the coordinator by serial communication. The coordinator converts the information into a wireless signal and transmits it to the wireless signal transceiver. The CC2530 main control board obtains information to control the light switch;
在自动控制方式中,光敏传感器和人体传感器检测周围环境信息,当出现有人无光的情况下需要打开照明灯,其余情况下照明灯应处于熄灭的状态;现场采集得到的信息会传递给CC2530主控板,然后通过无线信号收发器以无线信号方式传递给协调器,协调器会将信息通过串口通信传递给串口助手将现场情况显示给用户,同时将控制命令通过无线信号收发器传递给控制系统平台,用继电器控制照明灯的开关。In the automatic control mode, the photosensitive sensor and the human body sensor detect the surrounding environment information. When there is no light, the lighting needs to be turned on. In other cases, the lighting should be off; the information collected on site will be transmitted to the CC2530 main unit. The control board is then transmitted to the coordinator by wireless signal through the wireless signal transceiver. The coordinator will transmit the information to the serial assistant through serial communication to display the on-site situation to the user, and at the same time transmit the control command to the control system through the wireless signal transceiver. The platform uses a relay to control the switch of the lighting.
步骤2中人体红外传感器为HC-SR501。In step 2, the human body infrared sensor is HC-SR501.
步骤2中无线信号接收器为EM250。In step 2, the wireless signal receiver is EM250.
本发明的有益效果如下:The beneficial effects of the present invention are as follows:
1.当加入新设备时无需重新布线;1. No rewiring is required when adding new equipment;
2.每一盏灯在ZigBee网络中都有唯一的一个网络地址,保证一个特定的数据包能够发给它指定的设备,而不出现混乱;2. Each lamp has a unique network address in the ZigBee network to ensure that a specific data packet can be sent to its designated device without confusion;
3.远程控制设计减少电缆的铺设面积以及布线的复杂程度,减少资源的浪费,并起到一定的用电安全保护;3. The remote control design reduces the laying area of cables and the complexity of wiring, reduces the waste of resources, and plays a certain role in electricity safety protection;
4.操作简单,容易上手,并可以查看的工作情况;4. Simple operation, easy to use, and can check the working situation;
5.依据人和光线自动调节工作状态。5. Automatically adjust the working state according to people and light.
附图说明Description of drawings
图1(a)、(b)是本发明一种基于ZigBee的无线灯光控制方法中手动和自动控制状态的结构示意图;Fig. 1 (a), (b) are the structure schematic diagrams of manual and automatic control states in a ZigBee-based wireless lighting control method of the present invention;
图2是本发明一种基于ZigBee的无线灯光控制方法中协调器的结构示意图;2 is a schematic structural diagram of a coordinator in a ZigBee-based wireless lighting control method of the present invention;
图3是本发明一种基于ZigBee的无线灯光控制方法采用的控制系统的示意图。3 is a schematic diagram of a control system adopted by a ZigBee-based wireless lighting control method of the present invention.
图中,1.光敏传感器,2.人体红外传感器,3.照明灯,4.无线信号收发器,5.CC2530主控板,6.继电器,7.控制系统平台。In the figure, 1. Photosensitive sensor, 2. Human body infrared sensor, 3. Lighting lamp, 4. Wireless signal transceiver, 5. CC2530 main control board, 6. Relay, 7. Control system platform.
具体实施方式Detailed ways
下面结合附图和具体实施方式对本发明进行详细说明。The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
本发明一种基于ZigBee的无线灯光控制方法,如图1所示,其中包含两种控制方式:图1(a)为远程手动控制电器工作状态、图1(b)为电器自动控制电器工作状态。具体包含以下步骤:A ZigBee-based wireless lighting control method of the present invention, as shown in Figure 1, includes two control methods: Figure 1(a) is the remote manual control of the working state of the electrical appliance, and Figure 1(b) is the electrical appliance's automatic control of the working state of the electrical appliance. . Specifically includes the following steps:
步骤1,ZigBee组网;Step 1, ZigBee networking;
ZigBee技术是实现数据无线传送的关键技术,主要包含:协调器硬件搭建、网络初始化、节点加入网络。协调器是网络中第一个设备,网络的建立,初始化,确定网络的个域标识符和物理信道,给其他节点分配网络短地址。协调器是ZigBee网络中第一的节点,形成一个完整的网络等待设备加入并对其分配16位独一无二的网络地址,保证一个特定的数据包能够发给它指定的设备,而不出现混乱。ZigBee technology is the key technology to realize wireless data transmission, which mainly includes: coordinator hardware construction, network initialization, and nodes joining the network. The coordinator is the first device in the network. It establishes and initializes the network, determines the individual domain identifier and physical channel of the network, and assigns network short addresses to other nodes. The coordinator is the first node in the ZigBee network, forming a complete network waiting for devices to join and assigning a 16-bit unique network address to it, ensuring that a specific data packet can be sent to its designated device without confusion.
步骤1.1,协调器的硬件设计Step 1.1, Hardware Design of Coordinator
图2所示的协调器硬件设计方案中选用CC2530芯片为设计主芯片,其中包含JTAG接口、电源模块、串口接口、LED模块以及按键模块。采用USB接口供电,按键模块控制协调器是否允许新网络加入,如果需要在建立好的ZigBee网络中加入新设备时,需打开网络允许才能给新加入的设备分配网络地址。In the coordinator hardware design scheme shown in Figure 2, the CC2530 chip is selected as the design main chip, which includes the JTAG interface, the power module, the serial interface, the LED module and the button module. The USB interface is used for power supply, and the button module controls whether the coordinator allows a new network to join. If a new device needs to be added to the established ZigBee network, the network permission must be turned on to assign a network address to the newly added device.
步骤1.2,网络设备初始化Step 1.2, network device initialization
查看组成的网络设备是否满足是全功能节点,查看该节点没有与其他网络里连接,如果连接了其他网络只能作为子节点。Check whether the composed network device is a full-featured node, check that the node is not connected to other networks, and can only be used as a child node if it is connected to other networks.
步骤1.3,建立一个新网络;Step 1.3, establish a new network;
在确保网络中只有一个协调器的情况下进行信通道扫描,找到一个最好的通道,该通道存在最少的zigbee网络,最好是没有zigbee设备。找到合适的信道后,协调器将为网络选定一个网络标识符(PAN ID,取值《=0x3FFF)。Perform a channel scan while ensuring that there is only one coordinator in the network to find the best channel that has the fewest zigbee networks, preferably no zigbee devices. After finding a suitable channel, the coordinator will select a network identifier (PAN ID, value <=0x3FFF) for the network.
步骤1.4,协调器进入无线监控状态,等待有节点加入Step 1.4, the coordinator enters the wireless monitoring state, waiting for a node to join
当有设备加入时,网络会分配一个16位的网络地址,这个地址在网络中是唯一的,在设备鉴别和发送数据都会用到;重要设备地址的应用程序可能需要知道它的设备地址和父亲地址,并采用分布寻址的方式分配地址,父设备地址分配如下:When a device joins, the network assigns a 16-bit network address, which is unique in the network and is used both for device identification and for sending data; applications with important device addresses may need to know its device address and parent address, and use distributed addressing to assign addresses. The parent device address assignment is as follows:
假设父设备可拥有的最大设备数为Cm,其拥有的最大路由子设备数为Rm,网络的最大深度为Lm,则父设备所能分配子区段地址数Cskip为:Assuming that the maximum number of devices that the parent device can have is C m , the maximum number of routing sub-devices it has is R m , and the maximum depth of the network is L m , then the number of sub-segment addresses C skip that the parent device can allocate is:
若Rm=1,Cskip=1+Cm*(Lm-d-1);If R m =1, C skip =1+C m *(L m -d-1);
若Rm不为1,则Cskip=(1+Cm-Rm-Cm*Rm^(Lm-d-1))/(1-Rm);If R m is not 1, then C skip =(1+C m -R m -C m *R m ^(L m -d-1))/(1-R m );
子节点地址为父设备的第n个子路由器的短地址分配(用Achild表示子节点地址,Aparent表示父节点地址):The child node address is the short address allocation of the nth child router of the parent device (use A child to represent the child node address, and A parent to represent the parent node address):
Achild=Aparent+(n-1)*Cskip+1,n=1A child =A parent +(n-1)*C skip +1, n=1
Achild=Aparent+(n-1)*Cskip,n>1A child =A parent +(n-1)*C skip , n>1
子节点为父设备的第n个子控制系统平台的短地址分配:The child node is the short address assignment of the nth child control system platform of the parent device:
Achild=Aparent+Rm*Cskip+nA child =A parent +R m *C skip +n
人体传感器和光敏传感器将检测周围环境,是否有人且光照强度是否低于设置阈值,只有出现有人但光强达不到阈值的情况下才打开灯,人体传感器和光敏传感器检测到的信息将会显示在串口助手和通过处理后控制继电器工作实现自动控制的功能。The human body sensor and the light sensitive sensor will detect the surrounding environment, whether there is someone and whether the light intensity is lower than the set threshold. Only when there is someone but the light intensity does not reach the threshold, the light will be turned on, and the information detected by the human body sensor and the light sensitive sensor will be Display the function of automatic control in the serial port assistant and by controlling the relay work after processing.
步骤2,控制系统平台7硬件设计;Step 2,
主控芯片CC2530负责控制系统平台或者是路由节点数据的采集、预处理、发送以及接收相关命令、控制本节点相关输出设备、人体红外传感器HC-SR501、光敏传感器、继电器、灯及无线信号接收器。CC2530的I/O引脚分配为:P0.1接人体红外传感器,P0.2接光敏传感器,P1.0接继电器。P0.1连接人体红外传感器检测监测环境中是否有人,P0.2连接光敏传感器检测环境中是否有光,P1.0连接继电器控制灯泡的亮灭。The main control chip CC2530 is responsible for the control system platform or routing node data collection, preprocessing, sending and receiving related commands, controlling the relevant output devices of this node, human infrared sensor HC-SR501, photosensitive sensors, relays, lights and wireless signal receivers . The I/O pins of CC2530 are assigned as follows: P0.1 is connected to the human body infrared sensor, P0.2 is connected to the photosensitive sensor, and P1.0 is connected to the relay. P0.1 is connected to the human infrared sensor to detect whether there is a person in the monitoring environment, P0.2 is connected to the photosensitive sensor to detect whether there is light in the environment, and P1.0 is connected to the relay to control the on and off of the bulb.
控制系统平台的软件设计过程如下:The software design process of the control system platform is as follows:
主要是串口与协调器之间信息传递软件设置,在手动设置环节,设置相应的命令指控,例如,“D10”、“D11”分别点亮和熄灭控制系统平台1的灯泡,命令“D20”、“D21”分别点亮和熄灭控制系统平台2的灯泡,命令“D00”、“D01”分别同时控制两个灯泡的亮和灭。在自动控制环节,串口助手会显示当前环境信息,其中midnight代表无光,light代表有光,security代表无人,insecurity代表有人。It is mainly the software setting of information transfer between the serial port and the coordinator. In the manual setting, set the corresponding command and command, for example, "D10", "D11" respectively turn on and off the light bulb of the control system platform 1, command "D20", "D11" "D21" lights and extinguishes the bulbs of the control system platform 2 respectively, and commands "D00" and "D01" to control the on and off of the two bulbs at the same time, respectively. In the automatic control link, the serial port assistant will display the current environment information, where midnight represents no light, light represents light, security represents no one, and insecurity represents someone.
步骤3,无线控制灯光实现;人体红外传感器检测是否存在行人,光敏传感器检测环境的光强与设定阈值比较划分为有光和无光两种情况,继电器控制照明灯的亮灭。
无论是手动还是自动控制灯,最终的被控对象都是灯,所以在本发明中,将两种方式的结合于一个装置中。该控制系统平台如图1(a)所示,在手动控制系统中,用户在PC机的串口助手中输入指令,该指令以串口通信的方式传递给协调器,协调器将信息转化为无线信号传递给无线信号收发器4(参见图3),CC2530主控板5依据得到的信息控制照明灯3的开关。Whether the lamp is controlled manually or automatically, the final controlled object is the lamp, so in the present invention, the two methods are combined into one device. The control system platform is shown in Figure 1(a). In the manual control system, the user enters an instruction in the serial port assistant of the PC, and the instruction is transmitted to the coordinator by serial communication, and the coordinator converts the information into wireless signals It is transmitted to the wireless signal transceiver 4 (see FIG. 3 ), and the CC2530 main control board 5 controls the switch of the
参见图1(b)(图1(b)中的PIR传感器为人体红外传感器),在自动控制系统中,光敏传感器1和人体传感器2检测周围环境信息,当出现有人无光的情况下需要打开照明灯3,其余情况下照明灯3应处于熄灭的状态;现场采集得到的信息会传递给CC2530主控板5,然后通过无线信号收发器4以无线信号方式传递给协调器,协调器会将信息通过串口通信传递给串口助手将现场情况显示给用户,同时将控制命令通过无线信号收发器4传递给控制系统平台7,用继电器控6制照明灯3的开关。Referring to Figure 1(b) (the PIR sensor in Figure 1(b) is a human body infrared sensor), in the automatic control system, the photosensitive sensor 1 and the human body sensor 2 detect the surrounding environment information, and need to be turned on when there is no light.
步骤3.1,在CC2530主控板5上将串口里连接在PC机上;Step 3.1, connect the serial port to the PC on the CC2530 main control board 5;
步骤3.2,在PC机上打开串口助手设置好参数(波特率115200bps)端口选择对应的COM口(串口)然后通过串口调试工具向对方发送数据;Step 3.2, open the serial port assistant on the PC, set the parameters (baud rate 115200bps), select the corresponding COM port (serial port), and then send data to the other party through the serial port debugging tool;
步骤3.3,对于手动模式,需要在串口助手上输入相应命令,通过串口将数据传送至外部协调器;对于自动模式,人体传感器1和光敏传感器2将检测周围环境,是否有人且光照强度是否低于系统设置阈值,只有出现有人但光强达不到阈值的情况下才打开灯。传感器检测到的信息将会显示在串口助手并会将数据传递给协调器。Step 3.3, for the manual mode, you need to enter the corresponding command on the serial port assistant, and transmit the data to the external coordinator through the serial port; for the automatic mode, the human body sensor 1 and the light sensor 2 will detect the surrounding environment, whether there is anyone and whether the light intensity is lower than The system sets a threshold, and the light is turned on only when there is someone but the light intensity does not reach the threshold. The information detected by the sensor will be displayed in the serial assistant and the data will be passed to the coordinator.
步骤3.4,协调器首先判断是不是接收到了串口命令,如果确实收到了串口命令,则解析串口命令:读取串口命令中第一至第三字节“目的地址”段,并转换为可用于ZigBee无线通信的16位(两个字节)的短地址;Step 3.4, the coordinator first judges whether it has received the serial port command, if it does receive the serial port command, then parses the serial port command: reads the first to third byte "destination address" segment in the serial port command, and converts it into a serial port command that can be used for ZigBee 16-bit (two bytes) short address for wireless communication;
接着协调器通过无线电的形式把命令再一次发送出去,发送内容中不再包含串口命令中的“帧头”、“帧尾”和“目的地址”,只剩下了核心部分——命令;如果没有接收到串口命令则直接进入接收节点命令反馈过程;Then the coordinator sends the command again in the form of radio, and the sent content no longer includes the "frame header", "frame end" and "destination address" in the serial port command, only the core part - the command; if If the serial port command is not received, it will directly enter the receiving node command feedback process;
步骤3.5,控制系统平台依据无线信号由无线信号收发器4接收到的命令,控制照明灯3的开关;对于手动控制系统,在串口调试助手中输入“D1”,系统进入手动控制,输入命令“D10”、“D11”分别点亮和熄灭控制系统平台1的灯泡,命令“D20”、“D21”分别点亮和熄灭控制系统平台2的灯泡,命令“D00”、“D01”分别同时控制两个灯泡的亮和灭;输入命令“D0”系统又会进入自动控制(这些具体的指令均可在串口软件设计的时候进行设定);Step 3.5, the control system platform controls the switch of the
对于自动控制系统,PIR传感器和光敏传感器将接受到的信息传递给协调器,协调器将通过串口通信将信息传递给串口助手,在串口调试界面能看到四种状态:有人无光、有人有光、无人无光、无人有光。只有在第一种情况下才会才需要将灯打开,其余情况下灯应处于熄灭的状况,继电器依据协调器反馈的现场信息控制灯的开关。For the automatic control system, the PIR sensor and the photosensitive sensor will transmit the received information to the coordinator, and the coordinator will transmit the information to the serial assistant through serial communication. Four states can be seen in the serial debugging interface: someone has no light, someone has Light, no one without light, no one with light. The light needs to be turned on only in the first case, and the light should be turned off in other cases, and the relay controls the light switch according to the on-site information fed back by the coordinator.
协调器的主控芯片为CC2530,该ZigBee网络采用的是Z-Stack协议栈,使用分布式寻址方案来分配网络地址。The main control chip of the coordinator is CC2530, the ZigBee network adopts the Z-Stack protocol stack, and uses the distributed addressing scheme to allocate network addresses.
控制系统平台中串口调试助手为SSCOM3.2,人体红外传感器1为HC-SR501,无线信号接收器4为EM250。The serial port debugging assistant in the control system platform is SSCOM3.2, the human body infrared sensor 1 is HC-SR501, and the wireless signal receiver 4 is EM250.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911024266.9A CN110784536A (en) | 2019-10-25 | 2019-10-25 | Wireless light control method based on ZigBee |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911024266.9A CN110784536A (en) | 2019-10-25 | 2019-10-25 | Wireless light control method based on ZigBee |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110784536A true CN110784536A (en) | 2020-02-11 |
Family
ID=69386825
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911024266.9A Pending CN110784536A (en) | 2019-10-25 | 2019-10-25 | Wireless light control method based on ZigBee |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110784536A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114984550A (en) * | 2022-07-28 | 2022-09-02 | 四川幼儿师范高等专科学校 | Intelligent training device based on ZigBee wireless ad hoc network and use method thereof |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101282605A (en) * | 2008-03-21 | 2008-10-08 | 浙江大学城市学院 | Energy-saving indoor lighting wireless intelligent control system and control method based on ZigBee sensor network |
CN101951661A (en) * | 2010-09-28 | 2011-01-19 | 华为技术有限公司 | Address distribution method in sensor network and sensor network node |
CN103596294A (en) * | 2013-11-25 | 2014-02-19 | 吉林大学 | Smart home wireless sensor network based on ZigBee |
US20170055333A1 (en) * | 2015-08-20 | 2017-02-23 | En-Trak Hong Kong Limited | Wireless lighting control system and its application thereof |
CN107148089A (en) * | 2017-06-30 | 2017-09-08 | 杭州师范大学钱江学院 | A wireless networking monitoring system for greenhouse crop environmental information based on ZigBee technology |
-
2019
- 2019-10-25 CN CN201911024266.9A patent/CN110784536A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101282605A (en) * | 2008-03-21 | 2008-10-08 | 浙江大学城市学院 | Energy-saving indoor lighting wireless intelligent control system and control method based on ZigBee sensor network |
CN101951661A (en) * | 2010-09-28 | 2011-01-19 | 华为技术有限公司 | Address distribution method in sensor network and sensor network node |
CN103596294A (en) * | 2013-11-25 | 2014-02-19 | 吉林大学 | Smart home wireless sensor network based on ZigBee |
US20170055333A1 (en) * | 2015-08-20 | 2017-02-23 | En-Trak Hong Kong Limited | Wireless lighting control system and its application thereof |
CN107148089A (en) * | 2017-06-30 | 2017-09-08 | 杭州师范大学钱江学院 | A wireless networking monitoring system for greenhouse crop environmental information based on ZigBee technology |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114984550A (en) * | 2022-07-28 | 2022-09-02 | 四川幼儿师范高等专科学校 | Intelligent training device based on ZigBee wireless ad hoc network and use method thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4409294B2 (en) | Wireless controlled lighting system initialization | |
CN101990334B (en) | Lamp control system, method thereof, main controller and lamp control terminal | |
US20120098446A1 (en) | Lighting system and method for controlling the same | |
CN201766739U (en) | Smart home LED lighting system based on ZigBee and ARM technology | |
CN204496184U (en) | A kind of Internet of Things house control system based on ZIGBEE | |
CN104093244B (en) | lamp control system and method | |
CN104333132B (en) | Family's distribution method and system and distribution box | |
CN101778515A (en) | System based on wireless network for controlling street lamps | |
CN108173728A (en) | Intelligent appliance equipment and intelligent appliance system | |
CN204719434U (en) | The intelligent domestic system of many-many communication mode can be realized | |
CN106878162B (en) | EnOcean and DA L I protocol conversion gateway and method for realizing same | |
CN104202878A (en) | Illumination control system | |
CN103687251B (en) | Intelligent illumination control system on basis of EnOcean and control method thereof | |
CN201355879Y (en) | Remote control lighting switch device based on ZigBee technology | |
CN109656167B (en) | Communication control system and method based on intelligent equipment | |
CN103713605A (en) | Intelligent control platform and method | |
CN203827342U (en) | Emergency illumination power line AP system | |
CN110784536A (en) | Wireless light control method based on ZigBee | |
CN203117755U (en) | Intelligent household management system based on Internet of Things | |
Li et al. | A kind of intelligent lighting control system using the EnOcean network | |
Varghese et al. | A study of communication protocols and wireless networking systems for lighting control application | |
Balbin et al. | ZigBee and Power Line Communications interconnectivity applied to fuzzy logic controlled automated lighting system | |
CN205028063U (en) | Smart home system | |
CN208013707U (en) | A kind of intelligent control device for supporting POE cascade power supplies | |
CN106611492A (en) | Infrared two-way communication intelligent lamp and system thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200211 |
|
RJ01 | Rejection of invention patent application after publication |