RS485 and CAN communication switching circuit based on two-channel relay design
Through the RS485 and CAN communication switching circuit based on dual-channel relay design, combined with MCU control and multiple protection designs, the problem of RS485 and CAN communication switching in the prior art is solved, and efficient and stable communication switching and anti-interference capabilities are achieved.
Patent Information
- Application Number
- CN202420805576.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-18
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2034-04-18
AI Technical Summary
The existing RS485 and CAN communication switching circuits are difficult to achieve real-time switching during on-site construction, and are susceptible to electrostatic and electromagnetic interference, resulting in channel error switching and chip damage, and high maintenance costs.
The RS485 and CAN communication switching circuit based on the dual-channel relay design is adopted, and the dual-channel relay is driven by the system MCU control signal to complete the channel switching. It combines the design of RC low-pass filtering, diode freewheeling, external port TVS and thermistor protection to enhance the anti-interference ability of the circuit.
Real-time switching between RS485 and CAN communication is realized, reducing the risk of device damage, improving the anti-interference capability of the circuit and the stability of communication quality, and reducing maintenance costs.
Smart Images

Figure CN222826305U_ABST
Abstract
Description
Technical Field
[0001] The utility model relates to an RS485 and CAN communication switching circuit based on a dual-channel relay design. Background Art
[0002] After the terminal is installed on site, it is very inconvenient to disassemble it. Therefore, it is unrealistic to switch CAN and RS485 communications by maintaining the mainboard components alone. The site needs to be powered off, which is extremely difficult to operate and has high labor costs. Some designs use a toggle switch to control the channel interface switching chip to achieve the purpose of switching channels. However, there are many devices on site, the wiring cables are messy, and the environment is complex. When wiring, people's hands touching the terminal are prone to static interference, and the devices will also generate electromagnetic interference with each other. Sometimes, due to abnormal signal interference, the channel will be switched incorrectly, resulting in the loss of power consumption information data. There are also designs that use integrated switching switch chips in the communication interface, which are prone to electromagnetic interference or electrostatic breakdown damage. Due to the limitations of the chip position, even with electrostatic protection devices, it is difficult to completely guarantee that it is foolproof. When testing with an electrostatic interference simulation generator, it is easy for the integrated switching switch chip to be damaged and the RS485 and CAN channels to be disordered. The impact of the above conditions on site is very serious.
[0003] In the design of low-voltage special transformer acquisition terminal circuits in the power field, CAN communication and RS485 communication interfaces are commonly used. Analyzing the existing design circuits, the current typical design circuit uses an integrated switching switch chip as the main body, which is generally placed near the external terminal in the PCB design. However, the disadvantage of this solution is that the switching chip is easily interfered by external signals from the interface (such as static electricity), which causes the chip to be damaged. The maintenance cost after damage is very high, and hardware damage will cause some data loss in the user area, which has a very serious impact; there are also some design circuits that have the idea of reusing RS485 and CAN interfaces, but they are achieved by switching different circuit board materials. The disadvantage is that the communication interface cannot be switched in real time. When switching, the machine must be disassembled for maintenance or hardware replacement, which increases the risk of equipment damage and is also very troublesome in power grid applications.
[0004] In view of the above circuit problems, the present application provides an RS485 and CAN communication switching circuit based on a dual-channel relay design, which has a simple circuit design, convenient channel switching method, low power consumption, resistance to 380V misconnection, strong anti-interference ability, and stable and reliable operation. Utility Model Content
[0005] The technical problem to be solved by the utility model is generally to provide an RS485 and CAN communication switching circuit based on a dual-channel relay design.
[0006] In order to solve the above problems, the technical solution adopted by the utility model is:
[0007] The utility model describes a RS485 and CAN communication switching circuit based on a dual-channel relay design, which can conveniently and in real time realize the communication mode switching between RS485 and CAN buses. The dual-channel relay is used as the channel main switching device, and the protection port circuit design is added, which can not only ensure the stability of the switching quality, but also greatly improve the external interference protection ability of the circuit. The circuit design includes a dual-channel relay drive circuit and an interface protection circuit.
[0008] Beneficial effects of the utility model: The utility model provides a RS485 and CAN communication switching circuit based on a dual-channel relay design. Its circuit design adopts a multiplexing external terminal channel method, and the system MCU control signal controls the front-end drive circuit and the dual-channel relay to complete the channel switching. It does not need to maintain hardware equipment or external terminals to achieve RS485 and CAN communication switching, which not only saves external terminal resources, but also ensures the real-time, convenient and stable channel switching; its circuit design uses dual-channel relays to replace the mainstream integrated switch switching chip as the main channel switching device, which improves the circuit's anti-static ability and greatly reduces the risk of device damage; its circuit adopts RC low-pass filtering, diode freewheeling, external port TVS and thermistor protection and other designs to avoid malfunction and malfunction of the circuit, greatly improving its own interference filtering ability and resistance to external abnormal signals, ensuring stable, safe and reliable circuit communication quality.
[0009] The utility model has reasonable design, low cost, strong durability, safety and reliability, simple operation, time-saving and labor-saving, money-saving, compact structure and convenient use. The utility model uses dual-channel relays as the main device for switching RS485 and CAN channels, which greatly reduces the risk of device damage due to external interference; the principle design of relay drive circuit and interface protection reuses external ports to save equipment resources; the circuit scheme has strong anti-external interference ability and can resist 380V AC power supply misconnection without damage; channel switching is fast, efficient and convenient; BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 This is an application environment diagram of the RS485 and CAN communication switching circuit of the utility model.
[0011] Figure 2 This is a relay drive circuit diagram of the utility model.
[0012] Figure 3 This is the interface protection circuit diagram of the utility model. DETAILED DESCRIPTION
[0013] like Figure 1-3 As shown, the RS485 and CAN communication switching circuit based on the dual-channel relay design of this embodiment,
[0014] Figure 1 The figure shows the application environment of the RS485 and CAN communication switching circuit based on the dual-channel relay design of the utility model. As shown in the figure, the RS485 and CAN communication switching circuit based on the dual-channel relay design includes a dual-channel relay drive circuit and an interface protection circuit. In the application environment, the connection relationship is that the MCU control signal is connected to the dual-channel relay drive circuit. When the MCU receives the channel switching instruction, the control signal is output to drive the relay; the RS485 signal and the CAN signal are respectively connected to the dual-channel relay drive circuit as the data input source; the dual-channel relay drive circuit is connected to the interface protection circuit, and the signal transmission passes through the interface protection circuit, which can filter out abnormal interference signals such as static electricity, voltage shock, burrs, etc., and can also prevent the external terminal from misinterpreting the 380V AC power supply and causing circuit damage; the interface protection circuit is connected to the lower-level equipment, and the data signal is interactive after passing through the interface protection circuit.
[0015] Figure 2 The figure shows a relay drive circuit of the utility model, including a channel switching control pin SWITCH, an RS485 signal interface RS485-A, an RS485 signal interface RS485-B, a signal output port A, a signal output port B, a CAN signal interface CAN-A, a CAN signal interface CAN-B, resistors R1, R2, capacitors C1, C2, a MOS tube Q1, a diode D1, a relay K1, and a power supply VCC. The connection relationship is as follows: SWITCH is connected to the left end of resistor R1, the right end of resistor R1 is connected to the upper end of resistor R2, the upper end of capacitor C1 and the gate of MOS tube Q1, the lower end of resistor R2 is connected to the lower end of capacitor C1 to GND, the source of MOS tube Q1 is connected to GND, the drain of MOS tube Q1 is connected to the positive electrode of diode D1 and pin 5 of relay K1, the power supply VCC is connected to the negative electrode of diode D1, the right end of capacitor C2 and pin 1 of relay K1, the left end of capacitor C2 is connected to GND, the RS485 signal interface RS485-A is connected to pin 2 of relay K1, the RS485 signal interface RS485-B is connected to pin 6 of relay K1, the CAN signal interface CAN-A is connected to pin 4 of relay K1, the CAN signal interface CAN-B is connected to pin 8 of relay K1, the signal output port A is connected to pin 3 of relay K1, and the signal output port B is connected to pin 7 of relay K1.
[0016] like Figure 2, the system MCU can set the signal output port to be the RS485 channel when SWITCH is low, and the signal output port to be the CAN channel when SWITCH is high. When SWITCH is low, MOS tube Q1 cannot be turned on, and relay K1 maintains the connection between the normally closed contacts (i.e., pins 3 and 4 are connected, and pins 7 and 8 are connected); when the MCU receives the channel switching signal, SWITCH is immediately pulled high, MOS tube Q1 is turned on, and the current passes through relay K1 and MOS tube Q1 to GND, and the normally open contacts of relay Q1 are attracted to complete the channel switching (i.e., pins 2 and 3 are connected, and pins 6 and 7 are connected); the pull-up and pull-down of the SWITCH signal can be driven by the system MCU output or hardware trigger (such as a toggle switch and other devices);
[0017] The function of resistor R1 and capacitor C1 is to form a low-pass filter, which can filter out the interference signal of the communication line and prevent the MOS tube Q1 from being turned on by mistake;
[0018] The function of resistor R2 is that after the device is powered on but before the system is running, SWITCH is in an uncontrolled state. Pulling R2 down to ground can ensure that the gate of Q1 is at a low level during this period of time, avoiding erroneous tripping of relay K1.
[0019] The function of diode D1 is to be connected in parallel with the coil end of relay K1 to provide a freewheeling loop for the induced current generated by the reset of relay K1, so as to avoid the high voltage spike at the drain of MOS tube Q1 and thus damage MOS tube Q1;
[0020] In summary, the relay drive circuit controls the MOS tube to drive the opening and closing state of the dual-channel relay to complete the RS485 and CAN channel selection switching. The circuit can filter out signal interference such as burrs, respond promptly, and have high operating stability.
[0021] Figure 3 The interface protection circuit of the utility model is shown, including a signal output port A, a signal output port B, a reference ground GND, TVS tubes Z1, Z2, thermistors W1, W2, external terminals A, and external terminals B. The connection relationship is that the signal output port A is connected to the negative electrode of the TVS tube Z1 and the left end of the thermistor W1, the signal output port B is connected to the negative electrode of the TVS tube Z2 and the left end of the thermistor W2, the positive electrode of the TVS tube Z1 is connected to the positive electrode of the TVS tube Z2 to GND, the right end of the thermistor W1 is connected to the external terminal A, and the right end of the thermistor W2 is connected to the external terminal B.
[0022] like Figure 3 In the interface protection circuit shown, thermistors W1 and W2 can prevent external terminals from being mistakenly connected to a 380V AC power supply and protect the internal circuit; TVS tubes Z1 and Z2 can filter out abnormal interference signals (such as static electricity and surge) from external terminals and enhance the stability of circuit communication.
[0023] The present invention is fully described for a clearer disclosure, and the prior art will not be listed one by one.
[0024] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the utility model, rather than to limit it; although the utility model is described in detail with reference to the above embodiments, ordinary technicians in this field should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features therein with equivalents; it is obvious for those skilled in the art to combine multiple technical solutions of the utility model. However, these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the utility model.
Claims
1. A RS485 and CAN communication switching circuit based on a dual-channel relay design, characterized in that: It includes an electrically connected dual-channel relay drive circuit and an interface protection circuit; the dual-channel relay drive circuit is electrically connected to the MCU; The dual-channel relay drive circuit is electrically connected with RS485 signal and CAN signal as data input sources; The interface protection circuit is used to electrically connect the lower level equipment; A dual-channel relay drive circuit includes a channel switching control pin SWITCH, an RS485 signal interface RS485-A, an RS485 signal interface RS485-B, a signal output port A, a signal output port B, a CAN signal interface CAN-A, a CAN signal interface CAN-B, resistors R1 and R2, capacitors C1 and C2, a MOS tube Q1, a diode D1, a relay K1, and a power supply VCC; SWITCH is connected to the left end of resistor R1, the right end of resistor R1 is connected to the upper end of resistor R2, the upper end of capacitor C1 and the gate of MOS tube Q1, the lower end of resistor R2 is connected to the lower end of capacitor C1 to GND, the source of MOS tube Q1 is connected to GND, the drain of MOS tube Q1 is connected to the positive electrode of diode D1 and pin 5 of relay K1, the power supply VCC is connected to the negative electrode of diode D1, the right end of capacitor C2 and pin 1 of relay K1, the left end of capacitor C2 is connected to GND, the RS485 signal interface RS485-A is connected to pin 2 of relay K1, the RS485 signal interface RS485-B is connected to pin 6 of relay K1, the CAN signal interface CAN-A is connected to pin 4 of relay K1, the CAN signal interface CAN-B is connected to pin 8 of relay K1, the signal output port A is connected to pin 3 of relay K1, and the signal output port B is connected to pin 7 of relay K1.
2. The RS485 and CAN communication switching circuit based on the dual-channel relay design according to claim 1, characterized in that: The interface protection circuit includes a signal output port A, a signal output port B, a reference ground GND, TVS tubes Z1 and Z2, thermistors W1 and W2, an external terminal A and an external terminal B; Signal output port A is connected to the cathode of TVS tube Z1 and the left end of thermistor W1, signal output port B is connected to the cathode of TVS tube Z2 and the left end of thermistor W2, the anode of TVS tube Z1 is connected to the anode of TVS tube Z2 to GND, the right end of thermistor W1 is connected to external terminal A, and the right end of thermistor W2 is connected to external terminal B.