Embodiment
One end of the present utility model is connected with the normally opened contact end of remote control output relay, and the other end is connected with the common end of this relay.
The utility model comprises remote control output relay, CPU, holding circuit, rectification circuit, optocoupler testing circuit and detection signal output circuit.
Existing equipment is connected with the normally opened contact of remote control output relay: the normally opened contact end of remote control output relay is connected with an input end of rectification circuit by holding circuit, and the common end of this relay is connected with another input end of rectification circuit; The output terminal of rectification circuit is connected with the input end of optocoupler testing circuit, and the output terminal of optocoupler testing circuit is connected with the input end of detection signal output circuit, and the output terminal of detection signal output circuit is connected with the I/O port of CPU.
Optocoupler testing circuit of the present utility model can adopt the optocoupler testing circuit that only comprises 1 optocoupler, also can adopt the optocoupler testing circuit that comprises 2 optocouplers.
As shown in Figure 1, the utility model comprises remote control output relay, CPU, holding circuit, rectification circuit, one-level optocoupler testing circuit, secondary optocoupler testing circuit and detection signal output circuit.
The normally opened contact end of remote control output relay is connected with an input end of rectification circuit by holding circuit, and the common end of this relay is connected with another input end of rectification circuit; The output terminal of rectification circuit is connected with one-level optocoupler testing circuit, one-level optocoupler testing circuit is connected with secondary optocoupler testing circuit, secondary optocoupler testing circuit is connected with the input end of detection signal output circuit, and the output terminal of detection signal output circuit is connected with the I/O port of CPU.
Holding circuit has overcurrent protection, prevents the whole remote control circuit of rear end fault effects.
The effect of rectification circuit is mainly when being direct current for remote control equipment power supply, and after overcommutation, it is negative that no matter the wiring of external remote control equipment connect just connects, and remote control circuit can be correct detects loop state.
Take normally opened contact as example: supposes that conventional remote control equipment power supply has two kinds at present, exchange 220/380V or direct current 24V-100V.If remote control circuit is normal, between the normally opened contact of relay, just there is so voltage, voltage range is at AC220/380V ± 20% or DC24V-100V.
Voltage is through there being the holding circuit of overcurrent protection; then after a series of voltage dividing potential drop; via rectification circuit, enter first order optocoupler again; drive the light emitting diode conducting of this optocoupler; then the light emitting diode conducting of the signal driver second level optocoupler of this one-level optocoupler, finally the output signal of this secondary optocoupler is input to the I/O port of CPU.Now, CPU judges according to initial state current remote control circuit is in which kind of state.When external remote control equipment is connected with alternating current equipment, the signal that inputs to the IO port of CPU is square-wave signal; When external remote control equipment is connected with DC equipment, the signal that inputs to the IO port of CPU is the level signal of a normality.
Take that outside alternating current equipment is connected with the normally opened contact of remote control circuit below, to adopt the situation of the optocoupler testing circuit that comprises 2 optocouplers be example to optocoupler testing circuit, the utility model is further described.
As shown in Figure 2, the dotted line left side is the equipment that external remote control loop connects, and at this, with the relay exchanging, replaces.The utility model comprises relay, external ac power source AC, remote control output relay, thermistor PTC3, divider resistance circuit, rectifier bridge REC1, optocoupler D9, output resistance R60, optocoupler D10 and triode V17.
Remote control output relay comprises the common end COM of normally opened contact end NO, remote control output relay.
Divider resistance circuit comprises resistance R 62, resistance R 55, resistance R 56, resistance R 59, resistance R 57, resistance R 58 and resistance R 61.
One end of external ac power source AC is connected with the normally opened contact end NO of remote control output relay, and the other end of this power supply is connected with the common end COM of remote control output relay by relay.Above-mentioned normally opened contact end NO is connected with 1 end of rectifier bridge REC1 by thermistor PTC3 series connection divider resistance circuit, 2 ends of this rectifier bridge are connected with the common end COM of remote control output relay, its 3 end is connected with 2 pin of optocoupler D9, its 4 end is connected with 3 pin of this optocoupler D9, is also connected to a polarity free capacitor C23 between 3 ends of this rectifier bridge and 4 ends.8 pin of optocoupler D9 are connected with the anode tap of optocoupler D10 by resistance R 64; 6 pin of optocoupler D9 are all connected with power supply V12P0_ISO with 8 pin; 5 pin of this optocoupler D9 are by output resistance R60 ground connection, and this 5 pin is also connected with the base stage of triode V17 by resistance R 54.The collector of triode V17 is connected with the cathode terminal of optocoupler D10, its grounded emitter.The collector terminal of optocoupler D10 is connected with power supply V3P3 by resistance R 63, and this collector is also connected with the I/O pin of CPU, for transmitting detection signal detec; Between the collector terminal of this optocoupler D10 and emitter-base bandgap grading end, be also connected to a polarity free capacitor C24; The emitter-base bandgap grading end ground connection of this optocoupler D10.
As can be seen from the figure, the loop of the normal work of external remote control equipment is normally opened contact end NO, the common end COM of remote control output relay, relay, the external ac power source AC of external ac power source AC, remote control output relay, that is to say that the remote control actuating equipment of outside power supply is received between the normally opened contact of remote control output relay.It is normally opened contact end NO, thermistor PTC3, resistance R 62, resistance R 55, resistance R 56, resistance R 59, resistance R 57, resistance R 58, resistance R 61, rectifier bridge REC1, the common end COM of remote control output relay, relay, the external ac power source AC of external ac power source AC, remote control output relay that remote control detects loop.
During original state, terminal powers on, what equipment the outside, contact of remote control output relay does not take over, above-mentioned remote control detects in loop and does not have power supply, and optocoupler D9 can not conducting, thereby the base stage of triode V17 does not have voltage, triode can not conducting, so optocoupler D10 can not conducting, detection signal detec is owing to drawing effect in resistance R 63, so the I/O pin of CPU reads in high level signal always.If outside incoming transport equipment now; so above-mentioned remote control detects loop and has voltage; voltage is protected and electric resistance partial pressure by temperature-sensitive; then by rectifier bridge REC1, make optocoupler D9 conducting; the upper voltage that produces of output resistance R60, impels triode V17 conducting, thus optocoupler D10 conducting; the optocoupler D10 that detection signal detec is switched on moves ground to, and the signal that the I/O pin of CPU reads in becomes low level signal.
Because outside access is 50Hz alternating current equipment, so detection signal detec is a square-wave signal, but dutycycle 1:1 not necessarily, this is that parameter by physical circuit determines.If what outside, connect is direct current signal, and when External Access Equipment and loop are normal time, detection signal detec is a normal low signal so.CPU can, by reading the state of detection signal detec, judge that whether current remote control circuit is normal; What if necessary, CPU also can access according to this current outside of signal judgement is DC equipment or alternating current equipment.
The utility model also has the second circuit implementing scheme, only adopts an optocoupler.Physical circuit connects: remove optocoupler 10 in Fig. 2, pull-up resistor R63 and power supply V3P3,2 pin of resistance R 64 are connected with 3 pin of triode V17,3 pin of this triode are connected with the I/O pin of CPU, for transmitting detection signal detec.Capacitor C 24 is connected between triode 3 pin and ground.
At this, adopted triode as shown in Figure 2 to drive the scheme of optocoupler.The needed drive current of triode and driving voltage are all very little, thus adopt the mode of triode to meet design requirement, also economic and practical.Therefore, adopt the embodiment that is driven second level optocoupler by triode, namely adopt the circuit embodiment of two-stage optocoupler for preferred.
The difficult point of the utility model design is: 1. external unit voltage range is at AC220/380V ± 20% or DC24V-100V, and voltage span is very large; 2. the electric current of remote control circuit self will be limited in 2mA, prevents the excessive equipment malfunction work that causes of loop current.Therefore, the utility model needs the in the situation that of large voltage and small voltage, to work simultaneously, and guarantees to have enough electric currents to impel optocoupler conducting, could examinations.
In order to solve an above-mentioned difficult problem, the utility model has been done following measure.
1. the type selecting of one-level optocoupler and circuit design.
The selection of one-level optocoupler (optocoupler D9 position as shown in Figure 2) at least will meet 3 requirements: its diode to drive galvanic current little, advise this drive current≤0.5mA; Its current transfer ratio (CTR) will be tried one's best greatly, advises this current transfer ratio >=300%; It is withstand voltage will meet the withstand voltage of 4KV.
For these three parameters of one-level optocoupler, also to select moderately, if certainly parameter is far superior to such requirement, implement than being easier to, but device cost be higher, so will consider simultaneously.
One-level optocoupler is except the selection of parameter, also particular importance in circuit design, the output of one-level optocoupler as shown in Figure 3 has a variety of connections, but in order to utilize the characteristic of current transfer ratio, output resistance need to be received on one-level optocoupler pin 5, and be pulled down to ground.
2. the selection of the output resistance of one-level optocoupler.
After the output resistance wiring position of one-level optocoupler is determined, its resistance is selected also particular importance.In the utility model, the resistance of this output resistance needs large as far as possible, could on this output resistance, form enough driving voltages and drive circuit below in little electric current.The utility model can adopt the resistance of output resistance to be more than or equal to the resistance of 100k Ω.
3. the selection of the Detection capacitance before one-level optocoupler.
When selecting the capacitance of Detection capacitance to be less than or equal to 1 μ F, it is alternating current equipment or DC equipment by CPU judgement External Access Equipment that the utility model can provide detection signal.
In addition, if do not need to judge that the equipment of outside access is alternating current equipment or DC equipment, the utility model can be realized by raising the capacitance (capacitance that is Detection capacitance is greater than 1 μ F) of Detection capacitance, when exchanging input, also final output signal can be adjusted into level signal like this, but not square-wave signal; Be convenient to like this routine processes; Aspect anti-shake or inhibition interference, can provide better signal guarantee simultaneously.