CN107995355B - Quick and simple method for controlling light by mobile phone - Google Patents

Quick and simple method for controlling light by mobile phone Download PDF

Info

Publication number
CN107995355B
CN107995355B CN201711091710.XA CN201711091710A CN107995355B CN 107995355 B CN107995355 B CN 107995355B CN 201711091710 A CN201711091710 A CN 201711091710A CN 107995355 B CN107995355 B CN 107995355B
Authority
CN
China
Prior art keywords
lamp
wireless connection
connection module
mobile phone
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.)
Active
Application number
CN201711091710.XA
Other languages
Chinese (zh)
Other versions
CN107995355A (en
Inventor
王同刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang kaiyao Lighting Co Ltd
Original Assignee
ZheJiang Klite Lighting Holdings Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by ZheJiang Klite Lighting Holdings Co Ltd filed Critical ZheJiang Klite Lighting Holdings Co Ltd
Priority to CN201711091710.XA priority Critical patent/CN107995355B/en
Publication of CN107995355A publication Critical patent/CN107995355A/en
Application granted granted Critical
Publication of CN107995355B publication Critical patent/CN107995355B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72409User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
    • H04M1/72415User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories for remote control of appliances
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72409User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
    • H04M1/72412User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories using two-way short-range wireless interfaces
    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B47/00Circuit arrangements for operating light sources in general, i.e. where the type of light source is not relevant
    • H05B47/10Controlling the light source
    • H05B47/175Controlling the light source by remote control
    • H05B47/19Controlling the light source by remote control via wireless transmission
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/02Details of telephonic subscriber devices including a Bluetooth interface
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Human Computer Interaction (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)
  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

The invention relates to the field of intelligent home control, in particular to a quick and simple method for controlling lamplight by a mobile phone. A quick and simple mobile phone light control method is suitable for a smart phone to control a dimmable lamp with a wireless connection module, and is characterized by comprising the following steps: A. the user installs and enters the client software, displays the foreground control panel and responds to the user foreground control; B. setting and carrying out key control on the lamp by monitoring a volume key and a screen state according to the screen state zone bit, the lamp state zone bit and the wireless connection zone bit; fingerprint identification control is carried out on the lamp by monitoring a fingerprint identification sensor; C. and the lamp microcontroller circularly reads the information received by the wireless connection module II and correspondingly controls the lamp. The invention has the beneficial effects that: the lamp is controlled by the mobile phone in the background through the background service, so that the control of the mobile phone on the lamp is further facilitated and simplified.

Description

Quick and simple method for controlling light by mobile phone
Technical Field
The invention relates to the field of intelligent home control, in particular to a quick and simple method for controlling lamplight by a mobile phone.
Background
The traditional control switch of the lighting light is generally fixed on a wall or arranged near the lighting light, and people cannot realize remote control. If the room is too big, it takes much time for people to control the light switch, especially in cold winter, it is very inconvenient for users not to leave comfortable positions to control the lighting. With the development of electronic technology, smart phones are increasingly popularized and relied on by people, and smart home technology is more and more applied. At present, the household intelligent lighting system is mainly focused, household lighting comprises various lamps such as a ceiling lamp, a desk lamp and an atmosphere lamp, and the control of the lamps mainly uses on-off control at present, so that the dimming cannot be realized, the flexibility is poor, and the use is inconvenient. The control of light is realized through the smart mobile phone, the traditional control mode of the light is changed, and people can fully enjoy the light, comfortable and pleasant new life experience brought by modern science and technology.
Chinese patent No. CN 106376149 a, open 2017, 2.1.4, discloses an indoor light control system based on wifi, which uses client software installed on a smart phone, displays a control panel on a software interface, realizes communication between the smart phone and a lamp through wifi connection, realizes a function that light in a home environment can be controlled by a mobile phone, and a user does not need to move to control on and off and brightness of all lights in a room. It still requires the client software to be turned on to be able to achieve control of the luminaire.
Disclosure of Invention
The invention aims to solve the technical problem that the existing indoor lamp is inconvenient to control. A background-controllable, quick and simple method for controlling light by using a smart phone and a wireless connection through a mobile phone is provided.
In order to solve the technical problems, the invention adopts the technical scheme that: a quick and simple mobile phone light control method is suitable for a smart phone to control a dimmable lamp with a wireless connection module, and comprises the following steps:
A. the user installs and enters the client software, displays the foreground control panel and responds to the user foreground control;
B. registering background service and responding to background control, comprising the following steps:
B1. monitoring a volume key, a screen state and a fingerprint identification sensor, setting a screen state flag bit, a lamp state flag bit and a wireless connection flag bit to be zero, and setting three variables for recording time as Timer1, Timer2 and Timer 3;
B2. after the service is operated, the change of the screen state is monitored for the first time, the Timer1 is updated to be the current system time, the screen state flag position is zero if the screen is locked, and the screen state flag position is one if the screen is unlocked or unlocked;
B3. carrying out key control on the lamp by monitoring a volume key and a screen state according to the screen state zone bit, the lamp state zone bit and the wireless connection zone bit; fingerprint identification control is carried out on the lamp by monitoring a fingerprint identification sensor;
C. the lamp microcontroller circularly reads the information received by the wireless connection module II, and if the lamp is turned on, the lamp power supply is switched on; if the lamp is turned off, the power supply of the lamp is cut off; if the brightness is increased or decreased, the value of the dimming module is correspondingly changed according to the step length; the value of the dimming module is maintained when the lamp reaches the highest or lowest brightness.
Preferably, the key control of the lamp comprises the following steps:
D1. when the change of the screen state is monitored, comparing the current system time with Timer1, and if the difference is less than a set value T _ set1, updating Timer1 to the current system time; if the value is larger than or equal to the set value T _ set1, entering a step D2;
D2. checking the wireless connection flag bit, if yes, entering step D3; if the number of the wireless connection signs is zero, calling a first wireless connection module on the smart phone, searching and trying to connect a second wireless connection module on the lamp, if the connection is successful, entering the step D3 together with the position of the wireless connection sign, and if the connection is failed, reporting an error and exiting the process;
D3. checking the lamp state flag bit, if the lamp state flag bit is a first lamp state flag bit, sending a lamp turning-off instruction to a second wireless connection module of the lamp through the wireless connection module of the mobile phone, and setting the lamp state flag bit to zero; if the current value is zero, sending a lamp turning-on instruction to a second wireless connection module of the lamp through the wireless connection module of the mobile phone, and marking the first state of the lamp at a first position; updating Timer2 to be the current mobile phone system time;
D4. when the volume key is pressed, if the screen state flag bit is zero, sending a light-on instruction to a wireless connection module II of a lamp through a wireless connection module of the mobile phone and marking the screen state flag bit at a first position, and then continuously sending a brightness increase or decrease instruction at an interval time T _ step1 until the volume key is lifted; if the screen state flag bit is one, calculating the difference value between the current time of the system and the Timer2, and if the difference value is less than or equal to a set value T _ set2, continuously sending a brightness increase or decrease instruction at an interval T _ step1 until the volume key is monitored to be lifted; wherein, the volume key + corresponds to the brightness increasing instruction, and the volume key-corresponds to the brightness decreasing instruction.
The technical difficulty of controlling the lamp through the background of the smart phone lies in how to distinguish whether a user wants to control the phone or the lamp by using a mobile phone key, whether a mobile phone screen is in a screen locking state is identified by setting a screen state flag bit, when the mobile phone screen is in the screen locking state, the use of a volume key can be determined as that the user wants to control the lamp, at the moment, the volume key corresponds to the adjustment of the lamp light of the lamp, and if the lamp is in a closing state, the lamp is firstly turned on; when the mobile phone is in an unlocking or screen-opening state, the power key is continuously used twice, namely the interval time is less than or equal to T _ set1, the user is judged to wish to switch the on and off of the lamp, and a period of extension time is reserved for the user to adjust the brightness of the lamp because the user just operates the lamp, so that when the mobile phone is in the unlocking or screen-opening state, the user uses the volume key and successfully operates the control of the lamp before the time T _ set2, the user is judged to wish to control the lamp.
Preferably, the fingerprint identification control of the lamp comprises the following steps:
E1. establishing a new thread in the service, setting a numerical variable Num1 and setting an initial value to be 0, circularly monitoring the state of the fingerprint identification sensor at intervals of time T in the thread, circularly detecting whether the finger of the user leaves the fingerprint identification sensor when the fingerprint matching is successfully monitored, entering a step E2 if the finger of the user leaves the fingerprint identification sensor within time T _ short, and entering a step E3 if the finger of the user is still on the fingerprint identification sensor after the time of T _ short is exceeded;
E2. comparing the system time with the Timer3, and if the difference is greater than a set value T _ set3, updating the Timer3 to be the current system time; if the difference is smaller than or equal to a set value T _ set3, checking the lamp state flag bit, if the difference is one, sending a lamp turning-off instruction to the wireless connection module II of the lamp through the wireless connection module of the mobile phone and setting the lamp state flag bit to zero, if the difference is zero, sending a lamp turning-on instruction to the wireless connection module II of the lamp through the wireless connection module of the mobile phone and setting the lamp state flag bit to one, and updating the Timer3 to be the current system time;
E3. checking the lamp state flag bit, if the lamp state flag bit is zero, sending a lamp turning-on command to a wireless connection module II of the lamp through a wireless connection module of the mobile phone, checking the value of a variable Num1 at the position I of the lamp state flag bit, if the value of Num1 is less than N, continuously sending a brightness increase command to the wireless connection module II of the lamp through the wireless connection module of the mobile phone at an interval T _ step2 and increasing the value of Num1 by 1 until the monitored fingerprint identification sensor function monitors that the finger of the user leaves the fingerprint identification sensor or the value of Num1 is equal to N, if the value of Num1 is greater than or equal to N, a brightness reduction command is continuously sent to the wireless connection module II of the lamp through the wireless connection module of the mobile phone at an interval T _ step2, and the value of Num1 is reduced from 1 at the same time until the fingerprint identification sensor function is monitored to monitor that the finger of the user leaves the fingerprint identification sensor or the value of Num1 is equal to 0.
When a user continuously carries out fingerprint identification twice and the time of touching the fingerprint identification sensor by a finger is short, judging that the user wants to switch on/off the lamp, when the finger of the user touches the fingerprint identification sensor for a long time, judging whether the current lamp is in a closing device or not, if so, firstly opening the lamp, then judging whether the lamp is in the maximum brightness or not, if so, circularly reducing the brightness by steps until the brightness is reduced to the minimum brightness or the finger of the user leaves the fingerprint sensor, and if not, circularly increasing the brightness by steps until the brightness is increased to the maximum brightness or the finger of the user leaves the fingerprint sensor.
Preferably, the responding user foreground control includes the steps of:
f1, displaying a foreground control panel, wherein the foreground control panel comprises the following buttons: a light-on button, a brightness-increasing button, and a brightness-decreasing button;
f2, setting the lamp state flag bit and the wireless connection flag bit to zero, and monitoring the touch action of a user;
f3, calling the first wireless connection module on the smart phone, searching and trying to connect the second wireless connection module on the lamp, if the connection is successful, prompting the user that the wireless connection is successful, connecting the first wireless connection with the first mark position, and if the connection is failed, reporting an error, and setting the first wireless connection with the mark position to zero;
f4, when the user touch action is monitored, judging the touch screen position of the user, and if the user clicks the light-on button and the wireless connection flag bit is true: the first lamp state mark position is used for sending a lamp turning-on instruction to a second wireless connection module of the lamp through a wireless connection module of the smart phone, and a lamp turning-on button is changed into a lamp turning-off button; if the user clicks the light off button: the lamp state flag position is set to be zero, a lamp turning-off instruction is sent to a second wireless connection module of the lamp through a wireless connection module of the smart phone, and a lamp turning-off button is changed into a lamp turning-on button; if the user presses the brightness increase button: continuously sending a brightness increase instruction to a wireless connection module II of the lamp at an interval time T _ step3 through a wireless connection module I of the smart phone until the finger of the user is monitored to be lifted; if the user presses the brightness reduction button: and continuously sending a brightness reduction instruction to a wireless connection module II of the lamp at an interval time T _ step3 through the wireless connection module I of the smart phone until the lifting of the finger of the user is monitored.
The corresponding control buttons are displayed on the front console control panel, so that the control is simple and convenient, when the lamp state is switched, the buttons on the control panel are switched along with the switching, the function of prompting the current lamp state of a user is achieved, when the user adjusts the lamp brightness, the control instruction is sent to the lamp circularly and continuously at a certain interval time, the lamp can be gradually lightened or darkened, when the circulating step length is small enough, the stepless dimming effect can be formed, and the user can find the optimal brightness of the lamp.
Preferably, the wireless connection module is a bluetooth module. Can realize the direct communication connection of smart mobile phone and lamps and lanterns through bluetooth module, convenient and fast.
Preferably, the set values T _ set1 and T _ set2 both range from 500ms to 3000 ms; the interval time T step1 ranges from 20 to 100 ms.
Preferably, the set values T _ set1 and T _ set2 are both 1000 ms; the value of the interval time T step1 is 50 ms.
The power key is used twice within 1000ms, so that most of smart phones can complete twice screen state switching, background services can capture screen state changes, and control over the lamp is triggered. When the time is less than 500ms, part of mobile phones cannot complete screen state switching in time, so that background service work is unstable; the interval time higher than 3000ms is too long, when a user wants to control the mobile phone to lock and unlock the screen, the user still judges that the mobile phone is controlled by the lamp, and troubles are caused to the user. The cycle period of 20-100ms can make the brightness change of the lamp more stable, and is convenient for a user to find out the optimal brightness.
Preferably, the range of the set value T _ set3 is 500-3000 ms; the interval time T _ step2 is in the range of 20-100 ms; the time t _ short ranges from 2000-.
Preferably, the set value T _ set3 has a value of 1000 ms; the value of the interval time T _ step2 is 50 ms; the time t _ short has a value of 3000 ms.
Most mobile phone models can complete fingerprint matching within 1000ms, if the time is too short, the mobile phone is not ready to identify the fingerprint and background service cannot monitor the information of successful fingerprint identification for the second time within the set interval time if the time is less than 500ms, and if the time exceeds 3000ms, interference is caused to the user using a fingerprint identification sensor in other application scenes, and the use experience of the user is influenced.
Preferably, the interval time T step3 is in the range of 20-100 ms. The cycle period of 20-100ms can enable the brightness of the lamp to change stably, the effect of approximately stepless dimming is achieved, and users can find the best brightness conveniently.
The substantial effects of the invention are as follows: the control of the lamp on-off and dimming by using the background of the smart phone is realized by multiplexing the power key of the smart phone, the volume key and the fingerprint identification sensor and establishing background service, so that the control of the smart phone on the lamp is further facilitated and simplified.
Drawings
Fig. 1 is a flow chart of a quick and simple method for controlling light by a mobile phone.
Detailed Description
The following provides a more detailed description of the present invention, with reference to the accompanying drawings.
Fig. 1 is a flow chart of a fast and simple method for controlling lighting of a mobile phone, which starts with a client program installed and run for the first time by a user, and displays a foreground control panel for the user and responds to foreground control after the client program runs, and registers and runs a background service and responds to background control.
The foreground control panel includes: the light-on button, the brightness-increasing button and the brightness-decreasing button respond to the control of the user foreground and comprise the following steps:
1) displaying a foreground control panel;
2) the lamp state flag bit and the wireless connection flag bit are set to zero, and the touch screen action of a user is monitored;
3) calling a first wireless connection module on the smart phone, searching and trying to connect a second wireless connection module on the lamp, if the connection is successful, prompting a user that the wireless connection is successful and marking the first wireless connection, and if the connection is failed, reporting an error and marking the position of the first wireless connection;
4) when the user touch screen action is monitored, judging the touch screen position of the user, and if the user clicks a light-on button and the wireless connection flag bit is true: the first lamp state mark position is used for sending a lamp turning-on instruction to a second wireless connection module of the lamp through a wireless connection module of the smart phone, and a lamp turning-on button is changed into a lamp turning-off button; if the user clicks the light off button: the lamp state flag position is set to be zero, a lamp turning-off instruction is sent to a second wireless connection module of the lamp through a wireless connection module of the smart phone, and a lamp turning-off button is changed into a lamp turning-on button; if the user presses the brightness increase button: continuously sending a brightness increase instruction to a wireless connection module II of the lamp at an interval time T _ step3 through a wireless connection module I of the smart phone until the finger of the user is monitored to be lifted; if the user presses the brightness reduction button: and continuously sending a brightness reduction instruction to a wireless connection module II of the lamp at an interval time T _ step3 through the wireless connection module I of the smart phone until the lifting of the finger of the user is monitored. The preferred interval time T step3 is in the range of 20-100 ms.
The corresponding control buttons are displayed on the front console control panel, so that the control is simple and convenient, when the lamp state is switched, the buttons on the control panel are switched along with the switching, the function of prompting the current lamp state of a user is achieved, when the user adjusts the lamp brightness, the control instruction is sent to the lamp circularly and continuously at a certain interval time, the lamp can be gradually lightened or darkened, when the circulating step length is small enough, the stepless dimming effect can be formed, and the user can find the optimal brightness of the lamp.
The background service response background control comprises key background control and fingerprint identification background control, wherein the key background control comprises the following steps:
1) when the change of the screen state is monitored, comparing the current system time with Timer1, and if the difference is less than a set value T _ set1, updating Timer1 to the current system time; if the value is larger than or equal to the set value T _ set1, entering a step D2;
2) checking the wireless connection flag bit, if yes, entering step D3; if the number of the wireless connection signs is zero, calling a first wireless connection module on the smart phone, searching and trying to connect a second wireless connection module on the lamp, if the connection is successful, entering the step D3 together with the position of the wireless connection sign, and if the connection is failed, reporting an error and exiting the process;
3) checking the lamp state flag bit, if the lamp state flag bit is a first lamp state flag bit, sending a lamp turning-off instruction to a second wireless connection module of the lamp through the wireless connection module of the mobile phone, and setting the lamp state flag bit to zero; if the current value is zero, sending a lamp turning-on instruction to a second wireless connection module of the lamp through the wireless connection module of the mobile phone, and marking the first state of the lamp at a first position; updating Timer2 to be the current mobile phone system time;
4) when the volume key is pressed, if the screen state flag bit is zero, sending a light-on instruction to a wireless connection module II of a lamp through a wireless connection module of the mobile phone and marking the screen state flag bit at a first position, and then continuously sending a brightness increase or decrease instruction at an interval time T _ step1 until the volume key is lifted; if the screen state flag bit is one, calculating the difference value between the current time of the system and the Timer2, and if the difference value is less than or equal to a set value T _ set2, continuously sending a brightness increase or decrease instruction at an interval T _ step1 until the volume key is monitored to be lifted; wherein, the volume key + corresponds to the brightness increasing instruction, and the volume key-corresponds to the brightness decreasing instruction.
The technical difficulty of controlling the lamp through the background of the smart phone lies in how to distinguish whether a user wants to control the phone or the lamp by using a mobile phone key, whether a mobile phone screen is in a screen locking state is identified by setting a screen state flag bit, when the mobile phone screen is in the screen locking state, the use of a volume key can be determined as that the user wants to control the lamp, at the moment, the volume key corresponds to the adjustment of the lamp light of the lamp, and if the lamp is in a closing state, the lamp is firstly turned on; when the mobile phone is in an unlocking or screen-opening state, the power key is continuously used twice, namely the interval time is less than or equal to T _ set1, the user is judged to wish to switch the on and off of the lamp, and a period of extension time is reserved for the user to adjust the brightness of the lamp because the user just operates the lamp, so that when the mobile phone is in the unlocking or screen-opening state, the user uses the volume key and successfully operates the control of the lamp before the time T _ set2, the user is judged to wish to control the lamp.
The ranges of the preferable setting values T _ set1 and T _ set2 are both 500-3000 ms; the interval time T step1 ranges from 20 to 100 ms. Further preferably, the set values T _ set1 and T _ set2 are both 1000 ms; the value of the interval time T step1 is 50 ms. The power key is used twice within 1000ms, so that most of smart phones can complete twice screen state switching, background services can capture screen state changes, and control over the lamp is triggered. When the time is less than 500ms, part of mobile phones cannot complete screen state switching in time, so that background service work is unstable; the interval time higher than 3000ms is too long, when a user wants to control the mobile phone to lock and unlock the screen, the user still judges that the mobile phone is controlled by the lamp, and troubles are caused to the user. The cycle period of 20-100ms can make the brightness change of the lamp more stable, and is convenient for a user to find out the optimal brightness.
The fingerprint identification background control comprises the following steps:
1) establishing a new thread in the service, setting a numerical variable Num1 and setting an initial value to be 0, circularly monitoring the state of the fingerprint identification sensor at intervals of time T in the thread, circularly detecting whether the finger of the user leaves the fingerprint identification sensor when the fingerprint matching is successfully monitored, entering a step E2 if the finger of the user leaves the fingerprint identification sensor within time T _ short, and entering a step E3 if the finger of the user is still on the fingerprint identification sensor after the time of T _ short is exceeded;
2) comparing the system time with the Timer3, and if the difference is greater than a set value T _ set3, updating the Timer3 to be the current system time; if the difference is smaller than or equal to a set value T _ set3, checking the lamp state flag bit, if the difference is one, sending a lamp turning-off instruction to the wireless connection module II of the lamp through the wireless connection module of the mobile phone and setting the lamp state flag bit to zero, if the difference is zero, sending a lamp turning-on instruction to the wireless connection module II of the lamp through the wireless connection module of the mobile phone and setting the lamp state flag bit to one, and updating the Timer3 to be the current system time;
3) checking the lamp state flag bit, if the lamp state flag bit is zero, sending a lamp turning-on command to a wireless connection module II of the lamp through a wireless connection module of the mobile phone, checking the value of a variable Num1 at the position I of the lamp state flag bit, if the value of Num1 is less than N, continuously sending a brightness increase command to the wireless connection module II of the lamp through the wireless connection module of the mobile phone at an interval T _ step2 and increasing the value of Num1 by 1 until the monitored fingerprint identification sensor function monitors that the finger of the user leaves the fingerprint identification sensor or the value of Num1 is equal to N, if the value of Num1 is greater than or equal to N, a brightness reduction command is continuously sent to the wireless connection module II of the lamp through the wireless connection module of the mobile phone at an interval T _ step2, and the value of Num1 is reduced from 1 at the same time until the fingerprint identification sensor function is monitored to monitor that the finger of the user leaves the fingerprint identification sensor or the value of Num1 is equal to 0.
When a user continuously carries out fingerprint identification twice and the time of touching the fingerprint identification sensor by a finger is short, judging that the user wants to switch on/off the lamp, when the finger of the user touches the fingerprint identification sensor for a long time, judging whether the current lamp is in a closing device or not, if so, firstly opening the lamp, then judging whether the lamp is in the maximum brightness or not, if so, circularly reducing the brightness by steps until the brightness is reduced to the minimum brightness or the finger of the user leaves the fingerprint sensor, and if not, circularly increasing the brightness by steps until the brightness is increased to the maximum brightness or the finger of the user leaves the fingerprint sensor.
The range of the setting value T _ set3 as a preferable range is 500-3000 ms; the interval time T _ step2 is in the range of 20-100 ms; the time t _ short ranges from 2000-. Further, the value of the set value T _ set3 as a preferable value is 1000 ms; the value of the interval time T _ step2 is 50 ms; the time t _ short has a value of 3000 ms. Most mobile phone models can complete fingerprint matching within 1000ms, if the time is too short, the mobile phone is not ready to identify the fingerprint and background service cannot monitor the information of successful fingerprint identification for the second time within the set interval time if the time is less than 500ms, and if the time exceeds 3000ms, interference is caused to the user using a fingerprint identification sensor in other application scenes, and the use experience of the user is influenced.
The process of the dimmable lamp with the wireless connection module responding to the control of the smart phone is as follows:
1) the lamp microcontroller circularly reads the information received by the wireless connection module II;
2) if the lamp-on information is received, the power supply of the lamp is switched on; if the lamp is turned off, the power supply of the lamp is cut off; if the brightness is increased or decreased, the value of the dimming module is correspondingly changed according to the step length; the value of the dimming module is maintained when the fixture reaches a maximum or minimum brightness.
The above-described embodiments are only preferred embodiments of the present invention, and are not intended to limit the present invention in any way, and other variations and modifications may be made without departing from the spirit of the invention as set forth in the claims.

