Intelligent LED lamp system based on mobile terminal and control method
Technical Field
The invention relates to the technical field of intelligent LED lamps, in particular to an intelligent LED lamp system based on a mobile terminal and a control method.
Background
With the continuous progress of society and the rapid development of information technology, an intelligent lighting system combining an automatic control technology and an LED is secretly going into people's daily life, intelligent lighting is mainly characterized in that various lamps are connected together through an Internet of things technology, household lamps and lanterns and decorative lighting can be remotely controlled, different atmospheres and scenes are produced, and the existing remote control mode for lighting lamps is mainly two modes of Bluetooth control and RF infrared control.
Along with the development of intelligent electric, the popularization of household intelligent electric is higher and higher, and the LED lamp control switch with the traditional mechanical structure is gradually eliminated.
Disclosure of Invention
A first object of the present invention is to solve the technical problems in the prior art, and therefore, to provide an intelligent LED lighting system and a control method based on a mobile terminal, which can control the light of each room to be turned on or off, or a certain light of a room to be turned on or off, and can control the lighting time.
The second purpose of the invention is to provide a control method of the intelligent LED lamp system based on the mobile terminal;
in order to achieve the first object of the present invention, the technical solution adopted by the present invention is as follows:
the invention discloses an intelligent LED lamp system based on a mobile terminal, which comprises the following components:
the mobile terminal detects signals of the plurality of sub-routers, determines the position of the mobile terminal, determines lamp control parameters of the household LED lamps according to the position signals, and is used for sending the lamp control parameters to the lamp master control module;
the main router is used for transmitting the lamp control parameters of the mobile terminal to the lamp main control module;
a sub-router installed in each room for connecting mobile terminals;
the lamp master control module receives the lamp control parameters, and identifies the LED lamp switching signals and the switching time signals according to the lamp control parameters;
the LED lamp switches are used for receiving signals of the lamp master control module and independently controlling the switches of a group of lamps;
the mobile terminal is connected with one of the branch routers, all the branch routers are connected with the main router, and the main router is connected with each LED lamp switch through the lamp main control module.
Further, the mobile terminal comprises the following components:
the storage module is used for storing a model of a family room, marking the position of each sub-router, and storing a lamp control parameter table of a user, wherein the lamp control parameter table stores the corresponding relation between the position and the direction of the user and the lamp control parameters;
the signal identification module is used for receiving wireless signals of a plurality of branch routers and identifying the strength of the wireless signals of the branch routers and the serial numbers of the branch routers;
the position calculation module is used for calculating the position and the moving direction of the user according to the strength and the number of the signals of the plurality of sub-routers;
the parameter identification module is used for searching lamp control parameters from the lamp control parameter table according to the position and the moving direction of a user;
the signal identification module is connected with the parameter identification module through the position calculation module, and the position calculation module and the parameter identification module are both connected with the storage module.
Further, the lamp general control module comprises the following components:
the signal decoding module is used for receiving the lamp control parameters and identifying the on-off state, the on-off time and the brightness of each corresponding LED in the lamp control parameters;
the lamp control module is used for controlling the on-off of each LED, the on-off time and the brightness of the LED lamp according to the on-off state, the on-off time and the brightness;
the parameter identification module is respectively connected with each LED lamp switch through the signal decoding module and the lamp control module.
Furthermore, a position comparison table is stored in the storage module, a plurality of groups of position comparison information are stored in the position comparison table, and each group of position comparison information comprises position information in a family, the ratio of the number of at least 3 sub-routers to the corresponding signal strength, the number of a preset attenuation sub-router, the signal attenuation condition and the moving direction;
the position calculation module comprises the following modules:
the proportion calculation module is used for measuring and calculating the proportion of the signal intensity of the plurality of sub-routers and sending the proportion to the comparison module;
the signal attenuation measuring and calculating module is used for calculating the signal attenuation condition of the sub-router and sending the signal attenuation condition to the comparison module;
the comparison module is used for searching corresponding position information according to the measured signal intensity ratio of the branch router, searching the preset attenuation branch router number in the same position comparison table and transmitting the preset attenuation branch router number to the signal attenuation measuring and calculating module; searching the moving direction in the position comparison table according to the attenuation condition of the received signal; then the position information and the moving direction are sent to a parameter identification module;
the signal identification module is respectively connected with the proportion calculation module and the signal attenuation measuring and calculating module, the proportion calculation module and the signal attenuation measuring and calculating module are also connected with the comparison module, and the proportion calculation module and the signal attenuation measuring and calculating module are also connected with the storage module.
In order to achieve the second object of the present invention, the technical solution adopted by the present invention is as follows:
a control method for the intelligent LED lamp based on the mobile control comprises the following steps:
s1, the mobile terminal detects the signal of the home branch router in real time, and identifies the number of the branch router and the corresponding signal strength;
s2, calculating the position and moving direction of the user according to the numbers of the sub-routers and the corresponding signal strength;
s3, searching lamp control parameters from the lamp control parameter table according to the position and the moving direction of the user, and sending the lamp control parameters to the general router;
s4, the master router sends the lamp control parameters to the lamp master control parameters, and the lamp master control parameters send switch signals to each LED lamp switch according to the lamp control parameters;
and S5, the LED lamp switch which receives the switch signal controls the switch of each group of lamps independently.
Further, the method for calculating the user position and the moving direction in step S2 includes:
s21, calculating the signal intensity proportion of the three sub-routers with the strongest signals at the current position;
s22, searching a piece of position comparison information meeting the requirement of the proportion from the position comparison table according to the proportion in the step S31, and determining a position signal;
s23, calculating the signal attenuation of the shunt router, then searching the corresponding relation between the signal attenuation and the moving direction from the position comparison information in the step S22, and determining the moving direction.
Further, the information confirmation method in the position comparison table comprises the following steps:
s01, presetting and identifying a room model and a branching router number in a family, and branching the router position;
s02, standing at the position of a doorway for communicating the first room with the second room;
s03, writing the signal intensity ratios of the three branch routers with the strongest detection signals into the ratio of the number of the branch router to the corresponding signal intensity; the position of the doorway is written into the position information,
s04, the user enters a second room from the first room;
s05, whether the branch router with the strongest signal is attenuated or enhanced is detected, the number of the branch router and the signal attenuation condition are written into the number of the preset attenuation branch router and the signal attenuation condition respectively, and the moving state that the user enters the second room from the first room is written into the moving direction.
Further, the specific implementation method of step S3 is,
s31, identifying the number of each lamp in the lamp control parameters, and the corresponding on-off state, on-off time and brightness information of the lamp;
s32, the lamp master control module sends the decoded on-off state, on-off time and lamp brightness information to the corresponding LED lamp switch according to the number of each lamp;
and S33, after the LED lamp switch receives the information, controlling the on-off state according to the on-off state, the on-off time and the brightness information of the lamp.
Compared with the prior art, the invention has the advantages that:
in the application, a branch router is arranged in each room in a family, then when a user holds a mobile terminal in the room, the mobile terminal detects signals of a plurality of branch routers, so that the position of the mobile terminal in the family is determined, lamp control parameters of an LED lamp in the family are determined according to the position signals, the lamp control parameters are sent to a lamp master control module through a master router, then the lamp master control module sends the lamp control parameters to a corresponding LED lamp switch, and the LED lamp switch controls the corresponding LED lamp to be turned on or turned off.
By the device, as long as a user carries the mobile terminal, the mobile terminal can automatically control the lamp of the corresponding room to be turned on or off or a certain lamp of the room to be turned on or off in each room of the home.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a structural schematic block diagram of an intelligent LED lamp system based on a mobile terminal of the invention;
fig. 2 is a method schematic diagram of the intelligent LED lamp control method based on mobile control according to the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings so that the advantages and features of the present invention can be more easily understood by those skilled in the art, and the scope of the present invention will be more clearly and clearly defined.
Example one
Referring to fig. 1, the intelligent LED lamp system based on the mobile terminal provided by the invention includes the following components:
the mobile terminal 1 detects signals of the plurality of sub-routers 3, determines the position of the mobile terminal 1, determines lamp control parameters of household LED lamps according to the position signals, and is used for sending the lamp control parameters to the lamp master control module 4; the mobile terminal can be a mobile device such as a mobile phone and a tablet, and the control method in the application can be completed by adopting the APP of the mobile terminal.
The master router 2 is used for transmitting the lamp control parameters of the mobile terminal to the lamp master control module; the main router 2 is a terminal connected with an external network in a family, and is connected with the external network on one hand and communicated with all sub-routers in the family on the other hand;
a sub-router 3 installed in each room for connecting mobile terminals; the sub-router may be a panel AP installed in a home, or a ceiling AP, etc. Which is installed at a fixed location in a room, and which transmits wireless signals that can be received by the mobile terminal 1.
The lamp master control module 4 is used for receiving the lamp control parameters, and identifying the LED lamp switching signals and the switching time signals according to the lamp control parameters;
the LED lamp switches 5 are used for receiving signals of the lamp master control module 4 and independently controlling the switches of a group of lamps;
the mobile terminal 1 is connected with one of the branch routers 3, all the branch routers 3 are connected with the main router 2, and the main router 2 is connected with each LED lamp switch 5 through the lamp main control module 4.
By arranging the branch routers 3 in each room in a household, and then when a user holds the mobile terminal 1 in the room, the mobile terminal 1 detects signals of a plurality of branch routers 3, so as to determine the position of the mobile terminal 1 in the household, and according to the position signals, determine lamp control parameters of the LED lamps in the household, the lamp control parameters are sent to the lamp master control module 4 through the master router 2, then the lamp master control module 4 sends the lamp control parameters to the corresponding LED lamp switches 5, and the LED lamp switches 5 control the corresponding LED lamps to be turned on or turned off. By the device, as long as a user carries the mobile terminal, the mobile terminal can automatically control the lamp of the corresponding room to be turned on or off or a certain lamp of the room to be turned on or off in each room of the home.
In the present embodiment, the mobile terminal 1 includes the following components:
the storage module 11 is used for storing a model of a family room, marking the position of each sub-router 3 and storing a lamp control parameter table of a user, wherein the lamp control parameter table stores the corresponding relation between the position and the direction of the user and the lamp control parameters;
the system also stores a position comparison table, wherein a plurality of groups of position comparison information are stored in the position comparison table, and each group of position comparison information comprises position information in a family, the number and corresponding signal strength information of at least 3 sub-routers, the number of a preset attenuation sub-router, signal attenuation conditions and a moving direction;
the position comparison table may be preset in an earlier stage, for example, when the signal intensity of the master horizontal split router, the signal intensity of the parlor split router and the signal intensity of the kitchen split router are detected at the master horizontal gate, and then stored, and when the mobile terminal detects that the signals of the master horizontal split router, the parlor split router and the kitchen split router are consistent with the stored signals, it is determined that the mobile terminal 1 is at the master horizontal gate;
a signal identification module 12, configured to receive wireless signals of multiple branch routers 3, and identify the strength of the wireless signals of the branch routers 3 and the serial numbers of the branch routers 3; for comparison with a position comparison table.
A position calculation module 13, which calculates the position and moving direction of the user according to the signal intensity and number of the plurality of sub-routers 3;
the signal identification module 12 detects the signal strengths of the plurality of sub-routers 3, then searches a record with the same signal strength from the position comparison information, and then the corresponding position is the current position of the mobile terminal 1; and keeping the record for finding the direction;
when the direction is to check that the user moves and the position is detected, the number of the preset attenuation branch router is searched in the same record, and whether the signal of the branch router is enhanced or attenuated when the user just moves is detected; for example: the user enters the living room from the bedroom, the position detection is already carried out when the user passes through the door, the corresponding preset attenuation branch router is the branch router 3 installed in the main bedroom, if the signal is calculated from the detection record of the signal, the mobile terminal 1 judges that the user enters the living room from the main bedroom, and if the signal is weakened, the user is judged to enter the main bedroom from the living room.
The parameter identification module 14 is used for searching lamp control parameters from the lamp control parameter table according to the position and the moving direction of the user;
the signal identification module 12 is connected with the parameter identification module 14 through the position calculation module 13, and both the position calculation module 13 and the parameter identification module 14 are connected with the storage module 11.
The luminaire master control module 4 comprises the following components:
the signal decoding module 41 is configured to receive the lamp control parameters, and identify the on-off state, the on-off time, and the brightness of each LED corresponding to the lamp control parameters;
the lamp control module 42 is used for controlling the on and off of each LED, the on or off time and the brightness of the LED lamp according to the on-off state, the on-off time and the brightness;
the parameter identification module 14 is connected to each LED lamp switch 5 through the signal decoding module 41 and the lamp control module 42.
After being decoded by the signal decoding module 41, the control information such as the on-off state, the on-off time, the brightness, etc. of the corresponding LED lamp can be identified, and then the lamp control module 42 can send the control information to the corresponding LED lamp switch 5.
Example two
The present embodiment is different from the first embodiment in that the embodiment compares the signal strengths of the plurality of sub-routers 3 with the signal strength in the position comparison table, and in the present application, compares the ratio of the signal strengths of the plurality of sub-routers 3 with the ratio stored in the position comparison table.
The position comparison table stores a plurality of groups of position comparison information, each of which comprises position information in a family, at least 3 numbers of the branch routers and corresponding signal intensity ratios, preset attenuation branch router numbers, signal attenuation conditions and a moving direction position calculation module 13, and the position comparison table comprises the following modules:
the proportion calculation module 131 is used for measuring and calculating the proportion of the signal intensity of the plurality of sub-routers 3 and sending the proportion to the comparison module 133;
the signal attenuation measuring and calculating module 132 is used for calculating the signal attenuation condition of the sub-router 3 and sending the signal attenuation condition to the comparison module 133;
the comparison module 133 is configured to search for corresponding location information according to the measured signal intensity ratio of the sub-router 3, then search for a preset number of the attenuation sub-router 3 in the same location comparison table, and transmit the number to the signal attenuation measuring and calculating module; searching the moving direction in the position comparison table according to the attenuation condition of the received signal; then the position information and the moving direction are sent to a parameter identification module;
the signal identification module 12 is respectively connected to the ratio calculation module 131 and the signal attenuation calculation module 132, the ratio calculation module 131 and the signal attenuation calculation module 132 are further connected to the comparison module 133, and the ratio calculation module 131 and the signal attenuation calculation module 132 are further connected to the storage module 11.
The advantage of this embodiment is that after long time use, the signal of the shunt router in the home will be attenuated, if the solution of the first embodiment is used, the position will not be identified accurately, while according to the solution of the second embodiment, the signal of the shunt router will be attenuated by the same signal and the proportion will be changed little.
EXAMPLE III
Referring to fig. 2, a method for controlling an intelligent LED lamp based on motion control includes the following steps:
s1, the mobile terminal detects the signal of the home branch router in real time, and identifies the number of the branch router and the corresponding signal strength;
s2, calculating the position and moving direction of the user according to the numbers of the sub-routers and the corresponding signal strength;
s3, searching lamp control parameters from the lamp control parameter table according to the position and the moving direction of the user, and sending the lamp control parameters to the general router;
s4, the master router sends the lamp control parameters to the lamp master control parameters, and the lamp master control parameters send switch signals to each LED lamp switch according to the lamp control parameters;
and S5, the LED lamp switch which receives the switch signal controls the switch of each group of lamps independently.
In this embodiment, the method for calculating the user position and the moving direction in step S2 includes:
s21, calculating the signal intensity proportion of the three sub-routers with the strongest signals at the current position;
s22, searching a piece of position comparison information meeting the requirement of the proportion from the position comparison table according to the proportion in the step S31, and determining a position signal;
s23, calculating the signal attenuation of the shunt router, then searching the corresponding relation between the signal attenuation and the moving direction from the position comparison information in the step S22, and determining the moving direction.
Preferably, the information confirmation method in the location comparison table includes:
s01, presetting and identifying a room model and a branching router number in a family, and branching the router position;
s02, standing at the position of a doorway for communicating a first room (main bed) with a second room (living room);
s03, writing the signal intensity ratios of the three branch routers with the strongest detection signals into the ratio of the number of the branch router to the corresponding signal intensity; the position of the doorway is written into the position information,
s04, the user enters a second room (living room) from the first room (main bed);
and S05, detecting whether the branching router with the strongest signal (such as the main lying branching router) attenuates or enhances, writing the branching router number and the signal attenuation condition into the preset attenuation branching router number and the signal attenuation condition respectively, and writing the moving state of the user entering a second room (living room) from a first room (main lying room) into the moving direction.
Therefore, the number of the preset attenuation branch router is the number of the main horizontal branch router, and the information in the signal attenuation condition is enhanced; by analogy, when the signal is attenuated, the signal is attenuated when the user enters the main bed from the living room.
The specific implementation method of step S3 is,
s31, identifying the number of each lamp in the lamp control parameters, and the corresponding on-off state, on-off time and brightness information of the lamp;
s32, the lamp master control module sends the decoded on-off state, on-off time and lamp brightness information to the corresponding LED lamp switch according to the number of each lamp;
and S33, after the LED lamp switch receives the information, controlling the on-off state according to the on-off state, the on-off time and the brightness information of the lamp.
The above description is only an embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that are not thought of through the inventive work should be included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope defined by the claims.