A kind of desk lamp control system and its control method
Technical field
The invention belongs to field of intelligent control technology, more particularly to a kind of desk lamp control system and its control method.
Background technology
Desk lamp is the common household electrical appliance for being used for illuminating in people's life, commonly used in bending over one's desk working for night.LED desk lamp
Light source usually collectively constituted by multiple LED lamp beads, when user leaves the illumination range of desk lamp, that is, user is not
When using LED desk lamp, all LED lamp beads, which are all lighted, will cause energy waste, and also some people custom, which shines light, to sleep, when
Desk lamp has not been needed when in sleep state, but desk lamp is also working, cause the reduction of desk lamp service life and the energy
Waste.
Chinese patent CN201210345055.7 provides intelligent desk lamp control method, by the working time and judges desk lamp week
Enclose whether someone is turned on and off desk lamp, but in actual conditions many people enter sleep to forget to close due to too tired lamp
Close desk lamp, such situation system can not just solve, so when inventing a kind of desk lamp of intelligent decision demand very it is necessary to
's.
Invention content
Present invention aims at a kind of desk lamp control system of offer and its control methods.
A kind of desk lamp control system and its control method, include the following steps,
Step 1:Desk lamp is opened, activation system, obtains the time, and the period is to skip to step 2 at night;
Step 2:Detect room whether someone, detect that someone then skips to step 3, someone be not detected and then skips to step 4;
Step 3:Start camera and obtains coordinate residing for human body head in room(X,Y), preserve to processor and skip to step
Five;
Step 4:Whether human body signal is detected in room, in detection time T if human body letter is not detected in time T inner room
Number step 11 is then skipped to, step 3 is skipped to if detecting human body signal in time T inner room;
Step 5:Start the human body detection device at the head of a bed, detects within the scope of bed whether detect human body signal, if detecting people
Body signal then skips to step 6, modulation step seven if human body signal is not detected;
Step 6:A human body head coordinate is obtained every time T1(X1,Y1), calculate the absolute difference of coordinate twice | X1-
X | with | Y1-Y |, wherein(X1,Y1)Value assigns(X,Y), judging two absolute differences, wherein whether there are one be more than institute above
Set predetermined threshold value, if two coordinate differences be more than predetermined threshold value if repeat step 6, if two coordinate differences be less than it is default
Determine threshold value and then skip to step 8, step 4 is skipped to if it can not obtain human body head coordinate;
Step 7:A human body head coordinate is obtained every time T1(X1,Y1), calculate the absolute difference of coordinate twice | X1-
X | with | Y1-Y |, wherein(X1,Y1)Value assigns(X,Y), judging two absolute differences, wherein whether there are one be more than institute above
Set predetermined threshold value, if two coordinate differences be more than predetermined threshold value if repeat step 7, if two coordinate differences be less than it is default
Determine threshold value and then skip to step 9, step 4 is skipped to if it can not obtain human body head coordinate;
Step 8:Processor reduces a desk lamp LED10% voltage duty cycle every the T2 times, judges voltage duty cycle at 10%
Whether reset key has triggering before, and step 10 is skipped to if having triggering between 10%, if not there is triggering reset key to skip to
Step 11;
Step 9:Processor reduces a desk lamp LED10% voltage duty cycle every the T3 times, judges voltage duty cycle at 10%
Whether reset key has triggering before, and step 10 is skipped to if having triggering between 10%, if not there is triggering reset key to skip to
Step 11;
Step 10:Processor adjustable desk lamp LED voltage duty ratio is to 100% and skips to step 1;
Step 11:Desk lamp is closed, step 1 is skipped to after waiting for desk lamp to open.
Wherein, desk lamp connects clock module, and for judging residing period on whether non-daytime or night, detected value is sent out
It send to processor.
Wherein, two human body detection devices, an entire room range of detection, another detection room are placed in room
Range residing for bed.
Wherein, it is placed there are two high-definition camera in room, be individually positioned in room highest point two are diagonal, for examining
Coordinate value residing for the interior people of measuring room, and it is sent to processor.
Wherein, the non-10min ~ 30min of the detection range of time T.
Wherein,(X1,Y1)With(X,Y)Absolute value differences given threshold be 1 ~ 5.
Wherein, the non-5min ~ 10min of the detection range of time T1.
Wherein, the setting value of time T2 is 3min.
Wherein, the value set by time T3 is 5min.
Wherein, system is for one-man in single room or room.
Advantageous effect:
The present invention is according to user's specific location in the room, and is identified and judged in the head of processor by high-definition camera shooting
Whether user is moved excessively within a certain period of time, energy saving to a certain extent to judge whether to need to close desk lamp.
Description of the drawings
Fig. 1 is the flow chart of a kind of desk lamp control system of the present invention and its control method.
Fig. 2 is the structure chart of a kind of desk lamp control system of the present invention and its control method.
Specific implementation mode
As shown in Figs. 1-2, a kind of desk lamp control system and its control method include human detection module, high-definition camera mould
Block, controller, system judge the main positions of user in the room by human detection module, are judged by high-definition camera module
Whether be moved through in user's certain time, if in certain time user be carry out it is mobile by adjustable desk lamp LED stimulate user into
Row judges whether user is in sleep state, a kind of closing desk lamp control system and its controlling party of the processor in operation desk lamp
Method includes the following steps,
Step 1:Desk lamp is opened, activation system, obtains the time, and the period is to skip to step 2 at night;
Step 2:Detect room whether someone, detect that someone then skips to step 3, someone be not detected and then skips to step 4;
Step 3:Start camera and obtains coordinate residing for human body head in room(X,Y), preserve to processor and skip to step
Five;
Step 4:Whether human body signal is detected in room, in detection time T if human body letter is not detected in time T inner room
Number step 11 is then skipped to, step 3 is skipped to if detecting human body signal in time T inner room;
Step 5:Start the human body detection device at the head of a bed, detects within the scope of bed whether detect human body signal, if detecting people
Body signal then skips to step 6, modulation step seven if human body signal is not detected;
Step 6:A human body head coordinate is obtained every time T1(X1,Y1), calculate the absolute difference of coordinate twice | X1-
X | with | Y1-Y |, wherein(X1,Y1)Value assigns(X,Y), judging two absolute differences, wherein whether there are one be more than institute above
Set predetermined threshold value, if two coordinate differences be more than predetermined threshold value if repeat step 6, if two coordinate differences be less than it is default
Determine threshold value and then skip to step 8, step 4 is skipped to if it can not obtain human body head coordinate;
Step 7:A human body head coordinate is obtained every time T1(X1,Y1), calculate the absolute difference of coordinate twice | X1-
X | with | Y1-Y |, wherein(X1,Y1)Value assigns(X,Y), judging two absolute differences, wherein whether there are one be more than institute above
Set predetermined threshold value, if two coordinate differences be more than predetermined threshold value if repeat step 7, if two coordinate differences be less than it is default
Determine threshold value and then skip to step 9, step 4 is skipped to if it can not obtain human body head coordinate;
Step 8:Processor reduces a desk lamp LED10% voltage duty cycle every the T2 times, judges voltage duty cycle at 10%
Whether reset key has triggering before, and step 10 is skipped to if having triggering between 10%, if not there is triggering reset key to skip to
Step 11;
Step 9:Processor reduces a desk lamp LED10% voltage duty cycle every the T3 times, judges voltage duty cycle at 10%
Whether reset key has triggering before, and step 10 is skipped to if having triggering between 10%, if not there is triggering reset key to skip to
Step 11;
Step 10:Processor adjustable desk lamp LED voltage duty ratio is to 100% and skips to step 1;
Step 11:Desk lamp is closed, step 1 is skipped to after waiting for desk lamp to open.
Desk lamp connects clock module, and for judging residing period on whether non-daytime or night, detected value is sent to
Processor, is placed with two human body detection devices in room, an entire room range of detection, residing for another detection room bed
Range, place there are two high-definition camera in room, be individually positioned in room highest point two are diagonal, for detecting room
Coordinate value residing for interior people, and it is sent to processor.
Non- 10min ~ the 30min of detection range of time T,(X1,Y1)With(X,Y)Absolute value differences given threshold be 1 ~ 5.
Non- 5min ~ the 10min of detection range of time T1.The setting value of time T2 is 3min, and the value set by time T3 is 5min, system
For one-man in single room or room.
The specific embodiment of system is:When desk lamp is opened, system obtains the time signal of clock module automatically, when judging this
Between section be evening when, for the first time detect room in whether presence of people, if nobody presence, give a period
Judge whether someone comes in the time, which is usually set to 10 minutes to 30 minutes or so, if detecting room
Someone opens two, room high-definition camera, room images shooting is sent to processor, processor is known by digital processing
Others' head, and calculate the coordinate points residing for head(X, y), start the human body detection device at the head of a bed, judge that user is
In bed or outside bed, if user is in bed with five minutes to a head coordinate is very obtained, judge that head is sat twice
If target difference judges that user is in waking state, if difference if difference judges user just during exercise 5 or more
Judge that user may be for sleep state at 5 times one, at this moment processor control desk lamp lowered a desk lamp voltage with every 3 minutes and accounts for
Empty ratio, if user presses reset key, desk lamp luminance recovery original state, system detectio user's head before duty ratio drops to 0
Coordinate simultaneously judged, is set out not yet reset key if dropping to 0, and system closes desk lamp, waits for the unlatching next time of desk lamp, when
When on user's no longer bed, system obtained a head coordinate with five minutes to ten minutes, judged the difference of head coordinate twice
Value, if if difference judges user just during exercise 5 or more, judges that user is in waking state, if difference is under 5
One judges that user may be for sleep state, and at this moment processor control desk lamp lowered a desk lamp voltage duty cycle with every 3 minutes,
If user presses reset key before duty ratio drops to 0, desk lamp luminance recovery original state, system detectio user's head coordinate is simultaneously
Judged, set out not yet reset key if dropping to 0, system closes desk lamp, waits for the unlatching next time of desk lamp.