The utility model content
The technical problems to be solved in the utility model is, above-mentioned two-way communication at prior art is difficult to control a plurality of controlled devices and take many, the defect of high cost of resource with a controller, provide between a kind of single or multiple I/O mouths that can realize between two or more MCU one to one or the two-way isolated communication of one-to-many, and the single-line bidirectional communication optical coupling isolation circuit that cost is low, reliability is high.
The technical scheme that its technical matters that solves the utility model adopts is: construct a kind of single-line bidirectional communication optical coupling isolation circuit, it comprises first control module that has the I/O mouth, and at least one controlled device that links to each other with described first control module, and described each controlled device comprises the automatic modular converter of first input and output that is electrically connected with described first control module, the light-coupled isolation module that is electrically connected with the automatic modular converter of described first input and output, the automatic modular converter of second input and output that is electrically connected with described light-coupled isolation module, reach second control module that has the I/O mouth that is electrically connected with the automatic modular converter of described second input and output.
In above-mentioned single-line bidirectional communication optical coupling isolation circuit, each light-coupled isolation module comprises two optocoupler IC1 and IC2.
In above-mentioned single-line bidirectional communication optical coupling isolation circuit, the automatic modular converter of described each first input and output comprises the triode Q1 that links to each other with the I/O mouth of first control module, Q3, Q4, wherein, the base stage of Q1 respectively with the I/O mouth of described first control module, Q4, and the emitter of Q3 links to each other, the base stage of Q4 respectively with the base stage of Q1, the emitter of Q3 links to each other, the base stage of Q3 links to each other with the collector of Q2, the base stage of Q2 links to each other with the photosensitive tube of described IC2, the emitter of Q1 links to each other with the light emitting diode of described IC1, and Q1, Q4, the collector of Q3 and the equal ground connection of the emitter of Q2.
In above-mentioned single-line bidirectional communication optical coupling isolation circuit, the automatic modular converter of described each second input and output comprises Q5, Q6, Q7, Q8, wherein, the base stage of Q6 links to each other with the photosensitive tube of IC1, the collector of Q6 links to each other with the base stage of Q7, and the emitter of Q7 links to each other with the base stage of Q8, and the emitter of Q8 all links to each other with the I/O mouth of described second control module with the base stage of Q5, the emitter of Q5 links to each other with the light emitting diode of described IC2, and Q5, Q7, the collector of Q8 and the equal ground connection of emitter of Q6.
In above-mentioned single-line bidirectional communication optical coupling isolation circuit, described Q1, Q4, Q3 are the positive-negative-positive triode, and Q2 is a NPN type triode.
In above-mentioned single-line bidirectional communication optical coupling isolation circuit, described Q5, Q7, Q8 are the positive-negative-positive triode, and Q6 is a NPN type triode.
In above-mentioned single-line bidirectional communication optical coupling isolation circuit, described first control module comprises MCU1, and described second control module comprises MCU2.
Implement single-line bidirectional communication optical coupling isolation circuit of the present utility model, by adopting automatic modular converter of input and output and light-coupled isolation module, make its two-way communication that can realize single I/O mouth and light-coupled isolation, it not only can realize isolated communication one to one, also can realize the one-to-many isolated communication, the utility model can simplify the required a large amount of cables of multi-computer communication greatly, reduces cost, and improves reliability.
Embodiment
Referring to Fig. 1 and mongline two-way communication light lotus root buffer circuit structured flowchart shown in Figure 3, it comprises first control module 1, one or more controlled device 2.See Fig. 1 for details, Fig. 1 is the circuit structure block diagram of the isolated communication one to one of single I/O mouth in the utility model.
First control module 1 comprises MCU1 and I/O mouth, controlled device 2 comprises that the automatic modular converter 23 of the automatic modular converter 21 of first input and output, photoelectric isolation module, second input and output, second control module, 24, the second control modules 24 that connect successively comprise MCU1 and I/O mouth.I/O mouth in first control module 1 and second control module 24 all both can have been done input and receive data, also can do output and send data, and its detailed circuit is seen shown in Figure 2.
The automatic modular converter 21 of first input and output comprises: the resistance R 2 of pull-up resistor R1, R3, R4, R5 and the ground connection that links to each other with power supply respectively also comprises triode Q1, Q2, Q3, Q4.Wherein, the base stage of Q1 respectively with the I/O mouth of first control module 1, Q4, and the emitter of Q3 link to each other, the base stage of Q4 links to each other with the base stage of Q1, the emitter of Q3 respectively, the base stage of Q3 links to each other with the collector of Q2, the photosensitive tube of optocoupler IC2 in the base stage of Q2 and the light-coupled isolation module 22 links to each other, the emitter of Q1 links to each other with the light emitting diode of optocoupler IC1, and Q1, Q4, the collector of Q3 and the equal ground connection of emitter of Q2.And Q1, Q4, Q3 are the positive-negative-positive triode, and Q2 is a NPN type triode.
The automatic modular converter 23 of second input and output comprises: the resistance R 7 of pull-up resistor R6, R8, R9, R10 and the ground connection that links to each other with power supply respectively also comprises triode Q5, Q6, Q7, Q8.Wherein, the base stage of Q6 links to each other with the photosensitive tube of IC1, the collector of Q6 links to each other with the base stage of Q7, the emitter of Q7 links to each other with the base stage of Q8, the emitter of Q8 all links to each other with the I/O mouth of described second control module 24 with the base stage of Q5, the emitter of Q5 links to each other with the light emitting diode of described IC2, and Q5, Q7, the collector of Q8 and the equal ground connection of emitter of Q6.And Q5, Q7, Q8 are the positive-negative-positive triode, and Q6 is a NPN type triode.
As can be seen from Figure 2, each light-coupled isolation module 22 comprises two optocoupler IC1 and IC2, and preferably, two optocouplers are identical, when the triode conducting that links to each other with optocoupler, can drive optocoupler, thereby when realizing two-way communication, can realize light-coupled isolation.Two optocoupler IC1 and IC2 can for common single channel optocoupler to reduce cost.
Its principle of work is as follows:
One, the I/O mouth of MCU1 sends data as output, and the I/O mouth of MCU2 receives the process of data as input:
When the I/O of MCU 1 mouth output high level, Q1 ends, optocoupler IC1 does not work, the base stage of Q6 does not have bias current and voltage and ends, thereby cause Q7, Q8 to end, because of the I/O mouth of MCU2 is input, then owing to draw on the pull-up resistor R10 and be high level, therefore, Ci Shi high level signal has been transferred to MCU2.
When the I/O of MCU1 mouth output low level, the Q1 saturation conduction, optocoupler IC1 work, the base stage of Q6 obtains bias current and voltage and saturation conduction, thereby cause Q7, Q8 saturation conduction, the I/O mouth of MCU2 is input, then draws owing to the Q8 saturation conduction and with level to be low level, therefore, Ci Shi low level signal has been transferred to MCU2.
Two, the I/O mouth of MCU2 sends data as output, and the I/O mouth of MCU1 receives the process of data as input:
The circuit of cause automatic modular converter 23 of second input and output and the automatic conversion module of first input and output is symmetrical, and this process is the same with the said process principle.
When the I/O of MCU2 mouth output high level, Q5 ends, optocoupler IC2 does not work, thereby the base stage of Q2 does not have bias current and voltage and ends to cause Q3, Q4 to end, the I/O mouth of MCU1 is input, then be high level owing to pull-up resistor R5 with drawing on the level, therefore, the high level signal of this moment has been transferred to MCU1.
When the I/O of MCU2 mouth output low level, the Q5 saturation conduction, optocoupler IC2 work, the base stage of Q2 obtains bias current and thereby the voltage saturation conducting causes Q3, Q4 saturation conduction, the I/O mouth of MCU1 is input, then draw owing to the Q4 saturation conduction and with level to be low level, therefore the low level signal of this moment has been transferred to MCU1.
The utility model can also adopt other embodiment to realize, for example, triode in automatic modular converter of each first input and output and the automatic modular converter of second input and output is not limited to said circumstances, it all can adopt two or more triodes to drive optocoupler with conducting, preferably, adopt the above-mentioned mode that contains four triodes.
The utility model can also be realized the one-to-many isolated communication, can realize that like this a control panel controls the work of a plurality of electrical equipment.It realizes that principle is as follows:
As Fig. 3, it is an one-to-many isolated communication block diagram, and it comprises one first control module 1 and a plurality of controlled device or system, and the formation of each controlled device or system is the same with controlled device among Fig. 1.When controller (being equivalent to main frame) will be controlled a certain controlled device or system when (being equivalent to slave), at first an address code and control command are sent to all controlled devices or system by the I/O mouth, then making corresponding action when controlled device or system receive the address that is complementary responds, the controlled device or the system of the address code that does not conform to oneself then do not respond, its corresponding I/O mouth remains input state, does not send response data thereby do not influence the controlled device or the system that choose to controller.All controlled devices or system initiatively do not send out data and give controller when not receiving the order of controller, whole process can guarantee that by the sequential that software control data sends and receives data do not get muddled.Improved the reliability of mongline two-way communication.
Because the I/O mouth among MCU1 and the MCU2 both can be used as input and also can be used as the delivery outlet line, by the automatic modular converter 21 of first input and output, the automatic modular converter 23 of second input and output and light-coupled isolation module 22, the utility model can finish single I/O one to one or the isolated communication of one-to-many, having solved single in the past I/O mouth can only be as inputing or outputing a function in isolated communication, thereby causes the problem of MCU resource anxiety.Simultaneously, be the relation of one-to-many between control device of the present utility model and a plurality of controlled device or the system, be separate between each controlled device, and also can give main frame better to control by output feedback signal in the controlled device.And, the utility model only need be transformed into many lines on the single line and isolate and get final product, simplified circuit like this, reduced cost, and the utility model only needs common single channel optocoupler, some resistance and triode to form the input and output automatic switching circuit, and electronic devices and components are simple, price is lower, and it has also simplified the required a large amount of cables of multi-computer communication greatly, reduce the entire circuit cost, improved reliability.
In sum, the utility model can be widely used in the controlled device of a plurality of needs safety of controller control isolation or the communication between the system.And reliable communications, cost is lower.