Claims (8)

1. A quick and simple mobile phone light control method is suitable for a smart phone to control a dimmable lamp with a wireless connection module, and is characterized by comprising the following steps:
A. the user installs and enters the client software, displays the foreground control panel and responds to the user foreground control;
B. registering background service and responding to background control, comprising the following steps:
B1. monitoring a volume key, a screen state and a fingerprint identification sensor, setting a screen state flag bit, a lamp state flag bit and a wireless connection flag bit to be zero, and setting three variables for recording time as Timer1, Timer2 and Timer 3;
B2. after the service is operated, the change of the screen state is monitored for the first time, the Timer1 is updated to be the current system time, the screen state flag position is zero if the screen is locked, and the screen state flag position is one if the screen is unlocked or unlocked;
B3. carrying out key control on the lamp by monitoring a volume key and a screen state according to the screen state zone bit, the lamp state zone bit and the wireless connection zone bit; fingerprint identification control is carried out on the lamp by monitoring a fingerprint identification sensor;
C. the lamp microcontroller circularly reads the information received by the wireless connection module II, and if the lamp is turned on, the lamp power supply is switched on; if the lamp is turned off, the power supply of the lamp is cut off; if the brightness is increased or decreased, the value of the dimming module is correspondingly changed according to the step length; maintaining the value of the dimming module when the lamp reaches the highest or lowest brightness;
the key control of the lamp comprises the following steps:
D1. when the change of the screen state is monitored, comparing the current system time with Timer1, and if the difference is less than a set value T _ set1, updating Timer1 to the current system time; if the value is larger than or equal to the set value T _ set1, entering a step D2;
D2. checking the wireless connection flag bit, if yes, entering step D3; if the number of the wireless connection signs is zero, calling a first wireless connection module on the smart phone, searching and trying to connect a second wireless connection module on the lamp, if the connection is successful, entering the step D3 together with the position of the wireless connection sign, and if the connection is failed, reporting an error and exiting the process;
D3. checking the lamp state flag bit, if the lamp state flag bit is a first lamp state flag bit, sending a lamp turning-off instruction to a second wireless connection module of the lamp through the wireless connection module of the mobile phone, and setting the lamp state flag bit to zero; if the current value is zero, sending a lamp turning-on instruction to a second wireless connection module of the lamp through the wireless connection module of the mobile phone, and marking the first state of the lamp at a first position; updating Timer2 to be the current mobile phone system time;
D4. when the volume key is pressed, if the screen state flag bit is zero, sending a light-on instruction to a wireless connection module II of a lamp through a wireless connection module of the mobile phone and marking the screen state flag bit at a first position, and then continuously sending a brightness increase or decrease instruction at an interval time T _ step1 until the volume key is lifted; if the screen state flag bit is one, calculating the difference value between the current time of the system and the Timer2, and if the difference value is less than or equal to a set value T _ set2, continuously sending a brightness increase or decrease instruction at an interval T _ step1 until the volume key is monitored to be lifted; wherein, the volume key + corresponds to a brightness increasing instruction, and the volume key-corresponds to a brightness decreasing instruction;
the fingerprint identification control of the lamp comprises the following steps:
E1. establishing a new thread in the service, setting a numerical variable Num1 and setting an initial value to be 0, circularly monitoring the state of the fingerprint identification sensor at intervals of time T in the thread, circularly detecting whether the finger of the user leaves the fingerprint identification sensor when the fingerprint matching is successfully monitored, entering a step E2 if the finger of the user leaves the fingerprint identification sensor within time T _ short, and entering a step E3 if the finger of the user is still on the fingerprint identification sensor after the time of T _ short is exceeded;
E2. comparing the system time with the Timer3, and if the difference is greater than a set value T _ set3, updating the Timer3 to be the current system time; if the difference is smaller than or equal to a set value T _ set3, checking the lamp state flag bit, if the difference is one, sending a lamp turning-off instruction to the wireless connection module II of the lamp through the wireless connection module of the mobile phone and setting the lamp state flag bit to zero, if the difference is zero, sending a lamp turning-on instruction to the wireless connection module II of the lamp through the wireless connection module of the mobile phone and setting the lamp state flag bit to one, and updating the Timer3 to be the current system time;
E3. checking the lamp state flag bit, if the lamp state flag bit is zero, sending a lamp turning-on command to a wireless connection module II of the lamp through a wireless connection module of the mobile phone, checking the value of a variable Num1 at the position I of the lamp state flag bit, if the value of Num1 is less than N, continuously sending a brightness increase command to the wireless connection module II of the lamp through the wireless connection module of the mobile phone at an interval T _ step2 and increasing the value of Num1 by 1 until the monitored fingerprint identification sensor function monitors that the finger of the user leaves the fingerprint identification sensor or the value of Num1 is equal to N, if the value of Num1 is greater than or equal to N, a brightness reduction command is continuously sent to the wireless connection module II of the lamp through the wireless connection module of the mobile phone at an interval T _ step2, and the value of Num1 is reduced from 1 at the same time until the fingerprint identification sensor function is monitored to monitor that the finger of the user leaves the fingerprint identification sensor or the value of Num1 is equal to 0.
2. The method for controlling light of mobile phone according to claim 1,
the responding user foreground control comprises the following steps:
f1, displaying a foreground control panel, wherein the foreground control panel comprises the following buttons: a light-on button, a brightness-increasing button, and a brightness-decreasing button;
f2, setting the lamp state flag bit and the wireless connection flag bit to zero, and monitoring the touch action of a user;
f3, calling the first wireless connection module on the smart phone, searching and trying to connect the second wireless connection module on the lamp, if the connection is successful, prompting the user that the wireless connection is successful, connecting the first wireless connection with the first mark position, and if the connection is failed, reporting an error, and setting the first wireless connection with the mark position to zero;
f4, when the user touch action is monitored, judging the touch screen position of the user, and if the user clicks the light-on button and the wireless connection flag bit is true: the first lamp state mark position is used for sending a lamp turning-on instruction to a second wireless connection module of the lamp through a wireless connection module of the smart phone, and a lamp turning-on button is changed into a lamp turning-off button; if the user clicks the light off button: the lamp state flag position is set to be zero, a lamp turning-off instruction is sent to a second wireless connection module of the lamp through a wireless connection module of the smart phone, and a lamp turning-off button is changed into a lamp turning-on button; if the user presses the brightness increase button: continuously sending a brightness increase instruction to a wireless connection module II of the lamp at an interval time T _ step3 through a wireless connection module I of the smart phone until the finger of the user is monitored to be lifted; if the user presses the brightness reduction button: and continuously sending a brightness reduction instruction to a wireless connection module II of the lamp at an interval time T _ step3 through the wireless connection module I of the smart phone until the lifting of the finger of the user is monitored.
3. The method for controlling light of mobile phone according to claim 1,
the wireless connection module is a Bluetooth module.
4. The method for controlling light of mobile phone according to claim 1,
the ranges of the set values T _ set1 and T _ set2 are both 500-3000 ms; the interval time T step1 ranges from 20 to 100 ms.
5. The method for controlling light of mobile phone according to claim 1,
the set values T _ set1 and T _ set2 are both 1000 ms; the value of the interval time T step1 is 50 ms.
6. The method for controlling light of mobile phone according to claim 1,
the range of the set value T _ set3 is 500-3000 ms; the interval time T _ step2 is in the range of 20-100 ms; the time t _ short ranges from 2000-.
7. The method for controlling light of mobile phone according to claim 1,
the set value T _ set3 has a value of 1000 ms; the value of the interval time T _ step2 is 50 ms; the time t _ short has a value of 3000 ms.
8. A quick and easy method for controlling light by mobile phone according to claim 2,
the interval time T step3 ranges from 20 to 100 ms.
CN201711091710.XA 2017-11-08 2017-11-08 Quick and simple method for controlling light by mobile phone Active CN107995355B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711091710.XA CN107995355B (en) 2017-11-08 2017-11-08 Quick and simple method for controlling light by mobile phone

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711091710.XA CN107995355B (en) 2017-11-08 2017-11-08 Quick and simple method for controlling light by mobile phone

