A kind of outside plug type intelligent power socket of the infrared remote control signal decoding process based on microprocessorTechnical field
The present invention relates to a kind of intelligent power socket device, particularly a kind of outside plug type intelligent power socket of the infrared remote control signal decoding process based on microprocessor.
Background technology
At present, along with the development of science and technology, increasing household electrical appliance enter into common people house, household electrical appliance bring easily simultaneously, also there is certain potential safety hazard, as apparatus failure or electrical equipment improper use cause electric shock accidents or fire, this just needs socket to have the function detecting electric current, voltage and power, the auto power off when detecting that electric current, voltage and power exceed safety standard;
All now realize being switched on or switched off of power supply by plug plug, but often when electrical equipment has cut out or holding state time user seldom pull out appliance plug, and electrical equipment is also in electricity consumption.But it is very loaded down with trivial details for all plugging plug when using electrical equipment, and the electric mounting position had also is inconvenient to plug at every turn, this just needs socket to have the function automatically identifying electrical equipment using state, electrical equipment closed or holding state time auto power off;
When socket is in deenergization state, it is very important that recovery socket is powered, and existing smart jack is when restoring electricity, or operation is very complicated, or being only suitable for part population uses;
Present household electrical appliance get more and more, more and more intelligence, and everybody also more and more focuses on the use power situation of electrical equipment, so just need socket to have and detect electric current, voltage and power and record data, for data statistics and tracking electrical equipment service condition;
Existing socket has done the improvement of different aspect in order to solve the problem, but or be function singleness, or inconvenient operation.
Summary of the invention
The present invention provides a kind of outside plug type intelligent power socket based on microprocessor infrared remote control signal decoding process for the technical issues that need to address.
For solving above-mentioned technical problem, a kind of outside plug type intelligent power socket of the infrared remote control signal decoding process based on microprocessor, comprise external power supply plug, it is characterized in that: also comprise mainboard and output socket, described mainboard comprises lightning-protection surge module, D.C. regulated power supply module, two-way relay driving module, microprocessor, infrared receiving module, current detecting conditioning module, voltage detecting conditioning module, USB charging module, outer memory module, wireless module;
Described external power supply plug is connected with lightning-protection surge module;
Described two-way relay driving module comprises driving signal input, relay coil circuit and output loop; Described lightning-protection surge module is connected with the output loop of D.C. regulated power supply module and two-way relay driving module; The output loop of described two-way relay driving module is connected by two phase lines with output socket, wherein a phase line (normally live wire) is provided with current detecting conditioning module and voltage detecting conditioning module;
Described D.C. regulated power supply module is connected with lightning-protection surge module, and described DC voltage-stabilizing module is powered and USB charging module for power supply to microprocessor, infrared receiving module, the relay coil circuit of two-way relay driving module, external memory modules, wireless module;
Described microprocessor is connected with current detecting conditioning module, voltage detecting conditioning module, infrared receiving module, the driving signal input of two-way relay driving module, external memory modules, wireless module.
Described lightning-protection surge module refers between live wire and zero line, between live wire and ground wire, between zero line and ground wire, is provided with metal oxide piezo-resistance, for lightning-protection surge.
Described DC voltage-stabilizing module comprises the pressure unit, rectification unit and the voltage regulation filtering unit that are connected in series successively; Described pressure unit is transformer or holds resistance pressure unit, and described resistance-capacitance depressurization unit is the parallel circuits of resistance and electric capacity.
Described current detecting conditioning module comprises current sampling circuit and circuit modulate circuit, and described current sampling circuit is precision transformer or power resistor; Described circuit modulate circuit comprises the rectification circuit of cascade, filter circuit, bleeder circuit and amplifying circuit.
Described voltage detecting conditioning module comprises voltage sampling circuit and voltage modulate circuit, and described voltage sampling circuit is precision transformer or power resistor; Described circuit modulate circuit comprises the rectification circuit of cascade, filter circuit, bleeder circuit and A/D convertor circuit.
Described wireless module can adopt the one in 433 wireless modules or 315m wireless module or wifi wireless module.Mobile phone A PP can be used to be connected with smart jack wireless module, by mobile phone operation realize smart jack output socket on/off or by power data transmission that is real-time or that recorded to mobile phone.
Described USB charging module is long supply module.
The numerical value of the voltage and current signal that described external memory storage collects for storage voltage examine and debug module and current detecting conditioning module and acquisition time.
Described infrared receiving module refers to and adopts integrated infrared receiver, the carrying out of the infrared remote control signal received is amplified, detection, shaping, and export and can allow the TTL signal of microprocessor identification.As shown in Figure 7.
The outside plug type intelligent power socket of described a kind of infrared remote control signal decoding process based on microprocessor, that timing process is carried out to the 38KHZ infrared signal received, described carry out timing process to the 38KHZ infrared signal received and specifically refer to that the 38KHZ infrared signal cumulative time once received reaches certain time length, concrete instruction method is the one in interval monitoring method or continuous monitoring method;
Described interval monitoring method, as shown in Figure 9, comprises the following steps:
(1) first, infrared remote controller sends infrared remote control signal;
(2) second step, the carrying out of the infrared remote control signal received is amplified by infrared remote receiver, detection, shaping, and output to microprocessor;
Signal is carried out following process by microprocessor;
(3) the 3rd steps, receive signal to microprocessor and disappear and tremble process;
(4) the 4th steps, carry out time interval calculating to the signal after the 3rd step process;
(5) the 5th steps, microprocessor carries out judging whether the infrared signal that microprocessor receives terminates to time interval result of calculation; If so, the cumulative time resets; If not, the time delay interval time is performed;
(6) the 6th steps, perform time delay interval time laggard line time cumulative calculation;
(7) the 7th steps, judge time cumulation calculated value whether reach aggregate-value effective time; If so, the infrared signal this time received is an effective order; If not, time interval calculating is re-started;
(8) the 8th steps, carry out time interval calculating;
(9) the 9th steps, carry out judging whether the infrared signal that microprocessor receives terminates to time interval calculated value; If so, accumulative clearing; If not, time of implementation accumulation calculates;
(10) the tenth steps, perform the laggard line time accumulation of time delay interval time and calculate;
(11) the 11 steps, judge to time cumulation calculated value, the time that whether reaches tires out limit evaluation; If so, the cumulative time resets; If not, time interval calculating is re-started;
Described continuous monitoring method, as shown in Figure 8, comprises the following steps:
(1) first, infrared remote controller sends infrared remote control signal;
(2) second step, the carrying out of the infrared remote control signal received is amplified by infrared remote receiver, detection, shaping, and output to microprocessor;
Signal is carried out following process by microprocessor;
(3) the 3rd steps, receive signal to microprocessor and disappear and tremble process;
(4) the 4th steps, carry out time interval calculating to the signal after the 3rd step process;
(5) the 5th steps, microprocessor carries out judging whether the infrared signal that microprocessor receives terminates to time interval result of calculation; If so, the cumulative time resets; If not, time of implementation cumulative calculation;
(6) the 6th steps, hold and carry out time cumulation calculating;
(7) the 7th steps, judge time cumulation calculated value whether reach aggregate-value effective time; If so, the infrared signal this time received is an effective order; If not, time interval calculating is re-started;
(8) the 8th steps, carry out time interval calculating;
(9) the 9th steps, carry out judging whether the infrared signal that microprocessor receives terminates to time interval calculated value; If so, accumulative clearing; If not, time of implementation accumulation calculates;
(10) the tenth steps, carry out accumulated time calculating;
(11) the 11 steps, judge time cumulation calculated value, whether reach time cumulation limit value; If so, the cumulative time resets; If not, time interval calculating is re-started;
Described infrared transmission refers to that operator uses any Infrared remote controller by Infrared remote controller any key;
Described infrared receiver refers to and adopts integrated infrared receiver, the carrying out of the infrared remote control signal received is amplified, detection, shaping, and export and can allow the TTL signal of microprocessor identification;
Described cumulative time, i.e. timing from the pulse that infrared remote receiver receives the infrared signal of 38KHZ, remove 10ms and disappear the time of trembling, and ignores the time interval of the signal interruption being less than 0.01 ~ 0.1S;
Described aggregate-value effective time is 3s;
Described accumulated time limit value is 10min;
In the described time interval, its method calculated is: calculate the time interval between continuous two high level; Or the time interval calculated between continuous two rising edges; Or the time interval calculated between a continuous trailing edge; Or calculate a continuous rising edge and a trailing edge, or the time interval between a continuous trailing edge and a rising edge;
Described time cumulation be calculated as cumulative time and time delay interval time and;
Described time delay interval time behaviour 10ms;
Described time cumulation be calculated as cumulative time and the time interval and.
After adopting said structure, the outside plug type intelligent power socket of infrared remote control signal decoding process of the present invention is by gathering and the electric current of real time record load and voltage signal; When load current is excessive, Microprocessor S3C44B0X relay realizes auto-breaking, protection load elements; When load current is standby current, through microprocessor processes and judgement, auto-breaking, realizes the function of power saving; The present invention controls by mobile phone A PP or infrared remote-controlled signal; Infrared remote control signal decoding process provided by the present invention does not need through infrared signal coupling learning, can realize decoding for any button of any Infrared remote controller, realizes out-put supply break-make and controls; The present invention also has lightning-protection surge, electroshock-proof function.
Accompanying drawing explanation
Below in conjunction with the drawings and specific embodiments to being originally described in further detail.
Fig. 1 is the structured flowchart of embodiment of the present invention;
Fig. 2 is the circuit theory diagrams that the D.C. regulated power supply module of embodiment of the present invention is powered by transformer pressure-reducing;
Fig. 3 is the circuit theory diagrams by precision transformer sample rate current of embodiment of the present invention;
Fig. 4 is the circuit theory diagrams of the two-way relay driving module of embodiment of the present invention;
Fig. 5 is the assembling assumption diagram in embodiment of the present invention front;
Fig. 6 is the assembling assumption diagram of embodiment of the present invention reverse side;
Fig. 7 is infrared receiver of the present invention and decoding circuit schematic diagram;
Fig. 8 is continuous monitoring method flow chart provided by the invention;
Fig. 9 is interval provided by the invention monitoring method flow chart;
In figure: 101 is socket front panel, 104 is output socket, 105 is mainboard, 106 is holding screw, 107 is socket bonnets, 108 is external power supply plug, 1057 is lightning-protection surge module, 1051 is microprocessor, 1055 is infrared receiving module, 1052 is D.C. regulated power supply module, 1053 is two-way relay driving module, 1054 is current detecting conditioning module, 1058 is voltage detecting conditioning module, 1056 is USB supply module, 1059 is outer memory module, 10510 is wireless module,
Embodiment
Execution mode:
As shown in Fig. 1, Fig. 5 and Fig. 6, the outside plug type intelligent power socket of a kind of infrared remote control signal decoding process based on microprocessor of the present invention, comprises output socket 104, external power supply plug 108.Output socket 104, mainboard 105 are fixed between socket front panel 101 and socket bonnet 107 by holding screw 106, and external power supply plug 108 stretches out through socket bonnet 107.Mainboard 105 comprises lightning-protection surge module 1057, microprocessor 1051, infrared receiving module 1055, D.C. regulated power supply module 1052, two-way relay driving module 1053, current detecting conditioning module 1054, voltage detecting conditioning module 1058, USB supply module 1056, outer memory module 1059, wireless module 10510.
USB charging module is long supply module.Described USB charging module 1056 and the USB 102-1 on socket front panel 101, can be charged by USB 101-1.
Described external power supply plug 108 is connected with lightning-protection surge module 1057;
Described two-way relay driving module 1053 comprises driving signal input, relay coil circuit and output loop;
Described lightning-protection surge module 1057 is connected with the output loop of D.C. regulated power supply module 1052 and two-way relay driving module 1053;
The output loop of described two-way relay driving module 1053 is connected by two phase lines with output socket 104, wherein a phase line (normally live wire) is provided with current detecting conditioning module 1054 and voltage detecting conditioning module 1058;
Described D.C. regulated power supply module 1052 is connected with lightning-protection surge module 1057, and described DC voltage-stabilizing mould 1052 pieces powers to the relay coil circuit of microprocessor 1051, infrared receiving module 1055, two-way relay driving module 1053, external memory modules 1059, wireless module 10510 and USB charging module 1056;
Described DC voltage-stabilizing module 1052 provides 5V and 12V or 24V two kinds of DC voltage-stabilizing to export, wherein 5V powers to microprocessor 1051, infrared receiving module 1055, external memory modules 1059, wireless module 10510 and USB charging module 1056,12V or 24V is to the relay coil circuit supply of two-way relay driving module 1053.Described USB charging module 1056 is long supply module.
The driving signal input of described microprocessor 1051 and current detecting conditioning module 1054, voltage detecting conditioning module 1058, infrared receiving module 1055, two-way relay driving module 1053, external memory modules 1059, wireless module 10510 are connected.
Described lightning-protection surge module refers between live wire and zero line, between live wire and ground wire, between zero line and ground wire, is provided with metal oxide piezo-resistance, for lightning-protection surge.
The numerical value of the voltage and current signal that described external memory storage collects for storage voltage examine and debug module and current detecting conditioning module and acquisition time.
Described wireless module adopts wifi wireless module.Mobile phone A PP can be used to be connected with smart jack wifi wireless module, by mobile phone operation realize smart jack output socket 104 on/off or by power data transmission that is real-time or that recorded to mobile phone.
Described voltage detecting conditioning module comprises voltage sampling circuit and voltage modulate circuit, and described voltage sampling circuit is precision transformer or power resistor; Described circuit modulate circuit comprises the rectification circuit of cascade, filter circuit, bleeder circuit and A/D convertor circuit.
The infrared signal of remote controller transmission is received by infrared receiving module 1055, and the current signal that current detecting conditioning module 1054 sends over, then judge by the infrared remote-controlled signal decoding process established in microprocessor 1051 and current signal handling procedure and control the drive singal of two-way relay driving module 1053, realizing the break-make of output socket 104 power supply.
Output socket 104 restores electricity can by using any Infrared remote controller by any key, one-key operation.Infrared receiving module 1055 receives the infrared signal that remote controller sends, and the infrared remote-controlled signal decoding process then by establishing in microprocessor 1051 judges and controls the drive singal of two-way relay driving module 1053, realizes output socket 104 and restores electricity.
Described infrared receiving module 1055 refers to and adopts integrated infrared receiver, the carrying out of the infrared remote control signal received is amplified, detection, shaping, and export and can allow the TTL signal of microprocessor identification.
The infrared signal that described remote controller sends refers to the infrared signal that operator uses any Infrared remote controller and sends by Infrared remote controller any key.
Described infrared remote-controlled signal decoding process carries out timing process to the 38KHZ infrared signal received, described carry out timing process to the 38KHZ infrared signal received and specifically refer to that the 38KHZ infrared signal cumulative time once received reaches certain time length, concrete instruction method is the one in interval monitoring method or continuous monitoring method.
As shown in Figure 2, DC voltage-stabilizing current module 1052 of the present invention comprises the pressure unit, rectification unit and the voltage regulation filtering unit that are connected in series successively.Wherein pressure unit can adopt transformer T as shown in Figure 2, external power supply plug 108 incoming transport power supply AC220V, the full-bridge rectification unit rectification that AC power forms through diode D1, D2, D3 and D4 after passing through pressure unit.As shown in Figure 2, the voltage regulation filtering unit of present embodiment comprises pressurizer VT1 and VT2, and the input of described pressurizer VT1 is connected with full-bridge rectification unit output.Be connected with filter capacitor C1 between the input of described pressurizer VT1 and ground, be connected with filter capacitor C2 between the output of described pressurizer VT1 and ground, the output output voltage V1 of described pressurizer VT1, V1 are that 12V or 24V powers to relay coil.Filter capacitor C3 is connected with between the output of described pressurizer VT2 and ground, the output output voltage V2 of described pressurizer VT2, V2 are that 5V powers to microprocessor 1051, infrared receiving module 1055, external memory modules 1059, wireless module 10510 and USB charging module 1056.
Described current detecting conditioning module 1054 can be as shown in Figure 3, comprises precision transformer L1, and the rectification circuit of cascade, filter circuit, bleeder circuit and amplifying circuit.Described rectification circuit is the full bridge rectifier that diode D5, D6, D7 and D8 are formed, and described filter circuit is C4, and described bleeder circuit is the series connection bleeder circuit of resistance R2 and R3.Described amplifying circuit is amplifier U1, the intermediate connection point of described resistance R2 with R3 is connected with amplifier U1 electrode input end by resistance R4, described amplifier U1 negative input is by resistance R5 ground connection, and described amplifier U1 output is connected with microprocessor 1051.Described current detecting conditioning module 1054 detects load current, is defeated by microprocessor 1051.When load current is excessive, Microprocessor S3C44B0X relay realizes auto-breaking, protection load elements; When load current is standby current, through microprocessor processes and judgement, auto-breaking, realizes the function of power saving.
As shown in Figure 4, two-way relay driving module 1053 comprises relay K 1 and K2, and the coil of described relay K 1 and K2 is in parallel, and then forms series via with D.C. regulated power supply module 1052, pressurizer J1.The control end of described pressurizer J1 is connected with the output of microprocessor 1051 by resistance R1, described relay K 1 and K2 reversal connection diode D1.After infrared receiving module 1055 receives signal, microprocessor 1051 outputs signal and controls pressurizer J1 conducting, and control relay K1 and K2 works then, makes the AC power of external power supply plug 108 export to output socket 104 by relay K 1 and K2.
In the above-mentioned execution mode of the present invention, detect load current by current detecting conditioning module and be transferred to microprocessor, when load current is excessive, Microprocessor S3C44B0X relay realizes auto-breaking, protection load elements; When load current is standby current, through microprocessor processes and judgement, auto-breaking, realizes the function of power saving; The present invention controls by mobile phone A PP or infrared remote-controlled signal; Infrared remote control signal decoding process provided by the present invention does not need through infrared signal coupling learning, can realize decoding for any button of any Infrared remote controller, realizes out-put supply break-make and controls; The present invention also has lightning-protection surge, electroshock-proof function.Although the foregoing describe the specific embodiment of the present invention; but those skilled in the art are to be understood that; these only illustrate; various changes or modifications can be made to present embodiment; and not deviating from principle and the essence of invention, protection scope of the present invention is only defined by the appended claims.