CN110032107A - The flogic system and control method of 4 road signal on-off are controlled by 3 relays - Google Patents

The flogic system and control method of 4 road signal on-off are controlled by 3 relays Download PDF

Info

Publication number
CN110032107A
CN110032107A CN201910302013.7A CN201910302013A CN110032107A CN 110032107 A CN110032107 A CN 110032107A CN 201910302013 A CN201910302013 A CN 201910302013A CN 110032107 A CN110032107 A CN 110032107A
Authority
CN
China
Prior art keywords
relay
control unit
signal
mcu control
usb
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910302013.7A
Other languages
Chinese (zh)
Other versions
CN110032107B (en
Inventor
罗向东
刘聪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nantong University
Original Assignee
Nantong University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nantong University filed Critical Nantong University
Priority to CN201910302013.7A priority Critical patent/CN110032107B/en
Publication of CN110032107A publication Critical patent/CN110032107A/en
Application granted granted Critical
Publication of CN110032107B publication Critical patent/CN110032107B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0428Safety, monitoring
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24024Safety, surveillance

Abstract

The invention discloses a kind of flogic systems that 4 road signal on-off are controlled by 3 relays, are characterized by: turning Transistor-Transistor Logic level conversion circuit and signal input output interface unit including MCU control unit, relay logical control circuit, USB power connector circuit, USB.MCU control unit is used for the control that accesses to relay logical control circuit.USB turns Transistor-Transistor Logic level of the Transistor-Transistor Logic level conversion circuit for that can identify the USB level translation that USB power connector circuit receives for MCU control unit.Signal input output interface unit realizes analog signal input and output for connecing the instrument and equipments such as antenna, filter, converter.Relay logical control circuit includes 3 relays, realizes the extension of signal path between relay contact by cascade, is controlled all the way four road signal behaviors of signal input output interface unit.

Description

The flogic system and control method of 4 road signal on-off are controlled by 3 relays
Technical field
The present invention relates to relay control system field, specifically a kind of 4 road signal on-off of being controlled by 3 relays Flogic system and control method.
Background technique
It is industrially frequently necessary to acquisition multi-input device analog signal, but multichannel mould is acquired by a converter There is very big drawback in quasi- signal, need ceaselessly connecting-disconnecting interface connector switch over, it is clear that it is more troublesome, furthermore to precision The interface of instrument or converter will also result in abrasion, reduce its service life.
Single-chip microcontroller is also known as single chip microcontroller, it does not complete the chip of some logic function instead of, and one is counted In the calculation machine system integration a to chip.Single-chip microcontroller is widely used in various control fields at present, such as intelligent instrumentation, doctor With equipment, robot etc..Relay possesses the effect similar to switch, and relay is widely used in various electronic equipments In control circuit, for isolation control signal and load.Certain special outputs require only control signal to patrol according to scheduled It when collecting sequence sending, could export, and under normal conditions, be merely able to control signal gating all the way using a relay, and Want to realize that the gating of four road signals usually requires four relays and controls respectively.Currently, signal control circuit generally uses core Piece digital circuit, circuit is complex, relatively high to designer's technical requirements.
Summary of the invention
The object of the present invention is to provide a kind of circuit is simple, it is convenient to realize, 3 relays can be controlled based on single-chip microcontroller Gate the flogic system and control method of 4 road signals.
Realizing the basic technical scheme of the object of the invention is: a kind of logic system controlling 4 road signal on-off by 3 relays System, is structurally characterized in that: turning TTL including MCU control unit, relay logical control circuit, USB power connector circuit, USB Level shifting circuit and signal input output interface unit.MCU control unit is for visiting relay logical control circuit Ask control.USB turns USB level translation of the Transistor-Transistor Logic level conversion circuit for receiving USB power connector circuit as MCU control The Transistor-Transistor Logic level that unit can identify.Signal input output interface unit is set for connecing the instruments such as antenna, filter, converter It is standby, realize analog signal input and output.Relay logical control circuit includes 3 relays, passes through grade between relay contact Connection realizes the extension of signal path, is controlled all the way four road signal behaviors of signal input output interface unit.
Technical solution based on above-mentioned basic technical scheme is: MCU control unit is equipped with the first crystal oscillating circuit and again Position circuit.First crystal oscillating circuit is used to provide clock signal to MCU control unit.Reset circuit is for making MCU control unit Program counter is reset, and allows MCU control unit steady operation.
Technical solution based on above-mentioned corresponding technical solution is: USB power connector circuit includes USB female seat M1, Ten capacitor C10, the 11st polar capacitor C11 and the 9th light emitting diode D9.USB female seat M1 uses Micro USB base.Electricity 11st polar capacitor C11 of source interface circuit uses alminium electrolytic condenser, has the function of filtering and energy storage, can allow PC machine Stable power-supplying.Power on indicator light of the 9th light emitting diode D9 as power interface circuit prompts custom system to be powered.
Technical solution based on above-mentioned corresponding technical solution is: it includes that level turns that USB, which turns Transistor-Transistor Logic level conversion circuit, Chip G1 is changed, it is the switching chip an of usb bus, realizes that USB turns serial ports, USB turns that IrDA is infrared or USB turns printing Mouthful.Electrical level transferring chip G1 is used to the USB level translation that USB power connector circuit receives be that MCU control unit can be known Other Transistor-Transistor Logic level.
Technical solution based on above-mentioned corresponding technical solution is: it is brilliant equipped with second that USB turns Transistor-Transistor Logic level conversion circuit Shake circuit, and the second crystal oscillating circuit is used to provide clock signal to electrical level transferring chip G1.Electrical level transferring chip G1 uses model The chip of CH340G.The UD+ pin of CH340G is connected with the D+ pin of MICRO USB, the D- of UD- pin and MICRO USB Pin is connected.The transmission pin TXD of CH340G chip and receive pin RXD respectively with the reception pin of MCU control unit RXD is connected with transmission pin TXD.MCU control unit receives pin RXD backward dioded D8 and CH340G chip TXD pin is connected, and backward dioded D8 uses 1N4148, has prevented electric current from can flow into late-class circuit simultaneously by this pin And the capacitor charging of rear class is given, it causes rear class to have the voltage of certain amplitude, causes to influence the cold of MCU control unit downloading program Starting.
Technical solution based on above-mentioned corresponding technical solution is: 3 relays of relay logical control circuit point For the first relay U1, the second relay U2 and third relay U3.3 relays are all made of signal relay, the letter Number control voltage is 5V, contact form are as follows: DPDT.The signal relay has 8 pins, including relay coil Positive and negative anodes pin, a pair of of normally opened contact, a pair of of normally-closed contact and a pair of public terminal contacts are very good with the isolation effect of signal.
After the coil of first relay U1 is concatenated with the first PNP type triode Q1, relay coil both ends simultaneously connect one One sustained diode 1, mono- termination power+5V of the first PNP type triode Q1, the grid of the first PNP type triode Q1 connect MCU control The relay of unit processed controls I/O port P23, while concatenating second resistance R2, pull-up electricity of the first resistor R1 as I/O port Resistance.
After the coil of second relay U2 is concatenated with the second PNP type triode Q2, relay coil both ends simultaneously connect one Two sustained diodes 2, mono- termination power+5V of the second PNP type triode Q2, the grid of the second PNP type triode Q2 connect MCU control The relay of unit processed controls I/O port P22, while concatenating the 4th resistance R4, pull-up electricity of the 3rd resistor R3 as I/O port Resistance.
After the coil of third relay U3 is concatenated with third PNP type triode Q3, relay coil both ends simultaneously connect one Three sustained diodes 3, mono- termination power+5V of third PNP type triode Q3, the grid of third PNP type triode Q3 connect MCU control The relay of unit processed controls I/O port P21, while concatenating the 6th resistance R6, pull-up electricity of the 5th resistance R5 as I/O port Resistance.
First via analog signal channel is from the input of the normally-closed contact of the first relay U1, and the public terminal contacts phase with it The normally-closed contact via third relay U3 is connected, then from the public terminal contacts output signal of third relay U3, it is MCU The P23 mouth of control unit sends high level to the first relay U1, while P21 mouthfuls send high level to third relay U3.
Second road analog signal channel is from the input of the normally opened contact of the first relay U1, and the public terminal contacts phase with it Connection via third relay U3 normally-closed contact, then from the public terminal contacts output signal of third relay U3, turn-on condition Be that the P23 mouth of MCU control unit sends low level to the first relay U1, at the same P21 mouthful sent to third relay it is high electric It is flat.
Third road analog signal channel is from the input of the normally-closed contact of the second relay U2, and the public terminal contacts phase with it Connection via third relay U3 normally opened contact, then from the public terminal contacts output signal of third relay U3, turn-on condition It is that the P22 mouth of MCU control unit sends high level to the second relay U2, while P21 mouthful are given third relay U3 transmission low electricity It is flat.
4th road analog signal channel is to input from the normally opened contact of the second relay, and be connected with its public terminal contacts Connect the normally opened contact via third relay U3, then from the public terminal contacts output signal of third relay U3, turn-on condition It is that the P22 mouth of MCU control unit sends low level to the first relay U1, while P21 mouthful are given third relay U3 transmission low electricity It is flat.
Technical solution based on above-mentioned corresponding technical solution is: further including signal gating indicating circuit.Signal gating Indicating circuit is made of four light emitting diodes and third load resistance.Four light emitting diodes are respectively the 4th light-emitting diodes Pipe D4, the 5th light emitting diode D5, the 6th Light-Emitting Diode D6 and the 7th light emitting diode D7.Third load resistance includes the 11 resistance R11, twelfth resistor R12, thirteenth resistor R13 and the 14th resistance R14.4th light emitting diode D4 and 11 resistance R11 are connected between+5V power supply and the P24 foot of MCU control unit.The electricity of 5th light emitting diode D5 and the 12nd Resistance R12 is connected between+5V power supply and the P25 foot of MCU control unit.6th Light-Emitting Diode D6 and thirteenth resistor R13 string It is associated between+5V power supply and the P26 foot of MCU control unit.7th light emitting diode D7 and the 14th resistance R14 are connected on+5V Between power supply and the P27 foot of MCU control unit.
It is had follow steps by the control method that 3 relays control the flogic system of 4 road signal on-off:
One, Single Chip C Language programs.When selection signal channel, using case case statement.
Two, it sends data cell 0x01 and represents IN1 signal path, the IO foot P23 of MCU control unit exports high level, makes First PNP triode Q1 cut-off, the first relay U1 coil both ends do not have voltage at this time, therefore the first relay U1 does not work, Its normally-closed contact and common end contact closure, the conducting of IN1 branch, the 4th light emitting diode D4 are assigned a value of 0, and lamp is bright to represent IN1 Road gating.The IO foot P21 of MCU control unit exports high level simultaneously, ends third PNP triode Q3, at this time third relay Device U3 coil both ends do not have voltage, therefore third relay U3 does not work, its normally-closed contact and common end contact closure, OUT Branch conducting, so that first via analog signal channel is connected.
Three, it sends data cell 0x02 and represents IN2 signal path, the IO foot P23 of MCU control unit exports low level, makes First PNP triode Q1 conducting, the first relay U1 coil both end voltage is 5V at this time, therefore the first relay U1 starts to work, Its normally-closed contact disconnects, normally opened contact and common end contact closure, and IN2 branch conducting, the 5th light emitting diode D5 is assigned a value of 0, lamp is bright to represent the road IN2 gating.The IO foot P21 of MCU control unit exports high level simultaneously, cuts third PNP triode Q3 Only, third relay U3 coil both ends do not have voltage at this time, therefore third relay U3 does not work, its normally-closed contact and public affairs Terminal contacts closure altogether, OUT branch conducting, thus second road signal channel conductive.
Four, it sends data cell 0x03 and represents IN3 signal path, the IO foot P22 of MCU control unit exports high level, makes Second PNP triode Q2 cut-off, the second relay U2 coil both ends do not have voltage at this time, therefore the second relay U2 does not work, Its normally-closed contact and common end contact closure, the conducting of IN3 branch, the 6th Light-Emitting Diode D6 are assigned a value of 0, and lamp is bright to represent IN3 Road gating.The IO foot P21 of MCU control unit exports low level simultaneously, third PNP triode Q3 is connected, at this time third relay Device U3 coil both end voltage is 5V, therefore third relay U3 starts to work, and normally-closed contact disconnects, and normally opened contact and common end are touched Point closure, OUT branch conducting, so that third road signal path is connected.
Five, it sends data cell 0x04 and represents IN4 signal path, the IO foot P22 of MCU control unit exports low level, makes Second PNP triode Q2 conducting, the second relay U2 coil both end voltage is 5V at this time, therefore the second relay U2 starts to work, Its normally-closed contact disconnects, normally opened contact and common end contact closure, and IN4 branch conducting, the 7th Light-Emitting Diode D7 is assigned a value of 0, lamp is bright to represent the road IN4 gating.The IO foot P21 of MCU control unit exports low level simultaneously, leads third PNP triode Q3 Logical, third relay U3 coil both end voltage is 5V at this time, therefore third relay U3 starts to work, and normally-closed contact disconnects, normally opened Contact and common end contact closure, OUT branch conducting, so that the 4th tunnel signal path is connected.
The present invention has the following beneficial effects: (1) circuit of the invention is simple, it is convenient to realize, used based on single-chip microcontroller Three signal relays are achieved that acquisition and control to four road signals, easily communicate with host computer completion, control more The signal of instrument and equipment inputs, and realization accurately controls equipment input signal, can acquire mould according to specified instrument and equipment Quasi- signal, controls four road signal behaviors all the way, greatly improves the control efficiency and accuracy between equipment.
(2) present invention can be connected on computer by USB data line, and user sends data to equipment by host computer The input and output of signal carry out long-range control and accurate control.
(3) present invention realizes the gating control to four tunnel analog signals using three signal relays, is greatly saved Cost.
(4) four road signal behaviors are switched over without connecting-disconnecting interface connector through the invention, protection interface not rapid wear It is bad, substantially increase the long-lasting use property of equipment and instrument.
(5) relay in the present invention selects the signal relay of model G6J-2P-Y-DC5V, with being isolated for signal Effect is very good.It is 5V, contact form are as follows: DPDT that it, which controls voltage,.The signal relay has 8 pins, including relay line The positive and negative anodes pin of circle, a pair of of normally opened contact, a pair of of normally-closed contact and a pair of public terminal contacts.
(6) control method of the invention for controlling 3 relays based on single-chip microcontroller and gating the flogic system of 4 road signals The extension of signal path is realized by the cascade between relay contact, similarly, can also be realized and be controlled 4N with 3N relay The flogic system of road signal on-off, N are natural number, and application prospect is extensive.
Detailed description of the invention
Fig. 1 is the flogic system structural block diagram of the invention that 4 road signal on-off are controlled by 3 signal relays.
Fig. 2 is circuit diagram of the invention.
Fig. 3 is the amplifying circuit schematic diagram of MCU control unit in Fig. 2.
Fig. 4 is the amplifying circuit schematic diagram of relay logic control circuit in Fig. 2.
Fig. 5 is the logical method figure that 3 relays of the invention control 4 road signals.
Fig. 6 is the amplifying circuit schematic diagram of USB power connector circuit in Fig. 2.
Fig. 7 is the amplifying circuit schematic diagram that USB turns Transistor-Transistor Logic level conversion circuit in Fig. 2.
Fig. 8 is the truth table (0,1 of the flogic system of the invention that 4 road signal on-off are controlled by 3 signal relays Indicate that low and high level, X indicate unrelated with P2 mouthfuls of single-chip microcontroller of level).
Fig. 9 is the present invention when four road signals are strobed respectively, with multimeter ohms range to being strobed input and output The result verification figure that mouth measurement obtains.(contact 2 and 7 is normally-closed contact pair, and contact 4 and 5 is normally opened contact pair ,/indicate relay Device contact working condition is any).
Label in attached drawing are as follows:
MCU control unit 1,
Relay logical control circuit 2,
USB power connector circuit 3,
USB turns Transistor-Transistor Logic level conversion circuit 4,
Signal input output interface unit 5,
Signal gating indicating circuit 6,
Reset circuit 10, reset button 100.
Specific embodiment
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.Meanwhile in the present invention Description in, term " first ", " second " etc. be only used for distinguish description, be not understood to indicate or imply relative importance.
(embodiment 1)
See Fig. 1 to Fig. 7, the flogic system of the invention for controlling 4 road signal on-off by 3 relays includes that MCU control is single Member 1, relay logical control circuit 2, USB power connector circuit 3, USB turn Transistor-Transistor Logic level conversion circuit 4, signal input and output Interface unit 5 and signal gating indicating circuit 6.
MCU control unit 1 uses 8 low-power consumption of the model STC89C52 of STC Corporation, high-performance CMOS microcontrollers There is device 8K byte system may be programmed flash storage.MCU control unit 1 is used to carry out relay logical control circuit 2 Access control.MCU control unit 1 is equipped with the first crystal oscillating circuit and reset circuit 10.
First crystal oscillating circuit includes the second capacitor C2, third capacitor C3 and the first crystal oscillator Y1.First crystal oscillating circuit is for giving MCU control unit 1 provides clock signal.Connect a 11.0592MHz's between X1 the and X2 pin of MCU control unit 1 First crystal oscillator Y2 meets the second load capacitance C2 in X1 pin, meets third load capacitance C3 in X2 pin, the first crystal oscillator Y1 will be mentioned For required clock signal.
Reset circuit 10 includes reset button 100, the first load resistance and quadripolarity capacitor C4.Reset circuit 10 is used In resetting the program counter of MCU control unit 1,1 steady operation of MCU control unit is allowed.First load resistance includes the 7th Resistance R7 and the 8th resistance R8.Reset button 100 is connected electrically between the 7th resistance R7 and the anode of quadripolarity capacitor C4, 7th resistance R7 is electrically connected with the cathode of quadripolarity capacitor C4.8th one end resistance R8 ground connection, the other end and quadripolarity electricity Hold the cathode electrical connection of C4.The anode of quadripolarity capacitor C4 connects+5V power supply.
USB power connector circuit 3 includes USB female seat M1, the second load resistance, the tenth capacitor C10, the 11st polarity electricity Hold C11 and the 9th light emitting diode D9.
USB female seat M1 uses Micro USB female seat, and Micro USB connector is than standard USB and Mini USB connector It is smaller, space is saved, there is up to 10000 connect-disconnect lives and intensity, the design of blindmate structure.Micro USB standard is supported The OTG function of USB at present can be directly realized by data transmission that is, in the case where no host, between portable equipment, compatible USB1.1 and USB 2.0, while data transmission and charging being provided, Micro USB versatility is wide, easy to use.Micro USB Plug end has 5 function pins, is respectively as follows: VBUS (the positive 5V of power supply), D- (data line negative), D+ (data line is just), ID and (and divides For the two kinds of interfaces for being connected with line and not being connected with ground wire), GND (signal ground), do not need in the present embodiment to use ID pipe Foot.11st polar capacitor C11 of power interface circuit 3 uses alminium electrolytic condenser, has the function of filtering and energy storage, can Allow PC machine stable power-supplying.Power on indicator light of the 9th light emitting diode D9 as power interface circuit prompts custom system logical Electricity.Tenth capacitor C10 and the 11st polar capacitor C11 are in parallel.The anode of VBUS and the 11st polar capacitor C11 and the tenth electricity Hold C10 electrical connection;The cathode of 11st polar capacitor C11 is grounded.Second load resistance includes the 9th resistance R9 and the tenth resistance R10.D- is electrically connected with one end of the tenth resistance R10.D+ is electrically connected with one end of the 9th resistance R9.
It includes electrical level transferring chip G1 that USB, which turns Transistor-Transistor Logic level conversion circuit 4, the type of electrical level transferring chip G1 in the present embodiment It number is CH340G, it is the switching chip an of usb bus, realizes that USB turns serial ports, USB turns that IrDA is infrared or USB turns to beat Print mouth.Microcontroller serial port (Transistor-Transistor Logic level) is want to communicate with computer serial port (USB level), it is necessary to so that the level logic one of the two Sample can just communicate.In the present embodiment, the USB level translation that CH340G chip is used to receive USB base M1 is MCU control The Transistor-Transistor Logic level that unit 1 processed can identify.USB turns TTL level shifting circuit 4 equipped with the second crystal oscillating circuit, the second crystal oscillating circuit For providing clock signal to CH340G chip, XI the and XO pin of CH340G chip is arranged in the second crystal oscillating circuit.Second is brilliant The circuit that shakes includes the 5th capacitor C5, the 6th capacitor C6 and the second crystal oscillator Y2.
The UD+ pin of CH340G is connected with the D+ pin of MICRO USB, the D- pin of UD- pin and MICRO USB It is connected.The transmission pin TXD of CH340G chip and receive pin RXD respectively with the reception pin RXD of MCU control unit 1 and Transmission pin TXD is connected.The TXD of the reception pin RXD backward dioded D8 and CH340G chip of MCU control unit 1 draws Foot is connected, and backward dioded D8 uses 1N4148, has prevented electric current from can flow into late-class circuit by this pin and to after The capacitor charging of grade, causes rear class to have the voltage of certain amplitude, causes to influence the cold start-up that MCU control unit 1 downloads program.
USB turns the principle of Transistor-Transistor Logic level conversion circuit 4: signal in CH340G built-in chip type usb bus pull-up resistor and piece End, UD+ and UD- pin should be directly connected on usb bus.The built-in electrification reset circuit of CH340G.During operation, CH340G needs to provide the clock signal of 12MHz on XI pin.This usual clock signal be by XI and XO pin it Between connect a 12MHz the second crystal oscillator Y2, meet the 5th load capacitance C5 in XI pin, connect the 6th load capacitance in XO pin C6, the second built-in crystal oscillator Y2 will provide required clock signal.Draw when clock signal is sent into XI using external oscillator Foot, and make XO pin floating.CH340G supports 5V operation, when operating using 5V, provides 5V voltage to VCC pin.
Signal gating indicating circuit 6 is made of four light emitting diodes and third load resistance.Four light emitting diodes point It Wei not the 4th light emitting diode D4, the 5th light emitting diode D5, the 6th Light-Emitting Diode D6 and the 7th light emitting diode D7.The Three load resistances include eleventh resistor R11, twelfth resistor R12, thirteenth resistor R13 and the 14th resistance R14.4th Light emitting diode D4 and eleventh resistor R11 is connected between+5V power supply and the P24 foot of MCU control unit 1.5th luminous two Pole pipe D5 and twelfth resistor R12 is connected between+5V power supply and the P25 foot of MCU control unit 1.6th Light-Emitting Diode D6 And thirteenth resistor R13 is connected between+5V power supply and the P26 foot of MCU control unit 1.7th light emitting diode D7 and the tenth Four resistance R14 are connected between+5V power supply and the P27 foot of MCU control unit 1.Specific implementation is single by controlling to MCU The program of 1 downloading of member is completed, and user need to only transmit data cell, observation on host computer.Certain all the way signal gating it Afterwards, the lumination of light emitting diode of the corresponding road signal, instruction user's road signal successfully gate: IN1 signal path gating, the Four light emitting diode D4 are bright;IN2 signal path gating, the 5th light emitting diode D5 are bright;IN3 signal path gating, the 6th shines Diode D6 is bright;IN4 signal path gating, the 7th light emitting diode D7 are bright.
Signal input output interface unit 5 is made of 6 90 degree curved sub-miniature A connector bases, and 6 sub-miniature A connector bases are successively Be divided into the first sub-miniature A connector base P1, the second sub-miniature A connector base P2, third sub-miniature A connector base P3, the 4th sub-miniature A connector base P4, 5th sub-miniature A connector base P5 and the 6th sub-miniature A connector base P6.Wherein the first sub-miniature A connector base P1, the second sub-miniature A connector base P2, third sub-miniature A connector base P3, input interface of the 4th sub-miniature A connector base P4 as four road signals, the 5th sub-miniature A connector base Output interface of the P5 as signal, the 6th sub-miniature A connector base P6 is as the power interface that can individually power.Sub-miniature A connector base is used In connecing the instrument and equipments such as antenna, filter, converter, analog signal input and output are realized.
Relay logical control circuit 2 includes 3 relays, and 3 relays are divided into the first relay U1, the second relay Device U2 and third relay U3.3 relays are all made of the signal relay of the model G6J-2P-Y-DC5V of Omron, should Signal relay is the signal relay that a kind of small dimension is specifically used to handle analog signal, and control voltage is 5V, contact shape Formula are as follows: DPDT.The signal relay has 8 pins, the positive and negative anodes pin including relay coil, a pair of of normally opened contact, a pair Normally-closed contact and a pair of public terminal contacts are very good with the isolation effect of signal.
After the coil of first relay U1 is concatenated with the first PNP type triode Q1, relay coil both ends simultaneously connect one One sustained diode 1, mono- termination power+5V of the first PNP type triode Q1, the grid of the first PNP type triode Q1 connect MCU control The relay of unit 1 processed controls I/O port P23, while concatenating second resistance R2, pull-up electricity of the first resistor R1 as I/O port Resistance.
After the coil of second relay U2 is concatenated with the second PNP type triode Q2, relay coil both ends simultaneously connect one Two sustained diodes 2, mono- termination power+5V of the second PNP type triode Q2, the grid of the second PNP type triode Q2 connect MCU control The relay of unit 1 processed controls I/O port P22, while concatenating the 4th resistance R4, pull-up electricity of the 3rd resistor R3 as I/O port Resistance.
After the coil of third relay U3 is concatenated with third PNP type triode Q3, relay coil both ends simultaneously connect one Three sustained diodes 3, mono- termination power+5V of third PNP type triode Q3, the grid of third PNP type triode Q3 connect MCU control The relay of unit 1 processed controls I/O port P21, while concatenating the 6th resistance R6, pull-up electricity of the 5th resistance R5 as I/O port Resistance.
First via analog signal channel is from the input of the normally-closed contact of the first relay U1, and the public terminal contacts phase with it The normally-closed contact via third relay U3 is connected, then from the public terminal contacts output signal of third relay U3, it is MCU The P23 mouth of control unit 1 sends high level to the first relay U1, while P21 mouthfuls send high level to third relay U3.
Second road analog signal channel is from the input of the normally opened contact of the first relay U1, and the public terminal contacts phase with it Connection via third relay U3 normally-closed contact, then from the public terminal contacts output signal of third relay U3, turn-on condition Be that the P23 mouth of MCU control unit 1 sends low level to the first relay U1, at the same P21 mouthful sent to third relay it is high electric It is flat.
Third road analog signal channel is from the input of the normally-closed contact of the second relay U2, and the public terminal contacts phase with it Connection via third relay U3 normally opened contact, then from the public terminal contacts output signal of third relay U3, turn-on condition Be MCU control unit 1 P22 mouth to the second relay U2 send high level, while P21 mouthful to third relay U3 transmission it is low Level.
4th road analog signal channel is to input from the normally opened contact of the second relay, and be connected with its public terminal contacts Connect the normally opened contact via third relay U3, then from the public terminal contacts output signal of third relay U3, turn-on condition Be MCU control unit 1 P22 mouth to the first relay U1 send low level, while P21 mouthful to third relay U3 transmission it is low Level.
See Fig. 8 and Fig. 9, the control method that 3 relays of the invention control the flogic system of 4 road signal on-off has Following steps:
One, Single Chip C Language programs.When selection signal channel, using case case statement.
Two, it sending data cell 0x01 and represents IN1 signal path, the IO foot P23 of MCU control unit 1 exports high level, End the first PNP triode Q1, the first relay U1 coil both ends do not have voltage at this time, therefore the first relay U1 does not have work Make, its normally-closed contact and common end contact closure, the conducting of IN1 branch, the 4th light emitting diode D4 is assigned a value of 0, the bright representative of lamp The road IN1 gating;The IO foot P21 of MCU control unit 1 exports high level simultaneously, ends third PNP triode Q3, at this time third Relay U3 coil both ends do not have voltage, therefore third relay U3 does not work, its normally-closed contact is closed with public terminal contacts It closes, the conducting of OUT branch, so that first via analog signal channel is connected.
Three, it sending data cell 0x02 and represents IN2 signal path, the IO foot P23 of MCU control unit 1 exports low level, The first PNP triode Q1 is connected, the first relay U1 coil both end voltage is 5V at this time, therefore the first relay U1 starts work Make, its normally-closed contact disconnects, normally opened contact and common end contact closure, and IN2 branch conducting, the 5th light emitting diode D5 is assigned Value is 0, and lamp is bright to represent the road IN2 gating;The IO foot P21 of MCU control unit 1 exports high level simultaneously, makes third PNP triode Q3 cut-off, third relay U3 coil both ends do not have voltage at this time, therefore third relay U3 does not work, its normally-closed contact With common end contact closure, OUT branch conducting, thus second road signal channel conductive.
Four, it sending data cell 0x03 and represents IN3 signal path, the IO foot P22 of MCU control unit 1 exports high level, End the second PNP triode Q2, the second relay U2 coil both ends do not have voltage at this time, therefore the second relay U2 does not have work Make, its normally-closed contact and common end contact closure, the conducting of IN3 branch, the 6th Light-Emitting Diode D6 is assigned a value of 0, the bright representative of lamp The road IN3 gating;The IO foot P21 of MCU control unit 1 exports low level simultaneously, third PNP triode Q3 is connected, at this time third Relay U3 coil both end voltage be 5V, therefore third relay U3 start to work, normally-closed contact disconnect, normally opened contact with it is public Terminal contacts closure, OUT branch conducting, so that third road signal path is connected.
Five, it sending data cell 0x04 and represents IN4 signal path, the IO foot P22 of MCU control unit 1 exports low level, The second PNP triode Q2 is connected, the second relay U2 coil both end voltage is 5V at this time, therefore the second relay U2 starts work Make, its normally-closed contact disconnects, normally opened contact and common end contact closure, and IN4 branch conducting, the 7th Light-Emitting Diode D7 is assigned Value is 0, and lamp is bright to represent the road IN4 gating;The IO foot P21 of MCU control unit 1 exports low level simultaneously, makes third PNP triode Q3 conducting, third relay U3 coil both end voltage is 5V at this time, therefore third relay U3 starts to work, and normally-closed contact disconnects, Normally opened contact and common end contact closure, OUT branch conducting, so that the 4th tunnel signal path is connected.
The present invention uses 5V DC power supply, and user only needs that PC machine can be completed to the present invention by a USB data line Power supply and communication, work desired by user can be controlled by only needing to send some simple data characters by host computer The signal of that instrument and equipment be input in other equipment, eliminate many unnecessary troubles, efficiency greatly improves. The present invention can to equipment transmission signal realization remotely control and accurately control, also accomplished the guarantor to precision instrument and equipment Shield industrially has practical application value.The present invention realizes the expansion of signal path by the cascade between relay contact Exhibition similarly can also realize the flogic system that the road 4N signal on-off is controlled with 3N relay, N is nature through the invention Number.
Particular embodiments described above has carried out further in detail the purpose of the present invention, technical scheme and beneficial effects It describes in detail bright, it should be understood that the above is only a specific embodiment of the present invention, is not intended to restrict the invention, All within the spirits and principles of the present invention, any modification, equivalent substitution, improvement and etc. done should be included in of the invention Within protection scope.

Claims (8)

1. a kind of flogic system for controlling 4 road signal on-off by 3 relays, it is characterised in that: including MCU control unit, after Electric appliance logic control circuit, USB power connector circuit, USB turn Transistor-Transistor Logic level conversion circuit and signal input output interface unit; MCU control unit is used for the control that accesses to relay logical control circuit;USB turns Transistor-Transistor Logic level conversion circuit and is used for USB The USB level translation that power interface circuit receives is the Transistor-Transistor Logic level that MCU control unit can identify;Signal input and output connect Mouth unit realizes analog signal input and output for connecing the instrument and equipments such as antenna, filter, converter;Relay logic control Circuit processed includes 3 relays, realizes the extension of signal path between relay contact by cascade, connects to signal input and output Four road signal behaviors of mouth unit are controlled all the way.
2. the flogic system according to claim 1 for controlling 4 road signal on-off by 3 relays, it is characterised in that: MCU Control unit is equipped with the first crystal oscillating circuit and reset circuit;First crystal oscillating circuit is used to provide clock signal to MCU control unit; Reset circuit allows MCU control unit steady operation for resetting the program counter of MCU control unit.
3. the flogic system according to claim 1 for controlling 4 road signal on-off by 3 relays, it is characterised in that: USB Power interface circuit includes USB female seat M1, the tenth capacitor C10, the 11st polar capacitor C11 and the 9th light emitting diode D9;USB Base M1 uses Micro USB female seat;11st polar capacitor C11 of power interface circuit uses alminium electrolytic condenser, has filter The effect of wave and energy storage, can allow PC machine stable power-supplying;9th light emitting diode D9 powers on instruction as power interface circuit Lamp prompts custom system to be powered.
4. the flogic system according to claim 1 for controlling 4 road signal on-off by 3 relays, it is characterised in that: USB Turning Transistor-Transistor Logic level conversion circuit includes electrical level transferring chip G1, it is the switching chip an of usb bus, realize USB turn serial ports, USB turns that IrDA is infrared or USB turns printing port;The USB electricity that electrical level transferring chip G1 is used to receive in USB power connector circuit Flat turn turns to the Transistor-Transistor Logic level that MCU control unit can identify.
5. the flogic system according to claim 4 for controlling 4 road signal on-off by 3 relays, it is characterised in that: USB Turn Transistor-Transistor Logic level conversion circuit equipped with the second crystal oscillating circuit, the second crystal oscillating circuit is used to provide clock letter to electrical level transferring chip G1 Number;Electrical level transferring chip G1 uses the chip of model CH340G;The D+ pin phase of the UD+ pin of CH340G and MICRO USB Connection, UD- pin are connected with the D- pin of MICRO USB;The transmission pin TXD and reception pin RXD of CH340G chip divide It is not connected with the reception pin RXD of MCU control unit and transmission pin TXD;The reception pin RXD of MCU control unit is with instead It is connected to diode D8 with the TXD pin of CH340G chip, backward dioded D8 uses 1N4148, has prevented electric current from can pass through This pin flows into late-class circuit and to the capacitor charging of rear class, and rear class is caused to have the voltage of certain amplitude, causes to influence MCU The cold start-up of control unit downloading program.
6. the flogic system according to claim 4 for controlling 4 road signal on-off by 3 relays, it is characterised in that: relay 3 relays of device logic control circuit are divided into the first relay U1, the second relay U2 and third relay U3;3 relays Device is all made of signal relay, and the signal relay control voltage is 5V, contact form are as follows: DPDT;The signal relay has 8 A pin, the positive and negative anodes pin including relay coil, a pair of of normally opened contact, a pair of of normally-closed contact and a pair of public terminal contacts, It is very good with the isolation effect of signal;
After the coil of first relay U1 is concatenated with the first PNP type triode Q1, relay coil both ends and connect one first it is continuous Diode D1, mono- termination power+5V of the first PNP type triode Q1 are flowed, it is single that the grid of the first PNP type triode Q1 connects MCU control The relay of member controls I/O port P23, while concatenating second resistance R2, pull-up resistor of the first resistor R1 as I/O port;
After the coil of second relay U2 is concatenated with the second PNP type triode Q2, relay coil both ends and connect one second it is continuous Diode D2, mono- termination power+5V of the second PNP type triode Q2 are flowed, it is single that the grid of the second PNP type triode Q2 connects MCU control The relay of member controls I/O port P22, while concatenating the 4th resistance R4, pull-up resistor of the 3rd resistor R3 as I/O port;
After the coil of third relay U3 is concatenated with third PNP type triode Q3, relay coil both ends and to connect a third continuous Diode D3, mono- termination power+5V of third PNP type triode Q3 are flowed, it is single that the grid of third PNP type triode Q3 connects MCU control The relay of member controls I/O port P21, while concatenating the 6th resistance R6, pull-up resistor of the 5th resistance R5 as I/O port;
First via analog signal channel is to input from the normally-closed contact of the first relay U1, and be connected with its public terminal contacts Via the normally-closed contact of third relay U3, then from the public terminal contacts output signal of third relay U3, it is that MCU control is single The P23 mouth of member sends high level to the first relay U1, while P21 mouthfuls send high level to third relay U3;
Second road analog signal channel is to input from the normally opened contact of the first relay U1, and be connected with its public terminal contacts Via the normally-closed contact of third relay U3, then from the public terminal contacts output signal of third relay U3, turn-on condition is MCU The P23 mouth of control unit sends low level to the first relay U1, while P21 mouthfuls send high level to third relay;
Third road analog signal channel is to input from the normally-closed contact of the second relay U2, and be connected with its public terminal contacts Via the normally opened contact of third relay U3, then from the public terminal contacts output signal of third relay U3, turn-on condition is MCU The P22 mouth of control unit sends high level to the second relay U2, while P21 mouthfuls send low level to third relay U3;
4th road analog signal channel be inputted from the normally opened contact of the second relay, and be connected with its public terminal contacts through By the normally opened contact of third relay U3, then from the public terminal contacts output signal of third relay U3, turn-on condition is MCU control The P22 mouth of unit processed sends low level to the first relay U1, while P21 mouthfuls send low level to third relay U3.
7. the flogic system according to one of claims 1 to 6, for controlling 4 road signal on-off by 3 relays, feature exist In: it further include signal gating indicating circuit;Signal gating indicating circuit is made of four light emitting diodes and third load resistance; Four light emitting diodes are respectively the 4th light emitting diode D4, the 5th light emitting diode D5, the 6th Light-Emitting Diode D6 and the 7th Light emitting diode D7;Third load resistance includes eleventh resistor R11, twelfth resistor R12, thirteenth resistor R13 and the tenth Four resistance R14;4th light emitting diode D4 and eleventh resistor R11 be connected on+5V power supply and MCU control unit P24 foot it Between;5th light emitting diode D5 and twelfth resistor R12 is connected between+5V power supply and the P25 foot of MCU control unit;6th Light-Emitting Diode D6 and thirteenth resistor R13 is connected between+5V power supply and the P26 foot of MCU control unit;7th light-emitting diodes Pipe D7 and the 14th resistance R14 are connected between+5V power supply and the P27 foot of MCU control unit.
The control method for the flogic system that 8.3 relays control 4 road signal on-off has follow steps:
One, Single Chip C Language programs, when selection signal channel, using case case statement;
Two, it sends data cell 0x01 and represents IN1 signal path, the IO foot P23 of MCU control unit exports high level, makes first PNP triode Q1 cut-off, the first relay U1 coil both ends do not have voltage at this time, therefore the first relay U1 does not work, it Normally-closed contact and common end contact closure, the conducting of IN1 branch, the 4th light emitting diode D4 are assigned a value of 0, and lamp is bright to represent the choosing of the road IN1 It is logical;The IO foot P21 of MCU control unit exports high level simultaneously, ends third PNP triode Q3, at this time third relay U3 Coil both ends do not have voltage, therefore third relay U3 does not work, its normally-closed contact and common end contact closure, OUT branch Conducting, so that first via analog signal channel is connected;
Three, it sends data cell 0x02 and represents IN2 signal path, the IO foot P23 of MCU control unit exports low level, makes first PNP triode Q1 conducting, the first relay U1 coil both end voltage is 5V at this time, therefore the first relay U1 starts to work, it Normally-closed contact disconnects, normally opened contact and common end contact closure, and IN2 branch conducting, the 5th light emitting diode D5 is assigned a value of 0, lamp It is bright to represent the road IN2 gating;The IO foot P21 of MCU control unit exports high level simultaneously, ends third PNP triode Q3, at this time Third relay U3 coil both ends do not have voltage, therefore third relay U3 does not work, its normally-closed contact and public terminal contacts Closure, OUT branch conducting, thus second road signal channel conductive;
Four, it sends data cell 0x03 and represents IN3 signal path, the IO foot P22 of MCU control unit exports high level, makes second PNP triode Q2 cut-off, the second relay U2 coil both ends do not have voltage at this time, therefore the second relay U2 does not work, it Normally-closed contact and common end contact closure, the conducting of IN3 branch, the 6th Light-Emitting Diode D6 are assigned a value of 0, and lamp is bright to represent the choosing of the road IN3 It is logical;The IO foot P21 of MCU control unit exports low level simultaneously, third PNP triode Q3 is connected, at this time third relay U3 Coil both end voltage is 5V, therefore third relay U3 starts to work, and normally-closed contact disconnects, and normally opened contact is closed with public terminal contacts It closes, the conducting of OUT branch, so that third road signal path is connected;
Five, it sends data cell 0x04 and represents IN4 signal path, the IO foot P22 of MCU control unit exports low level, makes second PNP triode Q2 conducting, the second relay U2 coil both end voltage is 5V at this time, therefore the second relay U2 starts to work, it Normally-closed contact disconnects, normally opened contact and common end contact closure, and IN4 branch conducting, the 7th Light-Emitting Diode D7 is assigned a value of 0, lamp It is bright to represent the road IN4 gating;The IO foot P21 of MCU control unit exports low level simultaneously, third PNP triode Q3 is connected, at this time Third relay U3 coil both end voltage is 5V, therefore third relay U3 starts to work, and normally-closed contact disconnects, normally opened contact and public affairs Terminal contacts closure altogether, OUT branch conducting, so that the 4th tunnel signal path is connected.
CN201910302013.7A 2019-04-16 2019-04-16 Logic system and control method for controlling on-off of 4 paths of signals by using 3 relays Active CN110032107B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910302013.7A CN110032107B (en) 2019-04-16 2019-04-16 Logic system and control method for controlling on-off of 4 paths of signals by using 3 relays

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910302013.7A CN110032107B (en) 2019-04-16 2019-04-16 Logic system and control method for controlling on-off of 4 paths of signals by using 3 relays

Publications (2)

Publication Number Publication Date
CN110032107A true CN110032107A (en) 2019-07-19
CN110032107B CN110032107B (en) 2020-05-08

Family

ID=67238471

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910302013.7A Active CN110032107B (en) 2019-04-16 2019-04-16 Logic system and control method for controlling on-off of 4 paths of signals by using 3 relays

Country Status (1)

Country Link
CN (1) CN110032107B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111969988A (en) * 2020-08-20 2020-11-20 中电科蓉威电子技术有限公司 Method for replacing signal analog switch chip

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2879407Y (en) * 2006-03-16 2007-03-14 江苏金智科技股份有限公司 Fast exit module having hardware self-holding function
US20090085596A1 (en) * 2007-09-28 2009-04-02 Qimonda Ag System and method for testing semiconductor devices
CN201654186U (en) * 2009-12-02 2010-11-24 天津光电通信技术有限公司 Large-scale signal detecting equipment
CN207068068U (en) * 2017-07-14 2018-03-02 长春工业大学 A kind of contactless portable attendance checking system
CN207896969U (en) * 2018-03-06 2018-09-21 广西电网有限责任公司来宾供电局 A kind of one aerial signal selector of multiselect
CN109213010A (en) * 2018-08-31 2019-01-15 北京机械设备研究所 A kind of relay multidiameter option switch circuit and test macro with priority

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2879407Y (en) * 2006-03-16 2007-03-14 江苏金智科技股份有限公司 Fast exit module having hardware self-holding function
US20090085596A1 (en) * 2007-09-28 2009-04-02 Qimonda Ag System and method for testing semiconductor devices
CN201654186U (en) * 2009-12-02 2010-11-24 天津光电通信技术有限公司 Large-scale signal detecting equipment
CN207068068U (en) * 2017-07-14 2018-03-02 长春工业大学 A kind of contactless portable attendance checking system
CN207896969U (en) * 2018-03-06 2018-09-21 广西电网有限责任公司来宾供电局 A kind of one aerial signal selector of multiselect
CN109213010A (en) * 2018-08-31 2019-01-15 北京机械设备研究所 A kind of relay multidiameter option switch circuit and test macro with priority

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111969988A (en) * 2020-08-20 2020-11-20 中电科蓉威电子技术有限公司 Method for replacing signal analog switch chip

Also Published As

Publication number Publication date
CN110032107B (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN206250502U (en) A kind of smart jack
CN110032107A (en) The flogic system and control method of 4 road signal on-off are controlled by 3 relays
CN203278279U (en) Multifunctional mobile power supply
CN207115402U (en) Usb circuit
CN104142988A (en) General information processing platform based on automated testing system
CN108108318B (en) TTL changes MBUS communication terminal
CN110083100A (en) A kind of SCM Based electronic timer
CN214011769U (en) On-line power burning circuit
CN207232950U (en) Time-sharing multiplex is connected in series circuit
CN204231406U (en) A kind of Multifunction cross of the quick-setting based on toggle switch is changed planes
CN202795821U (en) Intelligent remote meter reading simulation teaching device
CN2519346Y (en) Interface data collector
CN209615525U (en) Intelligent interactive toy robot control system based on STM32 microcontroller
CN206322167U (en) A kind of download program circuit
CN207097226U (en) A kind of intelligent meter data recording system baud rate control circuit
CN205827651U (en) Communication read-write photometer head
CN206673862U (en) A kind of SCM Based step motor control system
CN206097436U (en) Channel switching appearance
CN216526836U (en) Switching value input and output management module compatible with power conversion system
CN204926626U (en) MSP430 singlechip teaching experiment platform
CN110594685A (en) Solar energy lighting system
CN106899064A (en) Mobile terminal current testing circuit and device
CN109682268A (en) A kind of micro missile test device
CN207882724U (en) A kind of USB power source controller of cloudy box of making out an invoice
CN214251069U (en) Automatic testing arrangement of smart meter

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant