Communication system supporting 232 and 485 and having power output and control
By designing a communication system that supports both RS232 and RS485 interfaces, and combining a main control microcontroller, communication module, and relay module, the problem of incompatibility between sensor device interfaces was solved, enabling unified communication and power management for various sensor devices, and simplifying the wiring and usage process.
Patent Information
- Application Number
- CN202420759393.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-12
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2034-04-12
AI Technical Summary
Existing sensor devices typically only support one interface (232 or 485) in their communication systems, which leads to the need for multiple control systems when multiple sensors need to be used simultaneously, increasing wiring complexity and inconvenience in device power management.
A communication system supporting RS232 and RS485 interfaces was designed. It combines a main control microcontroller, a communication module, a relay module, and a DIP switch. The system is connected to the relay module and DIP switch through a GPIO interface to realize multi-channel power control and communication protocol switching, and supports unified management of various sensor devices.
It enables unified communication and power management for various sensor devices, simplifies the wiring process, and improves user efficiency and system flexibility.
Smart Images

Figure CN222071084U_ABST
Abstract
Description
Technical Field
[0001] The utility model relates to the technical field of sensor communication, in particular to a communication system supporting 232 and 485 and having power output and control. Background Art
[0002] In the fields of industrial control and water quality testing, it is often necessary to communicate with a variety of sensor devices. Common sensor devices are 232 or 485 communication interfaces. Traditional control systems generally only support one of the 232 or 485 interfaces. If multiple sensors need to be used at the same time, there are two interfaces, so two control systems are required, which causes inconvenience to users. In addition, when there are many devices, each sensor requires a separate power supply, which brings trouble to wiring. Utility Model Content
[0003] The utility model aims to provide a communication system which supports 232 and 485 and has power output and control.
[0004] In order to achieve the above purpose, the technical solution of the utility model is:
[0005] A communication system supporting 232 and 485 and having power output and control, characterized in that it comprises a main control single-chip microcomputer, a communication module, a relay module and a dip switch, wherein the main control single-chip microcomputer is connected to the relay module via a GPIO interface, the main control single-chip microcomputer is connected to the dip switch module via a GPIO interface, the main control single-chip microcomputer is connected to the communication module via a UART communication interface, and the communication module comprises an Ethernet communication module, an RS485 communication module and an RS232 communication module;
[0006] The RS485 communication module includes an RS485 transceiver, which converts the UART signal of the main control microcontroller into an RS485 signal. The RS485 communication module also includes a digital isolator and a first optical coupler, wherein the digital isolator converts the 3.3V UART signal of the main control microcontroller into a 5V level, and the first optical coupler converts the 3.3V RS485 enable signal of the main control microcontroller into a 5V signal, so that the main control microcontroller controls the enable pin of the RS485 transceiver. A TVS tube is provided between the data input pin and the data output pin of the RS485 transceiver, and the data input pin and the data output pin of the RS485 transceiver are grounded through the TVS tube;
[0007] The RS232 communication module includes an RS232 transceiver, which converts the UART signal of the main control microcontroller into an RS232 signal, and the data input pin and the data output pin of the RS232 transceiver are grounded through a TVS tube;
[0008] The Ethernet communication module includes a serial port networking device, the UART pin of the master microcontroller is connected to the data receiving and data transmitting pins of the serial port networking device, and the serial port networking device converts the UART signal of the master microcontroller into an Ethernet signal.
[0009] Furthermore, the main control microcontroller is connected to six relay modules via six GPIO interfaces, and the relay module includes a second optical coupler and a relay.
[0010] Furthermore, the dip switch module is provided with 6 switches, and the main control microcontroller is connected to the 6 switches via 6 GPIO interfaces.
[0011] Furthermore, the RS485 transceiver is connected to an LED light, and the LED light indicates the working status of the RS485 transceiver.
[0012] Furthermore, the input pins and output pins of the RS485 transceiver and the RS232 transceiver are both provided with fuses.
[0013] The main control microcontroller of the communication system of the utility model communicates with 232, 485 and Internet communication modules through UART serial ports, which can unify various interface communications and data processing. The three communication ports can set the communication mode by modifying the microcontroller registers, which has a wide range of applications and simple and convenient wiring.
[0014] The utility model provides multiple power supplies to the sensor equipment through the relay module. The user can turn on and off each device individually through the dip switch, quickly change the system working mode, and improve the user's efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a schematic diagram of the system structure of the utility model;
[0016] Figure 2 It is a schematic diagram of the system structure of the utility model used on site;
[0017] Figure 3 This is a circuit diagram of the main control microcontroller of the utility model;
[0018] Figure 4 This is a circuit diagram of the RS485 communication module of the utility model;
[0019] Figure 5 This is a circuit diagram of the RS232 communication module of the utility model;
[0020] Figure 6 This is a schematic diagram of the Ethernet communication module of the utility model;
[0021] Figure 7This is a circuit diagram of the relay module of the utility model;
[0022] Figure 8 The figure is a circuit diagram of the DIP switch module of the utility model.
[0023] Reference numerals:
[0024] U1 main control microcontroller, U2 RS232 transceiver, U3 RS485 transceiver, U4 digital isolator,
[0025] U5 first optocoupler, U6 serial port networking device, U7 second optocoupler,
[0026] D1~5 the first to fifth TVS tubes, F1~4 the first to fourth fuses,
[0027] SW dip switch module, K relay. DETAILED DESCRIPTION
[0028] The technical solution of the utility model will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the utility model, not all of the embodiments. Based on the embodiments of the utility model, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the utility model.
[0029] The utility model discloses a communication system supporting 232 and 485 and having power output and control, such as Figure 1 As shown, it includes a main control microcontroller U1, a communication module, a relay module and a dip switch. The main control microcontroller U1 adopts FCM32F103VBT6. The main control microcontroller U1 is connected to the communication module through a UART communication interface. The communication module includes an Ethernet communication module, an RS485 communication module and an RS232 communication module.
[0030] like Figure 2 As shown, the relay module has multiple relays K, each relay K can control each output power supply separately, the RS485 communication module is connected to the sensor device with a 485 communication interface, and supports a maximum of 64 sensor devices connected at the same time, and the RS232 communication module is connected to the sensor device with a 232 communication interface; the Ethernet module is used for the on-site control computer to upload the collected data and issue control commands, such as turning on or off the power of several sensor devices.
[0031] The main control microcontroller U1 is connected to the relay module through the GPIO interface, such as Figure 3 and Figure 7As shown, the main control microcontroller U1 is connected to six relay modules through pin 72 POWER_CTRL_0, pin 71 POWER_CTRL_1, pin 70 POWER_CTRL_2, pin 69 POWER_CTRL_3, pin 68 POWER_CTRL_4, and pin 67 POWER_CTRL_5. Each relay module includes a second optical coupler U7 and a relay K.
[0032] The main control microcontroller U1 is connected to the DIP switch module SW through the GPIO interface. Figure 3 and Figure 8 As shown, the dip switch module SW is provided with 6 switches, and the main control microcontroller U1 is connected to the 6 dip switches through pin 56 CONFIG_0, pin 55 CONFIG_1, pin 54 CONFIG_2, pin 53 CONFIG_3, pin 52 CONFIG_4, and pin 51 CONFIG_5. Each time the main control microcontroller U1 is turned on, it will read the current level on each switch to determine which state it needs to work in.
[0033] like Figure 4 As shown, the RS485 communication module includes an RS485 transceiver U3, a digital isolator U4 and a first optical coupler U5. The RS485 transceiver U3 adopts SCM3403ASA, the digital isolator U4 adopts π122M31, the main control microcontroller U1 is connected to the digital isolator U4 through the 90-pin UART1_RX and the 89-pin UART1_TX, and the 7-pin VIA and 6-pin VOB of the digital isolator U4 are respectively connected to the 1-pin RO and the 4-pin DI of the RS485 transceiver U3.
[0034] The RS485 transceiver U3 converts the UART signal of the master microcontroller U1 into an RS485 signal, the digital isolator U4 converts the 3.3V UART signal of the master microcontroller U1 into a 5V level, and the first optocoupler U5 converts the 3.3V RS485 enable signal of the master microcontroller U1 into a 5V signal, so that the master microcontroller U1 controls the enable pin of the RS485 transceiver U3.
[0035] The 3rd pin DE and the 2nd pin RE_N of the RS485 transceiver U3 are respectively connected to the first LED lamp and the second LED lamp, and the first LED lamp and the second LED lamp are used to indicate the working status of the RS485 transceiver U3.
[0036] like Figure 5 As shown, the RS232 communication module includes an RS232 transceiver U2. The RS232 transceiver U2 adopts MAX3232ESE. The RS232 transceiver U2 converts the UART signal of the main control microcontroller U1 into an RS232 signal. Pins 13 and 14 of the RS232 transceiver U2 are connected to a device with a 232 communication interface.
[0037] The first fuse F1 and the second fuse F2 are respectively provided between the 13th pin R1IN and the 14th pin T1OUT of the RS232 transceiver U2 and the device, and the third fuse F3 and the fourth fuse F4 are provided between the 7th pin B and the 6th pin A of the RS485 transceiver U3 and the sensor device. The fuses prevent large currents on the signal lines from damaging the chip.
[0038] The 13th pin R1IN and the 14th pin T1OUT of the RS232 transceiver U2 are grounded through the first TVS tube D1 and the second TVS tube D2 respectively. A third TVS tube D3 is provided between the 7th pin B and the 6th pin A of the RS485 transceiver U3. The 7th pin B and the 6th pin A of the RS485 transceiver U3 are grounded through the fourth TVS tube D4 and the fifth TVS tube D5. The TVS tube prevents the high voltage caused by electrostatic discharge on the signal line from damaging the chip.
[0039] like Figure 6 As shown, the Ethernet communication module includes a 10 / 100Mbps serial port networking device U6. The UART signal of the serial port networking device U6 master microcontroller U1 is converted into an Ethernet signal. The serial port networking device U6 adopts USR_K2. The 82-pin UART2_RX and 81-pin UART2_TX of the master microcontroller U1 are connected to the 8-pin RXD and 9-pin TXD of the serial port networking device U6 respectively.
[0040] The three communication ports between the master microcontroller U1 and the Ethernet communication module, RS485 communication module, and RS232 communication module can all be set up by modifying the master microcontroller U1 register to switch between master and slave, or between communication protocols, such as Modbus-RTU protocol, Modbus-TCP protocol, and users can also customize protocols.
[0041] The usage scenarios of the utility model include an on-site management computer and multiple sensor devices, such as water quality NTU sensors, TOC sensors, and TDS sensors. The utility model provides power to multiple sensor devices separately, can remotely control each device to be turned on and off separately, communicates with sensor devices with different interfaces through a 485 or 232 bus, and outputs data to a local control computer through Ethernet.
[0042] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the utility model, rather than to limit it. Although the utility model has been described in detail with reference to the aforementioned embodiments, ordinary technicians in this field should understand that they can still modify the technical solutions recorded in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not make the essence of the corresponding technical solution deviate from the scope of the technical solution of the embodiments of the utility model.
Claims
1. A communication system that supports 232 and 485 and has power output and control. It is characterized in that It includes a main control single-chip microcomputer, a communication module, a relay module and a dip switch, wherein the main control single-chip microcomputer is connected to the relay module through a GPIO interface, the main control single-chip microcomputer is connected to the dip switch module through a GPIO interface, the main control single-chip microcomputer is connected to the communication module through a UART communication interface, and the communication module includes an Ethernet communication module, an RS485 communication module and an RS232 communication module; The RS485 communication module includes an RS485 transceiver, which converts the UART signal of the main control microcontroller into an RS485 signal. The RS485 communication module also includes a digital isolator and a first optical coupler, wherein the digital isolator converts the 3.3V UART signal of the main control microcontroller into a 5V level, and the first optical coupler converts the 3.3V RS485 enable signal of the main control microcontroller into a 5V signal, so that the main control microcontroller controls the enable pin of the RS485 transceiver. A TVS tube is provided between the data input pin and the data output pin of the RS485 transceiver, and the data input pin and the data output pin of the RS485 transceiver are grounded through the TVS tube; The RS232 communication module includes an RS232 transceiver, which converts the UART signal of the main control microcontroller into an RS232 signal, and the data input pin and the data output pin of the RS232 transceiver are grounded through a TVS tube; The Ethernet communication module includes a serial port networking device, the UART pin of the master microcontroller is connected to the data receiving and data transmitting pins of the serial port networking device, and the serial port networking device converts the UART signal of the master microcontroller into an Ethernet signal.
2. The communication system supporting 232 and 485 and having power output and control according to claim 1, It is characterized in that The main control single chip microcomputer is connected to six relay modules via six GPIO interfaces, and the relay module includes a second optical coupler and a relay.
3. The communication system supporting 232 and 485 and having power output and control according to claim 1, It is characterized in that The dip switch module is provided with 6 switches, and the main control microcontroller is connected to the 6 switches via 6 GPIO interfaces.
4. The communication system supporting 232 and 485 and having power output and control according to claim 1, It is characterized in that The RS485 transceiver is connected to an LED light, and the LED light indicates the working status of the RS485 transceiver.
5. The communication system supporting 232 and 485 and having power output and control according to claim 1, It is characterized in that The input pins and output pins of the RS485 transceiver and the RS232 transceiver are both provided with fuses.
