Summary of the invention
In view of above-mentioned the deficiencies in the prior art part, the object of the present invention is to provide a kind of implementation method of learning-oriented handset remote controller, can learn the guidance command code of other telepilot, realize that function is controlled in the remote control of other telepilot.
In order to achieve the above object, the present invention has taked following technical scheme:
A kind of learning-oriented handset remote controller wherein, comprising: for receiving the Infrared of other telepilot emission, and the infrared remote receiver that the guidance command code of telepilot is carried out to demodulation; For described guidance command code is decoded and record, and the guidance command code of record is carried out to associated microprocessor with the button on mobile phone; Its INT0 port of described microprocessor is set to jump along effective, and the INT1 port is set to lower jumping along effective, and the INT0 pin of microprocessor is connected with the INT1 pin; The storer that is used for the guidance command code of microprocessor records; For after mobile phone is learnt the telecommand of other telepilot, to the infrared transmission module of the electrical equipment emission guidance command of understanding this guidance command code; Described microprocessor is connected with storer with infrared remote receiver respectively, and described infrared transmission module is connected with the PWM control port of microprocessor; Described microprocessor comprises: for recording upper jumping along effective the first timing unit of signal; For recording, jump along effective the second timing unit of signal; Described infrared remote receiver comprises: for Infrared being converted to the diode of the voltage signal of high frequency; For described voltage signal is carried out to the filtering processing, obtain the electric capacity of the envelope signal of guidance command code; For this envelope signal is amplified, and convert amplification and the ADC converting unit of digital signal to; For digital signal and Upper threshold and Lower Threshold are compared, reduce Upper threshold unit and the Lower Threshold unit of guidance command code; Described Capacitance parallel connection is at the two ends of diode, and the negative electrode of described diode is connected with amplification and ADC converting unit, plus earth; Described amplification and ADC converting unit are connected with the infrared remote receiver output port, and described Upper threshold unit is connected with the interruption processing unit of amplification and ADC converting unit and infrared remote receiver respectively with the Lower Threshold unit; Described infrared transmission module comprises metal-oxide-semiconductor and infrared LED lamp, and described infrared LED lamp is connected with the PWM output port of microprocessor by metal-oxide-semiconductor; Described metal-oxide-semiconductor is the n channel MOS tube, and sends pwm signal control nMOS pipe break-make by microprocessor, thereby drives the infrared LED lamp.
A kind of implementation method of learning-oriented handset remote controller, is characterized in that, comprising:
A, receive the Infrared of other telepilot emission;
B, the guidance command code of telepilot is carried out to demodulation; Wherein, described step B specifically comprises:
B1, Infrared is converted to the voltage signal of high frequency;
B2, described voltage signal is carried out to the filtering processing, obtain the envelope signal of guidance command code;
B3, this envelope signal is amplified, and converted to digital signal;
B4, this digital signal and Upper threshold and Lower Threshold are compared to reduction guidance command code;
C, described guidance command code is decoded and record;
D, the guidance command code of record and button on mobile phone are carried out associated, and storage.
In the implementation method of described learning-oriented handset remote controller, after step D, described method further comprises: when the button on mobile phone being detected is pressed, calls the guidance command code of storage and launch corresponding guidance command.
In the implementation method of described learning-oriented handset remote controller, in step C, the mode by direct ranging pulse width copies and records source guidance command code.
In the implementation method of described learning-oriented handset remote controller, the code of the pulse signal in the 108ms that the guidance command code of record is the telepilot emission.
The implementation method of a kind of learning-oriented handset remote controller provided by the invention and learning-oriented handset remote controller, receive the Infrared of other telepilot emission by infrared remote receiver, and the guidance command code of telepilot is carried out to demodulation, and by microprocessor, described guidance command code is decoded and record, and with the button on mobile phone, carry out associated by the guidance command code of record, study is to the guidance command code of other telepilot, then launch corresponding control command by the infrared transmission module of mobile phone to the equipment that is appreciated that this guidance command code, realized the function of telepilot.
Embodiment
The main flow telecontrol engineering that household electrical appliance use is infrared (IR) remote control.Send by Infrared remote controller (transmitter) infrared pulse that represents specific binary code, the key commands of the corresponding appointment of these binary codes, as start or shutdown or raising volume etc.Infrared remote receiver in TV, sound equipment or other equipment is decoded intobinary data 1 and 0 by light pulse, so that then the microprocessor of equipment is appreciated that, by microprocessor, carries out corresponding order.
The basic premise condition that infrared remote control plays a role is the transferring signals between devices that uses infrared light to control in telepilot and it.
Infrared proximity transducer, also utilize infrared ray to come inspected object close, launch infrared light by infrarede emitting diode, when infrared light runs into object, some light reflection or diffuse reflection are to the infrared light receiving end, the infrared receiver sensor is according to the infrared light intensity received, and judgment object is close.
Infrared remote controller and infrared proximity transducer are all done medium by infrared light and are realized, certain general character is arranged on its hardware, the invention provides a kind of implementation method of learning-oriented handset remote controller and the existing resource that learning-oriented handset remote controller utilizes proximity transducer on mobile phone, infrared light by proximity transducer receives sensing part, receive the code of other telepilot emissions, and be stored in mobile phone EMS memory; Utilize the infrared light emission of proximity transducer partly to make the transmitter of telepilot, the code of storing before emission is controlled the equipment that those are appreciated that this code.
For making purpose of the present invention, technical scheme and effect clearer, clear and definite, referring to the accompanying drawing examples, the present invention is described in more detail.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
Refer to Fig. 1, one adopts the serial code of width modulation the remote control code pulse of Infrared remote controller emission, and this serial code is comprised of the radix-minus-one complement of initial code, systematic code, function code, function code.
Wherein, the initial code of serial code means with the combination of a pulsewidth 9ms (millisecond), interval 4.5ms, cycle 13.5ms, as shown in 2; Binary " 0 " mean with the combination of pulsewidth 0.565ms, interval 0.56ms, cycle 1.125ms, as shown in Figure 3; Binary " 1 " be take the combination that pulsewidth is 2.25ms as 0.565ms, interval 1.685ms, cycle and is meaned as shown in Figure 4.
32 binary codes that the guidance command of telepilot is comprised of above-mentioned " 0 " and " 1 ", in these 32 scale-of-two code characters, first 16 is 8 user identification code and radix-minus-one complement thereof, for distinguishing different electric equipments, prevents that different machine remote control modes from interfering with each other; Latter 16 is 8 bit manipulation codes (, function code) and radix-minus-one complement thereof.
As shown in Figure 5, the binary zero that the duration of a group code itself comprises with it is different and different with the number of " 1 ", and one is between 58.5~76.5ms; After the button of telepilot is pressed, the emitter of telepilot periodically sends 32 binary codes of same, and its cycle is about 108ms.
Above-mentioned command code is modulated (improve emission efficiency, reach the purpose that reduces power supply power consumption) through the carrier frequency of 38kHz (KHz), and then produces infrared ray to spatial emission by infrared-emitting diode.
The implementation method of the learning-oriented handset remote controller that the embodiment of the present invention provides is exactly to want the guidance command code of purpose learning remote controller emission, then key associated with mobile phone, and is stored in mobile phone.When needs control apparatus equipment, before only need calling, the command code of study, be infrared transmission module by infrared transmitter, to the equipment emission control orders that is appreciated that this code.Refer to Fig. 6, described method comprises:
S110, receive the Infrared of other telepilot emission;
S120, the guidance command code of telepilot is carried out to demodulation;
S130, described guidance command code is decoded and record;
S140, the guidance command code of record and button on mobile phone are carried out associated, and storage.
When needs control can be understood the equipment of this command code, described method also comprises:
When S150, the button on mobile phone being detected are pressed, call the guidance command code of storage and launch corresponding guidance command.
In step S120, described step specifically comprises: first through diode, Infrared is converted to the voltage signal of high frequency; By electric capacity, described voltage signal is carried out to the filtering processing afterwards, obtain the envelope signal of guidance command code; By amplification and ADC converting unit, this envelope signal is amplified afterwards, and converted to digital signal; Then this digital signal is compared with Upper threshold and the Lower Threshold of Upper threshold unit and Lower Threshold unit respectively, restore the guidance command code of low frequency.The command code of this low frequency as shown in Figure 7.
For convenient decoding and complete copy source remote control commands code, and the restriction of existing mobile phone hardware circuit, the mode by direct ranging pulse width in step S130 copies and records source guidance command code.
As shown in Figure 8, the hardware interface schematic diagram that it is cell-phone microprocessor, its INT0 port of microprocessor is set to jump along effective, and the INT1 port is set to lower jumping along effective, and the INT0 pin of microprocessor is connected with the INT1 pin.And be provided with in microprocessor for jumping on record along effective the first timing unit width_H (n) (not shown) of signal with for recording and jump along effective the second timing unit width_L (n) (not shown) of signal.
When the INT0 port is effective, open the first timing unit width_H (n), close the second timing unit width_L (n), and record T (n); When the INT1 port is effective, open the second timing unit width_L (n), close the first timing unit width_H (n), and record T (n); Its pulse width recorded as shown in Figure 9.
Wherein, T (n) is the measured pulse width of mobile phone, and n is corresponding while being odd number is high level, and n is corresponding while being even number is low level.Coded format according to the remote control commands code, its code period is 108ms, valid data information starts the duration between 58.5~76.5ms from initial code, so handset remote controller only need start the pulse width signal timing in 108ms to first " INT0 is effective ", therefore, mobile phone only need record that first of telepilot emission is upper jumps along the effective code of interior pulse signal to 108ms, T (1) by this metering system gained~T (N) is the source remote control commands code characteristic that study is arrived, then a certain key associated with the mobile phone man-machine interface by it, and be stored in mobile phone memory, complete learning process one time.
For example, when the infrared pulse signal of telepilot transmission is " volume+", the command code for improving volume that mobile phone will be learnt carries out associated with " volume+" key or other button (knowing but the distant control function of this button must be the user) on learning-oriented handset remote controller.
The embodiment of the present invention also provides a kind of learning-oriented handset remote controller, refers to Figure 10, and described learning-oriented handset remote controller comprises infraredremote receiver 10,microprocessor 20 and storer 30.Described infraredremote receiver 10 is connected withmicroprocessor 20 with interruptive port by control/reading of I2C pick port respectively, andmicroprocessor 20 is connected withstorer 30 by its parallel port.
Wherein, infraredremote receiver 10 is for receiving the Infrared of other telepilot emission, and the guidance command code of telepilot is carried out to demodulation, describedmicroprocessor 20 is for described guidance command code is decoded and record, and with the button on mobile phone, carries out associated by the guidance command code of record.The guidance command code thatstorer 30 obtains for storing study.
Refer to Figure 11, described infraredremote receiver 10 comprises diode D1,capacitor C 1, amplification andADC converting unit 101,Upper threshold unit 102 and Lower Threshold unit 103.Describedcapacitor C 1 is connected in parallel on the two ends of diode D1, and the negative electrode of described diode D1 is connected with amplification andADC converting unit 101, the plus earth of diode D1; Described amplification andADC converting unit 101 are connected with infraredremote receiver 10 output port 12C interfaces, and describedUpper threshold unit 102 is connected with theinterruption processing unit 104 of amplification andADC converting unit 101 and infraredremote receiver 10 respectively withLower Threshold unit 103.
Wherein, described diode D1 is for being converted to Infrared the voltage signal of high frequency,capacitor C 1 is for being discharged and recharged, and described voltage signal is carried out to the filtering processing, obtain the envelope signal of guidance command code, amplify andADC converting unit 101, for this envelope signal is amplified, and convert digital signal to;Upper threshold unit 102 andLower Threshold unit 103, for digital signal and " Upper threshold " and " Lower Threshold " are compared, restore the guidance command code of low frequency.
In the present embodiment, electronic component or chip that described diode D1 andcapacitor C 1 can have rectification and filter function with other substitute.
Further, described learning-oriented handset remote controller also comprisesinfrared transmission module 40, thisinfrared transmission module 40 is connected with the PWM control port ofmicroprocessor 20, for after mobile phone is learnt the telecommand of other telepilot, to the electrical equipment emission guidance command of understanding this guidance command code.
Refer to Figure 12, describedinfrared transmission module 40 comprises metal-oxide-semiconductor U1 and infrared LED lamp D2, and described infrared LED lamp D2 is connected with the PWM output port ofmicroprocessor 20 by metal-oxide-semiconductor U1.
Described metal-oxide-semiconductor is the n channel MOS tube, and sends pwm signal control nMOS pipe break-make bymicroprocessor 20, thereby drives the infrared LED lamp.
Wherein,microprocessor 20 is 38kHz by the set of frequency of pwm signal; The button that appointment detected when handset remote controller is pressed,microprocessor 20 before calling in order the T that learns (1)~T (N), open the PWM output port when n is odd number, time delay T (n) time; When n is that even number is to close the PWM output port, time delay T (n) time, with this, from 1 to N, complete corresponding emission.
In sum, the implementation method of a kind of learning-oriented handset remote controller provided by the invention and learning-oriented handset remote controller, receive the Infrared of other telepilot emission by infrared remote receiver, and the guidance command code of telepilot is carried out to demodulation, and by microprocessor, described guidance command code is decoded and record, and with the button on mobile phone, carry out associated by the guidance command code of record, study is to the guidance command code of other telepilot, then launch corresponding control command by the infrared transmission module of mobile phone to the equipment that is appreciated that this guidance command code, realized the function of telepilot.
This learning-oriented handset remote controller provided by the invention takes full advantage of hardware resource, has increased the function of mobile phone and has not increased cost, and this learning-oriented handset remote controller may learn the remote control code of any one telepilot simultaneously, its versatility, strong adaptability.
Be understandable that, for those of ordinary skills, can be equal to replacement or change according to technical scheme of the present invention and inventive concept thereof, and all these changes or replacement all should belong to the protection domain of the appended claim of the present invention.