Switch and alarm method with warning function
Technical field
The invention belongs to the Smart Home field, particularly relate to a kind of switch and alarm method with warning function.
Background technology
The metope switch that present family generally uses, be that the break-make of directly controlling forceful electric power (generally being that 220V exchanges) mechanically reaches the purpose of controlling light fixture or other electrical equipment, though the metope switch has brought many convenience to the user in the quite a long time in the past, but progress and development of times along with science and technology, deficiency has wherein also embodied, especially further developing along with the Smart Home technology, and the change of people's philosophy of life, the metope switch has become the existence of an intimate chicken ribs.Traditional switch does not have distant control function, and the more big operation in room is just more inconvenient, causes and turns off the light untimely and expense; Traditional switch hard contact opening and closing easily produce electric arc and spark simultaneously, influence the serviceable life of switch.
Along with people's living material level improves and the aging population aggravation, increasing Smart Home product is subjected to society's favor.At present, a lot of intelligent switch products occur, light-operated, acoustic control, telepilot and various ways such as mobile phone and network control are arranged, but most of function singleness can only realize the order of switch lamp.
Meet accident and in time to call for help when preventing that family from having the people, comprise that the elderly solitaryly can in time relate to the household when uncomfortable, can not realized warning etc. by the robber when family meets with house robbery, a lot of safety-protection systems have also appearred now, but these safety-protection systems all are automatic inductions, though also can play anti-robbery's effect to a certain extent, in case when not comprising special warning scene during warning arranges, just can't in time report to the police.
Summary of the invention
Because the above-mentioned defective of prior art, technical matters to be solved by this invention provides a kind of intelligent switch that can realize warning function, and can breaking at civil power, afterwards a period of time also can report to the police.
Another technical matters that the present invention will solve provide a kind of can carry out accurately convenient, the disguised high alarm method based on the switch with warning function.
For achieving the above object, the invention provides a kind of switch with warning function, comprise the forceful electric power plate interface, trigger button, central processing unit, power module and accumulation of energy supply module; First output terminal of described central processing unit is connected with described forceful electric power plate interface, the output terminal of described triggering button connects the first input end of described central processing unit, second output terminal of described central processing unit connects the input end of wireless communication module, the output terminal of described wireless communication module connects second input end of described central processing unit, described wireless communication module is connected with antenna, and described wireless communication module carries out wireless data transceiving by described antenna; Described power module is used for converting electric main to direct supply and exporting to described accumulation of energy supply module and charge; Described accumulation of energy supply module is to described central processing unit and wireless communication module power supply.
During use, central processing unit detects the triggering button and presses, central processing unit is given the on-off circuit of forceful electric power plate by forceful electric power plate interface transmission level signal then, to control this on-off circuit closure, the forceful electric power plate is powered to electrical appliance, when detecting, central processing unit triggers time that button presses during greater than setting-up time, central processing unit sends a signal to wireless communication module, wireless communication module sends wireless alarm signal by antenna, simultaneously, wireless communication module can also receive the wireless switching signal by antenna, wireless communication module sends the switching signal that receives to central processing unit then, central processing unit receive transmission level signal controlling forceful electric power plate behind the wireless switching signal the on-off circuit closure so that the forceful electric power plate power to electrical appliance.When mains failure, the accumulation of energy supply module is to described central processing unit and wireless communication module power supply, in order to can send the emergent alarm signal when running into emergency case.Owing to adopt above technical scheme, the present invention can use as switch, realized a key warning function simultaneously, perfect family's safety-protection system, installation site of the present invention is fixed, within reach, for there being old, weak, sick family to erect security perimeter one, allow more family and people's group energy enjoy comfortable and happy that Smart Home brings, simultaneously, do not having to have ensured emergent alarm under special circumstances by the accumulation of energy supply module to central processing unit and wireless communication module emergency service under the situation of civil power.
Further, also comprise the lamp band; The 3rd output terminal of described central processing unit connects the input end of described lamp band; Described accumulation of energy supply module is powered to described lamp band.Central processing unit transmission level signal conduction lamp band makes it shinny, can play suggesting effect, under the more situation of switch, can allow the people find corresponding gauge tap fast and accurately, very convenient and hommization, the lamp band can also play the effect of beautifying and decorating simultaneously.
Preferable, described lamp band is LED lamp band.LED lamp band softness can be curling as electric wire, can shear and receive, and is convenient to be combined with switch, and simultaneously LED lamp tape insulation, water resistance are good, use safety, is difficult for breaking, long service life.
Further, also comprise external data interface; The output terminal of described external data interface connects the 3rd input end of described central processing unit, and central processing unit can connect various sensors by external data interface, uploads the data that various sensors spread out of in order to gather.
Preferable, described wireless communication module is the zigbee communication module.The Zigbee communication compares that other wireless telecommunications have that power consumption is lower, cost is lower, support great deal of nodes and multiple network topology, complexity is lower, advantage faster fast.
The present invention also provides a kind of alarm method based on the switch with warning function, may further comprise the steps:
Step 1, central processing unit carry out initialization; Connecting the port that triggers button on the central processing unit is set to draw input and negative edge to interrupt;
Step 2, when central processing unit detects negative edge and interrupts, connects the port that triggers button on the central processing unit and be set to rising edge and interrupt, and central processing unit picks up counting; When detecting the rising edge interruption, connect the port that triggers button on the central processing unit and be set to the negative edge interruption, central processing unit stops timing;
Whether the time that step 3, judgement triggering button are pressed surpasses setting-up time, when the time that the triggering button is pressed surpasses setting-up time, central processing unit sends a signal to wireless communication module, and described wireless communication module sends wireless alarm signal by antenna and gives upper terminal; Surpass setting-up time when the time that the triggering button is pressed, central processing unit sends a signal to wireless communication module, described wireless communication module sends the wireless switching signal by antenna and gives upper terminal, transmit control signal to wireless communication module behind this wireless switching signal of upper terminal recognition, wireless communication module transfers to central processing unit with this control signal, and described central processing unit transmits control signal by the forceful electric power plate interface and controls its conducting to the on-off circuit of forceful electric power plate.
Owing to adopt above technical scheme, central processing unit can accurately go out to report to the police respectively and the switch intention, the user can trigger this simple tool of button and have fascinating action to send alerting signal to press, and has realized a key warning function, perfect family's safety-protection system.
Further, also comprise the step that realizes wireless switching control; Described realization wireless switching control comprises wireless unlatching and wireless step of closing:
Described wireless unlatching may further comprise the steps:
A1, wireless communication module receive the start signal that upper terminal is sent by antenna, and wireless communication module sends to central processing unit with the start signal that receives;
A2, central processing unit transmit control signal by the forceful electric power plate interface and control its conducting to the on-off circuit of forceful electric power plate;
Described wireless closing may further comprise the steps:
A3, wireless communication module receive shutdown signal by antenna, and wireless communication module sends to central processing unit with the shutdown signal that receives;
A4, central processing unit transmit control signal by the forceful electric power plate interface and control its disconnection to the on-off circuit of forceful electric power plate.
Above technical scheme makes the present invention to provide the wireless switching mode in regular tap control, need not in body of wall, to carry out complicated wiring, saved material cost, can easily handle the electrical appliance in the family at a distance, need not to be entangled with in the metope switch and where more smoothly to be installed in, whether can agree with the difficult problems such as decoration style in the family.
Further, also be included in the step of net test; The described test at net carried out according to the following steps:
B1, described wireless communication module receive the synchronic command that upper terminal is sent by antenna, and wireless communication module sends to central processing unit with the synchronic command that receives;
B2, central processing unit feedback data are given wireless communication module, and wireless communication module sends to upper terminal by antenna with these data.
Above technical scheme can make things convenient for the user to carry out the online self check of switch at any time, can guarantee that switch is in normal operating conditions, makes the present invention more safe and reliable.
Further, the step that also comprises the pick-up transducers data; Described pick-up transducers data are carried out according to the following steps:
C1, described wireless communication module receive the acquisition instructions that upper terminal is sent by antenna, and wireless communication module sends to central processing unit with the acquisition instructions that receives;
C2, central processing unit are gathered the detection data of external sensor by external data interface;
C3, central processing unit feedback data are given wireless communication module, and wireless communication module sends to upper terminal by antenna with these data.
Above technical scheme has further improved intelligent degree of the present invention, can be combined to external world environment to monitor with various sensors, and be uploaded to upper terminal.
Further, the step that also comprises central processing unit conducting lamp band after the described step 2.Central processing unit control lamp band after pressing the triggering button is shinny, can play the light indication and beautify the effect of decorateeing.
The invention has the beneficial effects as follows: the present invention can use as switch, realized a key warning function simultaneously, perfect family's safety-protection system, installation site of the present invention is fixed, within reach, for there being old, weak, sick family to erect security perimeter one, allow more family and people's group energy enjoy comfortable and happy that Smart Home brings, simultaneously, do not having to have ensured emergent alarm under special circumstances by the accumulation of energy supply module to central processing unit and wireless communication module emergency service under the situation of civil power.
Description of drawings
Fig. 1 is the circuit theory synoptic diagram with switch of warning function.
Fig. 2 is based on the schematic flow sheet of the alarm method of the switch with warning function.
Embodiment
Describe embodiments of the invention below in detail, the example of described embodiment is shown in the drawings, and wherein identical or similar label is represented identical or similar elements or the element with identical or similar functions from start to finish.Be exemplary below by the embodiment that is described with reference to the drawings, only be used for explaining the present invention, and can not be interpreted as limitation of the present invention.
In description of the invention, unless otherwise prescribed and limit, need to prove that term " installation ", " linking to each other ", " connection " should be done broad understanding, for example, can be mechanical connection or electrical connection, also can be the connection of two element internals, can be directly to link to each other, and also can link to each other indirectly by intermediary, for the ordinary skill in the art, can understand the concrete implication of above-mentioned term as the case may be.
The invention will be further described below in conjunction with drawings and Examples:
As shown in Figure 1, a kind of switch with warning function comprises forceful electric power plate interface 1, triggers button 2, central processing unit 3, power module 4, accumulation of energy supply module 5, wireless communication module 6, antenna 7, lamp band 8 and external data interface 9; First output terminal of described central processing unit 3 is connected with described forceful electric power plate interface 1, the output terminal of described triggering button 2 connects the first input end of described central processing unit 3, second output terminal of described central processing unit 3 connects the input end of wireless communication module 6, the output terminal of described wireless communication module 6 connects second input end of described central processing unit 3, described wireless communication module 6 is connected with antenna 7, and described wireless communication module 6 carries out wireless data transceiving by described antenna 7; The 3rd output terminal of described central processing unit 3 connects the input end of described lamp band 8.The output terminal of described external data interface 9 connects the 3rd input end of described central processing unit 3.Described power module 4 connects described accumulation of energy supply module 5, and described power module 4 converts electric main to direct supply and exports to described accumulation of energy supply module 5 and charge; Described accumulation of energy supply module 5 is to described central processing unit 3, wireless communication module 6 and 8 power supplies of lamp band.
In the present embodiment, described lamp band 8 is LED lamp band, described wireless communication module 6 is the zigbee communication module, described accumulation of energy supply module 5 adopts the charging and discharging lithium battery circuit, the on-off circuit of described forceful electric power plate 1 is controllable silicon, certainly, the on-off circuit of described forceful electric power plate 1 can also be relay, and the model that described power module 4 adopts Jin Shengyang company to produce is the AC-DC power module of LS01-15B05S.It should be noted that present embodiment in order to save cost, integrates central processing unit 3 and wireless communication module 6, the wireless microcontroller of JN5148 that adopts Jennic company to produce is realized.The wireless microcontroller of JN5148 can be realized all functions of central processing unit 3 of the present invention and wireless communication module 6 based on the zigbee agreement.This programme need not to be entangled with in the metope switch and where more smoothly to be installed in, whether can agree with the difficult problems such as decoration style in the family, perfect family's safety-protection system, its installation site is fixed, within reach, for there being old, weak, sick family to erect security perimeter one, allow more family and people's group energy enjoy comfortable and happy that Smart Home brings.
As shown in Figure 2, a kind of alarm method based on the switch with warning function, carry out according to the following steps:
Step 1, central processing unit 3 carry out initialization; Connecting the port that triggers button 2 on the central processing unit 3 is set to draw input and negative edge to interrupt;
Step 2, when central processing unit 3 detects negative edge and interrupts, connects the port that triggers button 2 on the central processing unit 3 and be set to rising edge and interrupt, and central processing unit 3 picks up counting; When detecting the rising edge interruption, connect the port that triggers button 2 on the central processing unit 3 and be set to the negative edge interruption, central processing unit 3 stops timing;
Step 3, central processing unit 3 conducting lamp bands 8;
Whether the time that step 4, judgement triggering button 2 are pressed surpasses setting-up time, when the time that triggering button 2 is pressed surpasses setting-up time, central processing unit 3 sends a signal to wireless communication module 6, and described wireless communication module 6 sends wireless alarm signal by antenna 7 and gives upper terminal; Surpass setting-up time when the time that triggering button 2 is pressed, central processing unit 3 sends a signal to wireless communication module 6, described wireless communication module 6 sends the wireless switching signal by antenna 7 and gives upper terminal, transmit control signal to wireless communication module behind this wireless switching signal of upper terminal recognition, wireless communication module transfers to central processing unit with this control signal, and described central processing unit 3 transmits control signal by forceful electric power plate interface 1 and controls its conducting to the on-off circuit of forceful electric power plate;
Step 5, enter the state that wait detects look-at-me or instruction next time.
It should be noted that, described upper terminal is radio network gateway, described wireless communication module sends signal by antenna and gives upper terminal, and described upper terminal and other smart machines such as mobile phone, panel computer and computing machine carry out data interaction, and described upper terminal sends a signal to wireless communication module.
Present embodiment also comprises the step that realizes wireless switching control, in the step of net test and the step of pick-up transducers data.
Described realization wireless switching control comprises wireless unlatching and wireless step of closing:
Described wireless unlatching may further comprise the steps:
A1, wireless communication module 6 receive the start signal that upper terminal is sent by antenna 7, and wireless communication module 5 sends to central processing unit 3 with the start signal that receives;
A2, central processing unit 3 transmit control signal by forceful electric power plate interface 1 and control its conducting to the on-off circuit of forceful electric power plate.
Described wireless closing may further comprise the steps:
A3, wireless communication module 6 receive shutdown signal by antenna 7, and wireless communication module 6 sends to central processing unit 3 with the shutdown signal that receives;
A4, central processing unit 3 transmit control signal by forceful electric power plate interface 1 and control its disconnection to the on-off circuit of forceful electric power plate.
The described test at net carried out according to the following steps:
B1, described wireless communication module 6 receive the synchronic command that upper terminal is sent by antenna 7, and wireless communication module 6 sends to central processing unit 3 with the synchronic command that receives;
B2, central processing unit 3 feedback data are given wireless communication module 6, and wireless communication module 6 sends to upper terminal by antenna 7 with these data;
Connecting the port that triggers button 2 on B3, the central processing unit 3 is set to draw input and negative edge to interrupt.
Described pick-up transducers data are carried out according to the following steps:
C1, described wireless communication module 6 receive the acquisition instructions that upper terminal is sent by antenna 7, and wireless communication module 6 sends to central processing unit 3 with the acquisition instructions that receives;
The detection data that C2, central processing unit 3 are gathered external sensor by external data interface 9;
C3, central processing unit 3 feedback data are given wireless communication module 6, and wireless communication module 6 sends to upper terminal by antenna 7 with these data;
Connecting the port that triggers button 2 on C4, the central processing unit 3 is set to draw input and negative edge to interrupt.
When central processing unit receives the wireless signal that upper terminal sends by wireless communication module after, judge whether the wireless signal that receives is synchronic command, when for synchronic command, carry out the step of testing at net; When the wireless signal that receives is not synchronic command, judge that whether this wireless signal that receives is open command, when the wireless signal that receives is open command, carries out wireless unlatching step; When the wireless signal that receives is not open command, judge that whether this wireless signal that receives is shutdown command, when the wireless signal that receives is shutdown command, carries out the wireless step of closing; When the wireless signal that receives is not shutdown command, carry out the pick-up transducers data step.
Above technical scheme makes the present invention to provide the wireless switching mode in regular tap control, need not to carry out complicated wiring in body of wall, has saved material cost, can easily handle the electrical appliance in the family at a distance and warning function is provided.
In the description of this instructions, concrete feature, structure, material or characteristics that the description of reference term " embodiment ", " some embodiment ", " example ", " concrete example " or " some examples " etc. means in conjunction with this embodiment or example description are contained at least one embodiment of the present invention or the example.In this manual, the schematic statement to above-mentioned term not necessarily refers to identical embodiment or example.And concrete feature, structure, material or the characteristics of description can be with the suitable manner combination in any one or more embodiment or example.
Although illustrated and described embodiments of the invention, those having ordinary skill in the art will appreciate that: can carry out multiple variation, modification, replacement and modification to these embodiment under the situation that does not break away from principle of the present invention and aim, scope of the present invention is limited by claim and equivalent thereof.