Publications (2)

Publication Number Publication Date
CN107995355A CN107995355A (en) 2018-05-04
CN107995355B true CN107995355B (en) 2020-10-16

Family

ID=62030765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711091710.XA Active CN107995355B (en) 2017-11-08 2017-11-08 Quick and simple method for controlling light by mobile phone

Country Status (1)

Country Link
CN (1) CN107995355B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114740744A (en) * 2022-04-25 2022-07-12 歌尔股份有限公司 Method and device for controlling smart home, wearable product and medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104503688B (en) * 2014-12-31 2018-03-02 小米科技有限责任公司 The control method and device of intelligent hardware devices
TWI611379B (en) * 2015-03-27 2018-01-11 寶貝安科技股份有限公司 Remote controlling method for lamp
CN114167743A (en) * 2015-10-30 2022-03-11 安定宝公司 Wearable control device, control system and method for controlling controlled electric appliance
CN106933111B (en) * 2017-02-28 2020-10-30 北京小米移动软件有限公司 Method and device for controlling equipment

Also Published As

Publication number Publication date
CN107995355A (en) 2018-05-04

Similar Documents

Publication Publication Date Title
CN104735878B (en) A kind of wearable illuminator control device and illuminator control system
CN110268805B (en) Load control system for controlling an electrical load group
CN104812131B (en) A kind of intelligent electrical control system
CN103491676B (en) A kind of Bluetooth remote control-type LED color lamp device and control method
US20140203939A1 (en) Control and monitoring of light-emitting-diode (led) bulbs
US11569818B2 (en) Load control device having a capacitive touch surface
CN112673714A (en) Control device configured to provide visual feedback
CN105137774A (en) Intelligent household appliance control method, device and mobile terminal
CN108735170B (en) Screen backlight control method and remote controler
CN207489235U (en) Switch device with auxiliary power unit and wireless receiving function and lamp system thereof
CN112913332A (en) Controlling an electrical load group
CN109067971B (en) Method for automatically turning on flashlight by shaking mobile phone in dark environment
CN204539560U (en) A kind of wearable lighting control device and lighting control system
CN107360654B (en) A kind of LED light-dimming method and system
CN205191830U (en) But voice broadcast's remote controller of an air conditioner
CN107995355B (en) Quick and simple method for controlling light by mobile phone
CN103687229B (en) LED controller compatible with multifunctional remote controller
CN104661412A (en) Intelligent dimming illumination system and auxiliary remote controller thereof as well as control method of lamp
CN103716944A (en) Lighting control device, lighting control system and lighting control method
CN210781434U (en) Automatic induction lighting device
CN205648073U (en) Response lighting device that low order luminance can be regulated and control
CN111262763A (en) Intelligent household equipment control system and method based on live-action picture
KR102054350B1 (en) Systems and methods for lighting control using a wireless dimmer
CN208937935U (en) A kind of Multimode Intelligent scenery control system
CN115769677A (en) Load control device responsive to non-contact actuation

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
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: No.12 tingchao Road, Jianshan New District, Haining City, Jiaxing City, Zhejiang Province

Patentee after: Zhejiang kaiyao Lighting Co.,Ltd.

Address before: No.12 tingchao Road, Jianshan New District, Haining City, Jiaxing City, Zhejiang Province

Patentee before: ZHEJIANG KLITE LIGHTING HOLDINGS Co.,Ltd.

CP01 Change in the name or title of a patent holder