MCU dual-port fixed side differential signal output control method
Through the MCU dual-port fixed-side differential signal output control method, combined with multiple isolation technology, the distortion problem of traditional signal transmission under strong electromagnetic interference is solved, and the dual-side isolation and signal transmission stability of the MCU is realized, which is suitable for low-cost and low-frequency circuit scenarios.
Patent Information
- Application Number
- CN202510271326.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-08
- Publication Date
- 2025-06-24
AI Technical Summary
In the electrical automation industrial control scenario with strong electromagnetic interference, traditional single-ended signal transmission is easily disturbed and caused by signal distortion, while traditional differential signals are mainly suitable for high-frequency circuits, are not friendly to low-cost and low-frequency circuits, and are difficult to take into account both anti-interference and double-sided isolation of the MCU.
The MCU dual-port fixed-side differential signal output control method is adopted. Through the combination of AC/DC module, voltage stabilization module, MCU, photocoupling relay, transistor drive circuit and electromagnetic relay, the signal is realized with the dual-port fixed-side differential transmission, and the circuit reliability and safety are guaranteed through multiple isolation technology.
While resisting strong electromagnetic noise interference, this method realizes double-side isolation of the MCU, ensuring the stability and reliability of signal transmission, and is suitable for low-cost and low-frequency circuit scenarios that require anti-interference.
Smart Images

