There is switch and the alarm method of warning function
Technical field
The invention belongs to Smart Home field, particularly relate to a kind of switch and the alarm method with warning function.
Background technology
The wall surface switch that current family generally uses, that the break-make directly controlling forceful electric power (being generally that 220V exchanges) mechanically reaches the object controlling light fixture or other electrical equipment, although in the quite a long time, wall surface switch brings many convenience to user in the past, but along with the progress of science and technology and the development in epoch, deficiency wherein also embodies out, further developing especially along with Smart Home technology, and the change of people's philosophy of life, wall surface switch has become the existence of an intimate chicken ribs.Traditional switch does not have distant control function, and the larger operation in room is more inconvenient, causes and turns off the light not in time and take electricity; Traditional switch hard contact opening and closing easily produce electric arc and spark simultaneously, affect the serviceable life of switch.
Along with people's living material level improves and aging population aggravation, increasing Smart Home product is subject to society's favor.At present, there is a lot of intelligent switch product, have light-operated, acoustic control, telepilot and the various ways such as mobile phone and network control, but most of function singleness, the order of switch lamp can only be realized.
Have during people to prevent family and meet accident and can call for help in time, comprise the elderly solitary uncomfortable time can relate in time household, family meet with house robbery time can not be realized warning etc. by robber, also there is a lot of safety-protection system now, but these safety-protection systems are all automatic inductions, although the effect of anti-robbery also can be played to a certain extent, once warning arrange in do not comprise special warning scene, just cannot and alarm.
Summary of the invention
Because the above-mentioned defect of prior art, technical matters to be solved by this invention is to provide a kind of intelligent switch that can realize warning function, can after civil power breaks a period of time also can report to the police.
Another technical matters that the present invention will solve be to provide one can carry out accurately convenient, the disguised high alarm method of switch based on having warning function.
For achieving the above object, the invention provides a kind of switch with warning function, comprise forceful electric power plate interface, trigger key, 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 trigger key 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 the 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 electric main to convert direct supply to and export to described accumulation of energy supply module to charge; Described accumulation of energy supply module is powered to described central processing unit and wireless communication module.
During use, central processing unit detects that trigger key is pressed, then central processing unit passes through forceful electric power plate interface transmission level signal to the on-off circuit of forceful electric power plate, close to control this on-off circuit, forceful electric power plate is powered to electrical appliance, when central processing unit detects that the time that trigger key is pressed is 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 wireless switching signal by antenna, then wireless communication module sends the switching signal received to central processing unit, after central processing unit receives wireless switching signal, the on-off circuit of transmission level signal control forceful electric power plate is closed to make forceful electric power plate power to electrical appliance.When mains failure, accumulation of energy supply module is powered to described central processing unit and wireless communication module, can send emergent alarm signal when running into emergency case.Owing to adopting above technical scheme, the present invention can use as switch, achieve a key warning function simultaneously, perfect Household security system, installation site of the present invention is fixed, within reach, one security perimeter has been erected for there being old, weak, sick family, allowing more family and people's group energy enjoy, that Smart Home brings is comfortable and happy, simultaneously, when there is no civil power also by accumulation of energy supply module to central processing unit and wireless communication module emergency service, ensured emergent alarm under special circumstances.
Further, also light bar is comprised; 3rd output terminal of described central processing unit connects the input end of described light bar; Described accumulation of energy supply module is powered to described light bar.Central processing unit transmission level signal conduction light bar makes it shinny, suggesting effect can be played, people can be allowed to find corresponding gauge tap fast and accurately when switch is more, very convenient and hommization, light bar can also play the effect of beautifying and decorating simultaneously.
Preferably, described light bar is LED.LED is soft, can be curling as electric wire, can shear and receive, be convenient to be combined with switch, and LED insulate simultaneously, water resistance is good, use safety, not easily breaks, long service life.
Further, also external data interface is comprised; The output terminal of described external data interface connects the 3rd input end of described central processing unit, and central processing unit connects various sensor by external data interface, to gather the data uploaded various sensor and spread out of.
Preferably, described wireless communication module is zigbee communication module.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.
Present invention also offers a kind of alarm method of switch based on having warning function, comprising the following steps:
Step one, central processing unit carry out initialization; Port central processing unit connecting trigger key is set to pull-up input and negative edge interruption;
Step 2, when central processing unit detects that negative edge interrupts, port central processing unit connecting trigger key is set to rising edge and interrupts, and central processing unit starts timing; When detecting that rising edge interrupts, port central processing unit connecting trigger key is set to negative edge and interrupts, central processing unit stops timing;
Step 3, judge whether the time that trigger key is pressed exceedes setting-up time, when the time that trigger key is pressed exceedes setting-up time, central processing unit sends a signal to wireless communication module, and described wireless communication module sends wireless alarm signal to upper terminal by antenna; Setting-up time is not exceeded when the time that trigger key is pressed, central processing unit sends a signal to wireless communication module, described wireless communication module sends wireless switching signal to upper terminal by antenna, transmit control signal to wireless communication module after this wireless switching signal of upper terminal recognition, this control signal is transferred to central processing unit by wireless communication module, and described central processing unit is transmitted control signal by forceful electric power plate interface and controls its conducting to the on-off circuit of forceful electric power plate.
Owing to adopting above technical scheme, central processing unit can accurately go out to report to the police and switch intention respectively, user can have fascinating action to send alerting signal to press this simple tool of trigger key, achieve a key warning function, perfect Household security system.
Further, the step realizing wireless switching and control also is comprised; The described step realizing wireless switching control and comprise wireless unlatching and wireless closedown:
Described wireless unlatching comprises the following steps:
A1, wireless communication module receive by antenna the start signal that upper terminal sends, and the start signal received is sent to central processing unit by wireless communication module;
A2, central processing unit are transmitted control signal by forceful electric power plate interface and control its conducting to the on-off circuit of forceful electric power plate;
Described wireless closedown comprises the following steps:
A3, wireless communication module receive shutdown signal by antenna, and the shutdown signal received is sent to central processing unit by wireless communication module;
A4, central processing unit by forceful electric power plate interface transmit control signal to the on-off circuit of forceful electric power plate control its disconnect.
Above technical scheme makes the present invention can provide wireless switching mode while regular tap controls, without the need to carrying out complicated wiring in body of wall, save material cost, easily can handle the electrical appliance in family at a distance, where more smoothly, being arranged on without the need to being entangled with in wall surface switch, whether can agreeing with the difficult problems such as the decoration style in family.
Further, the step of net test is also included in; Described test at net is carried out according to the following steps:
B1, described wireless communication module receive by antenna the synchronic command that upper terminal sends, and the synchronic command received is sent to central processing unit by wireless communication module;
B2, central processing unit feedback data are to wireless communication module, and these data are sent to upper terminal by antenna by wireless communication module.
Above technical scheme can facilitate user to carry out switch On-line self-diagnosis at any time, can guarantee that switch is in normal operating conditions, make the present invention more safe and reliable.
Further, the step of pick-up transducers data is also comprised; Described pick-up transducers data are carried out according to the following steps:
C1, described wireless communication module receive by antenna the acquisition instructions that upper terminal sends, and the acquisition instructions received is sent to central processing unit by wireless communication module;
C2, central processing unit gather the detection data of external sensor by external data interface;
C3, central processing unit feedback data are to wireless communication module, and these data are sent to upper terminal by antenna by wireless communication module.
Above technical scheme further improves intelligence degree of the present invention, can be combined environment to external world and monitor, and be uploaded to upper terminal with various sensor.
Further, the step of central processing unit conducting light bar is also comprised after described step 2.It is shinny that central processing unit controls light bar after pressing trigger key, can play lamplight pointing and beautify the effect of decorateeing.
The invention has the beneficial effects as follows: the present invention can use as switch, achieve a key warning function simultaneously, perfect Household security system, installation site of the present invention is fixed, within reach, one security perimeter has been erected for there being old, weak, sick family, allowing more family and people's group energy enjoy, that Smart Home brings is comfortable and happy, simultaneously, when there is no civil power also by accumulation of energy supply module to central processing unit and wireless communication module emergency service, ensured emergent alarm under special circumstances.
Accompanying drawing explanation
Fig. 1 is the circuit theory schematic diagram of the switch with warning function.
Fig. 2 is the schematic flow sheet of the alarm method based on the switch with warning function.
Embodiment
Be described below in detail embodiments of the invention, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has element that is identical or similar functions from start to finish.Being exemplary below by the embodiment be described with reference to the drawings, only for explaining the present invention, and can not limitation of the present invention being interpreted as.
In describing the invention, unless otherwise prescribed and limit, it should be noted that, term " installation ", " being connected ", " connection " should be interpreted broadly, such as, can be mechanical connection or electrical connection, also can be the connection of two element internals, can be directly be connected, also indirectly can be connected by intermediary, for the ordinary skill in the art, the concrete meaning of above-mentioned term can be understood as the case may be.
Below in conjunction with drawings and Examples, the invention will be further described:
As shown in Figure 1, a kind of switch with warning function, comprises forceful electric power plate interface 1, trigger key 2, central processing unit 3, power module 4, accumulation of energy supply module 5, wireless communication module 6, antenna 7, light bar 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 trigger key 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 the 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; 3rd output terminal of described central processing unit 3 connects the input end of described light bar 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 charges; Described accumulation of energy supply module 5 is powered to described central processing unit 3, wireless communication module 6 and light bar 8.
In the present embodiment, described light bar 8 is LED, described wireless communication module 6 is zigbee communication module, described accumulation of energy supply module 5 adopts 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 the present embodiment is in order to cost-saving, central processing unit 3 and wireless communication module 6 are integrated, the JN5148 wireless microcontroller adopting Jennic company to produce realizes.JN5148 wireless microcontroller, based on zigbee agreement, can realize all functions of central processing unit 3 of the present invention and wireless communication module 6.Where more smoothly, this programme is arranged on without the need to being entangled with in wall surface switch, whether can agree with the difficult problems such as the decoration style in family, perfect Household security system, its installation site is fixed, within reach, for there being old, weak, sick family to erect one security perimeter, allowing more family and people's group energy enjoy, that Smart Home brings is comfortable and happy.
As shown in Figure 2, a kind of alarm method of switch based on having warning function, performs according to the following steps:
Step one, central processing unit 3 carry out initialization; Port central processing unit 3 connecting trigger key 2 is set to pull-up input and negative edge interruption;
Step 2, when central processing unit 3 detects that negative edge interrupts, port central processing unit 3 connecting trigger key 2 is set to rising edge and interrupts, and central processing unit 3 starts timing; When detecting that rising edge interrupts, port central processing unit 3 connecting trigger key 2 is set to negative edge and interrupts, central processing unit 3 stops timing;
Step 3, central processing unit 3 conducting light bar 8;
Step 4, judge whether the time that trigger key 2 is pressed exceedes setting-up time, when the time that trigger key 2 is pressed exceedes 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 to upper terminal by antenna 7; Setting-up time is not exceeded when the time that trigger key 2 is pressed, central processing unit 3 sends a signal to wireless communication module 6, described wireless communication module 6 sends wireless switching signal to upper terminal by antenna 7, transmit control signal to wireless communication module after this wireless switching signal of upper terminal recognition, this control signal is transferred to central processing unit by wireless communication module, and described central processing unit 3 is transmitted 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 to upper terminal by antenna, and other smart machines such as described upper terminal and mobile phone, panel computer and computing machine carry out data interaction, and described upper terminal sends a signal to wireless communication module.
The present embodiment also comprise realize wireless switching and control step, in the step of net test and the step of pick-up transducers data.
The described step realizing wireless switching control and comprise wireless unlatching and wireless closedown:
Described wireless unlatching comprises the following steps:
A1, wireless communication module 6 receive by antenna 7 start signal that upper terminal sends, and the start signal received is sent to central processing unit 3 by wireless communication module 5;
A2, central processing unit 3 are transmitted 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 closedown comprises the following steps:
A3, wireless communication module 6 receive shutdown signal by antenna 7, and the shutdown signal received is sent to central processing unit 3 by wireless communication module 6;
A4, central processing unit 3 by forceful electric power plate interface 1 transmit control signal to the on-off circuit of forceful electric power plate control its disconnect.
Described test at net is carried out according to the following steps:
B1, described wireless communication module 6 receive by antenna 7 synchronic command that upper terminal sends, and the synchronic command received is sent to central processing unit 3 by wireless communication module 6;
B2, central processing unit 3 feedback data are to wireless communication module 6, and these data are sent to upper terminal by antenna 7 by wireless communication module 6;
B3, port central processing unit 3 connecting trigger key 2 is set to pull-up input and negative edge interrupts.
Described pick-up transducers data are carried out according to the following steps:
C1, described wireless communication module 6 receive by antenna 7 acquisition instructions that upper terminal sends, and the acquisition instructions received is sent to central processing unit 3 by wireless communication module 6;
C2, central processing unit 3 gather the detection data of external sensor by external data interface 9;
C3, central processing unit 3 feedback data are to wireless communication module 6, and these data are sent to upper terminal by antenna 7 by wireless communication module 6;
C4, port central processing unit 3 connecting trigger key 2 is set to pull-up input and negative edge interrupts.
After central processing unit to receive the wireless signal that upper terminal sends by wireless communication module, judge whether the wireless signal received is synchronic command, when for performing the step of testing at net during synchronic command; When the wireless signal received is not synchronic command, judges whether this wireless signal received is open command, when the wireless signal received is open command, perform wireless unlatching step; When the wireless signal received is not open command, judges whether this wireless signal received is shutdown command, when the wireless signal received is shutdown command, perform wireless closedown step; When the wireless signal received is not shutdown command, perform pick-up transducers data step.
Above technical scheme makes the present invention can provide wireless switching mode while regular tap controls, and without the need to carrying out complicated wiring in body of wall, saving material cost, can easily handle the electrical appliance in family at a distance and provide warning function.
In the description of this instructions, specific features, structure, material or feature that the description of reference term " embodiment ", " some embodiments ", " example ", " concrete example " or " some examples " etc. means to describe in conjunction with this embodiment or example are contained at least one embodiment of the present invention or example.In this manual, identical embodiment or example are not necessarily referred to the schematic representation of above-mentioned term.And the specific features of description, structure, material or feature can combine in an appropriate manner in any one or more embodiment or example.
Although illustrate and describe embodiments of the invention, those having ordinary skill in the art will appreciate that: can carry out multiple change, amendment, replacement and modification to these embodiments when not departing from principle of the present invention and aim, scope of the present invention is by claim and equivalents thereof.