A kind of device using power line communication
Technical field
The present invention relates to power line transmission field, be specifically related to a kind of device using power line communication.
Background technology
Along with the development of information technology, intelligent and telecommunication increases gradually in the application of various occasion, and information communication at present generally adopts wired mode or wireless mode.Make wirelessly to transmit, have electromagnetic radiation and produce, human body is caused damage, and due to the characteristic of wireless signal, the decay of signal can be caused when penetrating barrier, Signal transmissions can be caused to occur the problems such as information dropout.
Adopt the mode of wire transmission, such as UART, CAN, SPI, DALI etc., except 2 power lines (VCC and GND), need to arrange one group of connection in addition.In order to ensure Electrical Safety, must be spaced a distance between power line and holding wire, the safe distance of standard is for being at least greater than 20CM, and this is just very complicated on line arrangement, and once power line and holding wire wrong, consequence is very serious.
In prior art, power line carrier communication is also gradually ripe, is loaded on power line by the high-frequency signal of carrying information, obtains the signal transmission on power line by special modulation/demodulation modules.Employing which is transmitted, can in order to avoid other cloth connection, but higher in use cost, and this by carrier system by the mode of signal loading on power line because electric power networks environment is unstable, its transmission stability need to improve.
Therefore, for the above-mentioned defect existed in currently available technology, be necessary to study in fact, to provide a kind of scheme, solve the defect existed in prior art.
Summary of the invention
In order to overcome the defect of above-mentioned prior art, the invention provides a kind of device using power line communication, on the basis of the live wire for powering and zero line, adding one for the transmission line of signal transmission, realizing data communication.
For solving prior art Problems existing, technical scheme of the present invention is:
Use a device for power line communication, live wire is connected to do to power with the device of described use power line communication and inputs, and use the device of power line communication to carry out communicating cascade by transmission line and other, it comprises:
One zero passage detection module, for detecting the zero point of the AC signal flowed through in described live wire, and produces a signal when the zero point of this AC signal being detected;
One voltage detection module, for detecting a voltage variety of the signal voltage flowed through in described transmission line;
One power module, is connected with described live wire, provides direct current supply for giving the device of described use power line communication;
One switch module, is connected between described live wire and transmission line;
One control module, is connected with switch module with described zero passage detection module, voltage detection module, for controlling according to information to be sent the change that described switch module adjusts signal voltage in described transmission line; And for obtaining an information according to the voltage variety of described voltage detection module.
Preferably, described zero passage detection module comprises a photoelectrical coupler, and 1 pin of described photoelectrical coupler is connected with described live wire through the first resistance R1;
2 pin of described photoelectrical coupler are connected with zero line;
4 pin of described photoelectrical coupler are connected with described power module outlet;
3 pin of described photoelectrical coupler are connected with described control module and through the second resistance R2 ground connection.
Preferably, described control module at least comprises an interrupt pin, a data pin and controls pin, and described interrupt pin is connected with described zero passage detection module; Described data pin is connected with external equipment; Described control pin is connected with described switch module.
Preferably, the signal voltage in described transmission line is the positive half cycle of AC signal.
Preferably, the signal voltage in described transmission line is AC signal negative half period.
Preferably, described information to be sent comprises origin identification code, terminates identification code and data message.
Preferably, described control module is single-chip microcomputer.
Preferably, described switch module is relay or semiconductor switch.
Preferably, described live wire and described transmission line are set together.
Compared with prior art, beneficial effect of the present invention is as follows: only need increase by a transmission lines and just realize carrying out data communication by AC signal, transmission line and live wire can be arranged together when connecting up, realize safe and reliable remote data communication with low cost, simple circuit structure.
Accompanying drawing explanation
Fig. 1 is the theory diagram that the embodiment of the present invention uses the system of power line communication;
Fig. 2 is the theory diagram that the embodiment of the present invention uses the device of power line communication;
Fig. 3 is the schematic diagram at zero point of ac signal in the embodiment of the present invention;
Fig. 4 is the theory diagram of zero passage detection module in the embodiment of the present invention;
Fig. 5 is the schematic diagram that in the embodiment of the present invention, zero passage detection module produces interrupt signal;
Fig. 6 is oscillogram when adopting the positive half cycle of ac signal to be respectively ' 1 ' or ' 0 ' as signal voltage time institute signal transmission in the embodiment of the present invention;
Fig. 7 is oscillogram when adopting the negative half period of ac signal to be respectively ' 1 ' or ' 0 ' as signal voltage time institute signal transmission in the embodiment of the present invention.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
On the contrary, the present invention is contained any by the substituting of making on marrow of the present invention and scope of defining of claim, amendment, equivalent method and scheme.Further, in order to make the public have a better understanding to the present invention, in hereafter details of the present invention being described, detailedly describe some specific detail sections.Do not have the description of these detail sections can understand the present invention completely for a person skilled in the art yet.
In prior art, power line carrier communication is also gradually ripe, but uses this technical costs higher.And other adopt the mode of wire transmission, such as UART, CAN, SPI, DALI etc., except need arranging 2 power lines (VCC and GND), need to arrange one group of connection in addition.Which has following deficiency:
(1) in order to ensure Electrical Safety, must be spaced a distance between power line and holding wire, the safe distance of standard is for being at least greater than 20CM, and this increases the difficulty on line arrangement further;
(2) connection adopts low-voltage transmission, in long-distance transmissions, cause jitter owing to there is signal attenuation;
(3) power line is high-voltage line, and connection is low-voltage line, once power line and connection wrong, dangerous situation will be caused to occur.
Therefore, there is a kind of demand, realize high reliability and remote communications with the scheme of low cost.
See Fig. 1, be depicted as the theory diagram that the embodiment of the present invention uses the system of power line communication, comprise one as the device 100 of the use power line communication of transmit leg and the device 100 of at least one use power line communication as recipient; Live wire 110 is connected to do to power with the device 100 of use power line communication and inputs, and carries out communication cascade between stream oriented device 100 by transmission line 120.
Live wire 100 is mains-supplied line, is connected with power supply network; Transmission line 120 selects electric power standard line, can wherein by the AC mains signal voltage after modulation.
Due on transmission line 120 for the signal voltage of data communication be directly modulation signal on electric main, the present invention has following technological merit: power line and connection are all high-voltage line, therefore there is not the problem of safe spacing, transmission line 120 and live wire 110 can be arranged together during wiring, even if power line and connection wrong, owing to being all high-voltage line, therefore dangerous situation can not be there is; Simultaneously owing to adopting high voltage to carry out transfer of data, signal is almost undamped in the transmission, and then the stability of signal when improve long-distance transmissions.
See Fig. 2, be depicted as the theory diagram that the embodiment of the present invention uses the device of power line communication, comprise zero passage detection module 101, control module 102, switch module 103 and voltage detection module 104, wherein,
Zero passage detection module 101, for detecting the zero point of the alternating current flowed through in described live wire 110, and produce a signal when the zero point of this AC signal being detected, control module 102 can respond to this signal;
Voltage detection module 104, for detecting a voltage variety of the signal voltage flowed through in described transmission line 120;
Switch module 103, is connected between described live wire 110 and transmission line 120;
Control module 102, is connected with switch module 103 with zero passage detection module 101, voltage detection module 104, for controlling the change that described switch module 103 adjusts signal voltage in described transmission line 120 according to information to be sent; And for obtaining an information according to the voltage variety of described voltage detection module 104.
Control module 102 can be microprocessor, such as single-chip microcomputer, in an embodiment, more comprise memory module, and storage preset data or corresponding table are used for information transmission and reception in a storage module.
Control module 102 comprises a data pin, and for being connected with external equipment, realizing can data communication between external equipment.The data message that the data pin reception external equipment of control module 102 sends over produces information to be sent; The information that transmission line 120 receives can be sent to external equipment simultaneously.
Control module 102 comprises a control pin, is connected with switch module 103, for conducting or the disconnection of control switch module 103.
Zero passage detection module 101 can detect and distinguish alternating current and be about to enter the zero point (hereinafter referred to as lower zero point) that zero point (hereinafter referred to as upper zero point) of upper half and alternating current are about to enter lower half, see Fig. 3, be depicted as the schematic diagram at zero point of ac signal.
See Fig. 4, be depicted as the theory diagram of zero passage detection module in the embodiment of the present invention, zero passage detection module 101 comprises a photoelectrical coupler, the first resistance R1 and the second resistance R2,1 pin of photoelectrical coupler is connected with one end of the first resistance R1, and the other end of the first resistance R1 is connected with live wire 110; 2 pin of photoelectrical coupler are connected with zero line; 4 pin of photoelectrical coupler export with the direct current of power module 105 and are connected; 3 pin of photoelectrical coupler are connected with control module 102, and be connected with one end of the second resistance R2, the other end of the second resistance R2 is connected with GND simultaneously.The operation principle of this circuit is not, photoelectrical coupler input termination AC signal, because the input of photoelectrical coupler is equivalent to photodiode, only in the upper half conducting of alternating current, and at the lower half of alternating current, diode ends, and the output signal that therefore photoelectrical coupler produces is periodic square wave (high level VCC, low level GND).When zero passage detection module 101 detects zero point, produce a rising edge interrupt signal; And zero passage detection module 101 is when lower zero point being detected, produce another trailing edge interrupt signal.Specifically see Fig. 5, zero passage detection module in the embodiment of the present invention can be depicted as and produce the schematic diagram of interrupt signal.
In a preferred embodiment, control module 102 at least comprises an interrupt pin, and interrupt pin is connected with the interrupt signal of described zero passage detection module 101; Interrupt pin can be responded to interrupt signal and can distinguish rising edge signal and trailing edge signal; When control module 102 sends data on transmission line 120, a data (0 or 1) is obtained successively from information to be sent, in the reception after break signal, export corresponding control signal control switch module 103 according to the value of these data to be turned on or off, make to have in transmission line 120 AC signal to export or export without AC signal, thus producing the signal voltage of these data of reflection.
Certain control module 102 also can comprise two independently interrupt pin, and induction rising edge interrupt signal and lower liter are along interrupt signal respectively.
Switch module 103 is semiconductor switch or relay; Semiconductor switch can be controllable silicon or metal-oxide-semiconductor.
Voltage detection module 104 comprises a resistance, a terminated line, another terminal connecting zero line.The magnitude of voltage of the signal voltage being coupled to voltage detection module 104 is learnt by detecting ohmically voltage.In an embodiment, adopt ADC module to detect magnitude of voltage.
In a preferred embodiment, arrange in the data communication between device 100, adopt the positive half cycle of ac signal as signal voltage, within each ac signal cycle, transmit 1bit information.Now, in transmission line 120, the lower half of AC signal is shielded, with the conducting of the upper half of AC signal or shield signal transmission.See Fig. 6, be depicted as when adopting the positive half cycle of ac signal as signal voltage, institute's signal transmission is respectively oscillogram when ' 1 ' or ' 0 '.
Below the process that signal of the present invention sends is described further.When not transmission information, switch module 103 is in off-state all the time, and on transmission line 120, no signal voltage, is in idle condition; When control module 102 want signal transmission ' 1 ' time, when zero passage detection module 101 detects upper zero point, actuating switch module 103, simultaneously when zero passage detection module 101 detects lower zero point, shutdown switch module 103.In transmission line 120, the waveform of signal ' 1 ' is see Fig. 6.
In technique scheme, transmission line 120 be in idle condition with signal transmission ' 0 ' time waveform be the same, can error code be caused in transmission signal process.In order to ensure the reliability of information transmission in communication process, eliminating the error condition in transmitting procedure, further regulation has been done to message encoding format to be sent.Information to be sent comprises origin identification code, terminates identification code and data message, can also make restriction to the length of data message simultaneously.The length of such as frame data is 8 bytes, and wherein origin identification code is a byte, and content is ' FF ', and terminating identification code is a byte, and content is ' F0 ', and middle six bytes are data message, i.e. the actual information content that will transmit.After information format is made stipulations, be only just identified as ' 0 ' signal at origin identification code and ' 0 ' signal waveform that terminates to occur between identification code, thus eliminate the interference to signal when transmission line 120 is in idle condition.The regulation of certain this information format is not unique, adopts other message encoding format to realize transfer of data and belongs to design of the present invention yet.
In a preferred embodiment, arrange in data communication, adopt the negative half period of ac signal as signal voltage, in each ac period, transmit 1bit information.Now, in transmission line 120, the upper half of AC signal is shielded, with the conducting of the lower half of AC signal or shield signal transmission.See Fig. 7, when adopting the negative half period of ac signal as signal voltage, be depicted as oscillogram when institute's signal transmission is respectively ' 1 ' or ' 0 '.When control module 102 want signal transmission ' 1 ' time, when zero passage detection module 101 detects lower zero point, actuating switch module 103, simultaneously when zero passage detection module 101 detects upper zero point, shutdown switch module 103.Certainly, above-mentioned coding mode information is tried out too in this.
Use the communication mode between the device 100 of power line communication not to be only half-duplex and transmit data, also can carry out data transmission for the mode of full duplex.In a preferred embodiment, the signal transmission form of one device 100 (transmit leg) is set to adopt the positive half cycle of ac signal as signal voltage, and the signal transmission form of another coupled device 100 (recipient) is set to adopt the negative half period of ac signal as signal voltage, because stream oriented device 100 is with homophase frequently as the signal voltage of Signal transmissions, signal can not influence each other, transmit leg can send a signal on transmission line 120 at positive half period, and in negative half-cycle, receive signal on transmission line 120; Recipient is just in time contrary, sends a signal on transmission line 120, and in positive half period, receives signal on transmission line 120, thus achieve full-duplex communication easily at negative half-cycle.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.