Figure CN120200601A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of signal control circuits, and more specifically, to a method for controlling the output of differential signals with a fixed side of a dual-port MCU. Background Art
[0002] In the electrical automation industrial control scenario with strong electromagnetic field interference, how to prevent signal transmission errors caused by interference during signal transmission is a key issue. Single-ended input means that a signal consists of a reference end and a signal end, and the reference end is generally the ground end. In traditional single-ended signal transmission, the single-ended signal is transmitted on a wire as the voltage difference with the ground, which has strict requirements for the low potential of the two transmission points. In the context of strong electromagnetic field interference, due to the existence of ground wire impedance, it is easy to cause the potentials of each point on the ground wire to be unequal, resulting in obvious voltage fluctuations and signal transmission distortion. A differential signal is two signal transmission lines with equal amplitudes and opposite polarities. In PCB design, differential signal lines are designed to be of equal length, equal width, and closely spaced. Under electromagnetic interference, the interference noise is generally equal and acts on both signal lines simultaneously. The two signal lines reference each other, and electromagnetic, noise interference, and timing interference will not affect their judgment logic.
[0003] However, traditional differential signals are mainly applied to high-frequency circuits, with a relatively high application cost. They are not friendly to low-cost sensitive products and low-frequency circuits, and also have strict requirements in circuit design, thus being greatly limited in use.
[0004] Therefore, how to propose a method for controlling the output of differential signals with a fixed side of a dual-port MCU, using the MCU to control the differential signal output, which is applicable to resisting strong electromagnetic noise interference while taking into account the bilateral isolation of the MCU, is an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0005] In view of this, the present invention provides a method for controlling the output of differential signals with a fixed side of a dual-port MCU, using the MCU to control the differential signal output, which is applicable to resisting strong electromagnetic noise interference while taking into account the bilateral isolation of the MCU. To achieve the above object, the present invention adopts the following technical solutions:
[0006] A method for controlling the output of differential signals with a fixed side of a dual-port MCU includes: an AC / DC module, a voltage stabilizing module, an MCU, an optocoupler relay, a triode drive circuit, and an electromagnetic relay. The first output terminal of the AC / DC module is sequentially connected to the voltage stabilizing module and the MCU in signal. The MCU is connected to the optocoupler relay through a dual-port signal. The optocoupler relay is connected to the electromagnetic relay in signal through the triode drive circuit. The electromagnetic relay is connected to the second output terminal of the AC / DC module.
[0007] Optionally, a filter capacitor C1 and a diode are connected in parallel between the MCU and the optocoupler relay, and a current-limiting resistor is connected in series.
[0008] Optionally, the MCU includes a Do1 pin and a Do2 pin, and a path is formed with the optocoupler relay through the Do1 pin and the Do2 pin respectively. When the Do1 pin is set to 1 and the Do2 pin is set to 0, the circuit is turned on to trigger the led module in the optocoupler relay to emit light, and then the collector and emitter of the phototransistor inside the optocoupler relay are turned on.
[0009] Optionally, the collector of the optocoupler relay is connected to the second output terminal of the AC / DC module, and the emitter of the optocoupler relay is connected to the base of the triode drive circuit through a current-limiting resistor.
[0010] Optionally, the emitter of the triode drive circuit is connected to the 24v power ground, and the collector of the triode drive circuit is connected to the second output terminal of the AC / DC module.
[0011] Optionally, the collector of the triode drive circuit is connected in series with an electromagnetic relay, diodes are connected in parallel on both sides of the electromagnetic relay, and an LED lighting module is connected in parallel on the other side for observing the switch state of the relay.
[0012] Optionally, the AC / DC module outputs 24V and 5V voltages. The 5V voltage is converted to 3.3V by a voltage stabilization module to supply power to the MCU, and the 24V voltage is the control voltage for the electromagnetic relay.
[0013] Optionally, the voltage stabilization module is a power supply voltage stabilization module LM117-3.3, and capacitors with filtering and voltage stabilization functions are connected in parallel on both sides of the power supply voltage stabilization module LM117-3.3.
[0014] Optionally, it includes: setting the Do1 pin to output a high level and the Do2 pin to output a low level. After passing through the filter circuit, the optocoupler relay is triggered, and the action signal is output to the triode drive circuit to drive the electromagnetic relay to output an action. When the electromagnetic relay acts, it is observed through the LED lighting module.
[0015] It can be seen from the above technical solutions that compared with the prior art, the present invention discloses a method for controlling the differential signal output of a fixed side of a dual-port of an MCU, and has the following beneficial effects:
[0016] The present invention proposes a control method for the differential signal output of a fixed side of an MCU dual port, including: an AC / DC module, a voltage stabilizing module, an MCU, an optocoupler relay, a triode drive circuit, and an electromagnetic relay. The first output terminal of the AC / DC module is sequentially connected to the voltage stabilizing module and the MCU in signal. The MCU is connected to the optocoupler relay through a dual port. The optocoupler relay is connected to the electromagnetic relay through the triode drive circuit in signal. The electromagnetic relay is connected to the second output terminal of the AC / DC module. The present invention adopts multiple isolation technologies to ensure the reliability and safety of the circuit. The present invention adopts a fixed side differential signal transmission mode to ensure the stability of signal transmission. The present invention adopts a signal-optical-electric-electromagnetic transmission mode to ensure stable and efficient signal transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0018] Figure 1 It is a circuit schematic diagram of a control method for the differential signal output of a fixed side of an MCU dual port provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0019] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0020] The embodiment of the present invention discloses a control method for the differential signal output of a fixed side of an MCU dual port, as Figure 1 shown, including: an AC / DC module, a voltage stabilizing module, an MCU, an optocoupler relay, a triode drive circuit, and an electromagnetic relay. The first output terminal of the AC / DC module is sequentially connected to the voltage stabilizing module and the MCU in signal. The MCU is connected to the optocoupler relay through a dual port. The optocoupler relay is connected to the electromagnetic relay through the triode drive circuit in signal. The electromagnetic relay is connected to the second output terminal of the AC / DC module.
[0021] Furthermore, a filter capacitor C1 and a diode are connected in parallel between the MCU and the optocoupler relay, and a current limiting resistor is connected in series.
[0022] Further, the MCU includes a Do1 pin and a Do2 pin, which respectively form a path with the optocoupler relay through the Do1 pin and the Do2 pin. When the Do1 pin is set to 1 and the Do2 pin is set to 0, the circuit conducts to trigger the LED module in the optocoupler relay to emit light, thereby making the collector and emitter of the phototransistor inside the optocoupler relay conduct.
[0023] Further, the collector of the optocoupler relay is connected to the second output terminal of the AC / DC module, and the emitter of the optocoupler relay is connected to the base of the triode drive circuit through a current-limiting resistor.
[0024] Further, the emitter of the triode drive circuit is connected to the 24V power ground, and the collector of the triode drive circuit is connected to the second output terminal of the AC / DC module.
[0025] Further, the collector of the triode drive circuit is connected in series with an electromagnetic relay, a diode is connected in parallel on both sides of the electromagnetic relay, and an LED lighting module is connected in parallel on the other side for observing the relay switch state.
[0026] Further, the AC / DC module outputs 24V and 5V voltages. After passing through a voltage regulation module to convert 5V to 3.3V to supply power to the MCU, the 24V voltage is the control voltage for the electromagnetic relay.
[0027] Further, the voltage regulation module is the power supply voltage regulation module LM117 - 3.3, and capacitors with filtering and voltage regulation functions are connected in parallel on both sides of the power supply voltage regulation module LM117 - 3.3.
[0028] Further, it includes: setting the Do1 pin to output a high level and the Do2 pin to output a low level. After passing through a filtering circuit, it triggers the optocoupler relay, and the action signal is output to the triode drive circuit to drive the electromagnetic relay to output an action. When the electromagnetic relay acts, it is observed through the LED lighting module.
[0029] In a specific embodiment, a control method for the MCU dual-port fixed-side differential type signal output is applied to the secondary protection side scenario of the power system. An optocoupler relay is used to control the output signal, which is suitable for scenarios with high anti-interference performance requirements. For example, in a high-voltage electric scenario with a strong electromagnetic interference field, it ensures the reliable and stable output signal, and at the same time isolates the strong voltage and current to protect the internal components from being damaged, achieving anti-strong electromagnetic noise interference and taking into account the bilateral isolation of the MCU. That is, using a more stable differential type signal transmission, using the dual ports of the MCU, namely two pins, to control the signal output. After isolation protection and filtering, it stably, safely and reliably triggers the action of the terminal relay. The specific steps are as follows:
[0030] Only when the two pins Do1 and Do2 of the main control MCU trigger a fixed output signal can they trigger stable signal transmission. That is, when the Do1 pin outputs a high level and the Do2 pin outputs a low level, the terminal relay is triggered to act. Other signals cannot trigger the terminal relay to act, ensuring that even when there is external noise interfering with the circuit, the relay will not malfunction by mistake.
[0031] In the logic circuit, the voltage drop of the PC817 optocoupler relay device itself is 1.2V, and the resistance of the optocoupler relay itself can be ignored. A 1k current-limiting resistor is connected in series between the MCU and the optocoupler relay to ensure that an output current of 2mA can stably trigger the optocoupler relay (current-triggered relay). In addition, a filter capacitor C1 and a 1N4148 diode are connected in parallel to ensure the safety of the circuit and prevent component damage caused by short circuits. Among them, when the Do1 pin is set to 1 and the Do2 pin is set to 0, the circuit conducts, triggering the LED module in the optocoupler relay to emit light and making the collector and emitter of the internal phototransistor conduct.
[0032] The PC817 outputs a stable current of 2mA on the output side. The collector of the optocoupler relay is connected to the positive pole of the 24V power supply, and the emitter of the optocoupler relay is connected to the base of the NPN transistor drive circuit of model 9013 that drives the JQX-13F electromagnetic relay. A 10K current-limiting resistor is connected in series to prevent short circuits and overcurrents from burning out the device, and stably maintain the NPN transistor drive circuit in an amplified state with an amplification factor of about 100. The transistor amplification circuit on the drive side amplifies by about 100 times to ensure stable triggering of the subsequent JQX-13F electromagnetic relay.
[0033] The emitter of the NPN transistor drive circuit is connected to the ground of the 24V power supply, and the collector of the NPN transistor drive circuit is connected to the positive pole of the 24V power supply after AC / DC module conversion and supplies power. A JQX-13F electromagnetic relay (working voltage 24V) is connected in series. A 1N4007 diode is connected in parallel on both sides of the relay to prevent the drive circuit from being damaged by the backpressure state after the relay action ends. An LED light-emitting module is connected in parallel on the other side to facilitate observing the switch state of the relay and realizing visual judgment of whether the signal is correct.
[0034] In the specific implementation, on the basis of the classic opening circuit, the present invention adds dual-port signal collaborative output and MCU bilateral electrical isolation, isolating the power supply - main control - relay from each other, protecting the main control MCU from voltage and current impact damage caused by, for example, power supply mutations and incorrect connection of the mains on the relay side, greatly improving the safety performance of the product. Through the dual-port fixed-side differential signal transmission method, the anti-interference performance and signal stability during signal transmission are ensured, and it has high safety and reliability when applied to the secondary protection side of the power system. The specific embodiments are as follows:
[0035] The power supply part provides a stable output of 24V and 5V voltages for the isolated AC / DC power module. After passing through the LM117-3.3 voltage regulator module, the 5V voltage is converted to 3.3V to supply power to the main control MCU. The 24V voltage is the relay control voltage, and the higher drive voltage has a stable, reliable and anti-interference function.
[0036] To ensure the stability of component operation, capacitors with filtering and voltage stabilizing functions are connected in parallel on both sides of the power voltage regulator module LM117-3.3. An anti-backflow diode and an anti-mutation high-frequency capacitor are added between the main control MCU and the optocoupler relay PC817. The JQX-13F electromagnetic relay uses a 9013 NPN transistor drive circuit.
[0037] The signal transmission part of the present invention consists of the main control chip and its peripheral circuits (simplified) to form a logic output circuit. When the program sets the Do1 pin to output a high level and the Do2 pin to output a low level, after passing through the filtering circuit, it triggers the PC817 optocoupler relay, and the action signal is output to the 9013 NPN transistor to drive the electromagnetic relay to output an action. When the electromagnetic relay acts, it can be visually observed whether the signal led is correct.
[0038] In this specification, each embodiment is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0039] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for controlling the output of differential signals from a dual-port fixed side of an MCU, characterized in that: include: AC / DC module, voltage stabilizing module, MCU, optocoupler relay, transistor drive circuit and electromagnetic relay, the first output end of the AC / DC module is connected to the voltage stabilizing module and the MCU in sequence, the MCU is connected to the optocoupler relay through a dual-port signal, the optocoupler relay is connected to the electromagnetic relay signal through the transistor drive circuit, and the electromagnetic relay is connected to the second output end of the AC / DC module.
2. The method for controlling the output of a fixed-side differential signal of a MCU dual-port according to claim 1, characterized in that: A filter capacitor C1 and a diode are connected in parallel between the MCU and the optical coupler relay, and a current limiting resistor is connected in series.
3. The method for controlling the output of a fixed-side differential signal of a MCU dual-port according to claim 1, characterized in that: The MCU includes a Do1 pin and a Do2 pin, which respectively form a path with the optocoupler relay through the Do1 pin and the Do2 pin. When the Do1 pin is set to 1 and the Do2 pin is set to 0, the circuit is turned on to trigger the LED module in the optocoupler relay to emit light, thereby turning on the collector and emitter of the phototransistor inside the optocoupler relay.
4. The method for controlling the output of a fixed-side differential signal of a MCU dual-port according to claim 1, characterized in that: The collector of the optical coupler relay is connected to the second output end of the AC / DC module, and the emitter of the optical coupler relay is connected to the base of the transistor drive circuit through a current limiting resistor.
5. The method for controlling the output of a fixed-side differential signal of a MCU dual-port according to claim 4, characterized in that: The emitter of the transistor drive circuit is connected to the 24V power supply ground, and the collector of the transistor drive circuit is connected to the second output end of the AC / DC module.
6. The method for controlling the output of a fixed-side differential signal of a MCU dual-port according to claim 5, characterized in that: The collector of the transistor drive circuit is connected in series with an electromagnetic relay, diodes are connected in parallel on both sides of the electromagnetic relay, and an LED light-emitting module is connected in parallel on the other side to observe the switching state of the relay.
7. The method for controlling the output of a fixed-side differential signal of a MCU dual-port according to claim 1, characterized in that: The AC / DC module outputs 24V and 5V voltages, and the voltage regulator module converts 5V into 3.3V to power the MCU, and the 24V voltage is the electromagnetic relay control voltage.
8. The method for controlling the output of a fixed-side differential signal of a MCU dual-port according to claim 1, characterized in that: The voltage stabilizing module is a power voltage stabilizing module LM117-3.3, and capacitors with filtering and voltage stabilizing functions are connected in parallel on both sides of the power voltage stabilizing module LM117-3.
3.
9. The method for controlling the output of a fixed-side differential signal of a MCU dual-port according to claim 1, characterized in that: include: When the Do1 pin is set to output a high level and the Do2 pin is set to output a low level, the optocoupler relay is triggered after passing through the filter circuit. The action signal is output to the transistor drive circuit to drive the electromagnetic relay to output an action. The action of the electromagnetic relay can be observed through the LED light module.