UART optocoupler isolation communication control system and method

By using PWM-controlled transistors and RC energy storage filter circuits, controllable input current is provided for the UART optocoupler isolated communication system, solving the problems of communication instability under varying node numbers and high-temperature environments, and achieving low-cost stable communication.

CN121864086APending Publication Date: 2026-04-14GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-10
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In existing UART optically isolated communication, changes in the number of nodes and high-temperature environments can lead to insufficient input current of the optical coupler, resulting in signal distortion or communication failure, which affects communication stability and reliability.

Method used

The switching of the transistor is controlled by PWM. The controllable input current is provided to the communication optocoupler through the RC energy storage filter circuit and the current limiting resistor. The PWM duty cycle is dynamically adjusted to adapt to different numbers of nodes and high temperature environments, ensuring that the optocoupler is in saturated conduction state.

Benefits of technology

Stable communication was achieved under varying numbers of nodes and high-temperature environments, reducing communication costs and improving communication reliability and adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121864086A_ABST
    Figure CN121864086A_ABST
Patent Text Reader

Abstract

The UART optocoupler isolation communication control system comprises an optocoupler, a host computer and a slave computer, the host computer and the slave computer are connected through the optocoupler, and the optocoupler is used for electrical isolation between the host computer and the slave computer; the optocouplers comprise a control optocoupler and a communication optocoupler, each optocoupler comprises a primary side and a secondary side, the host comprises a UART interface, a controllable current module and a power supply module, and the controllable current module comprises an energy storage filter circuit, a controllable current signal input end and a triode; the UART interface is connected with the primary side of the communication optocoupler, the slave is connected with the secondary side of the communication optocoupler, the controllable current signal input end is connected with the triode, the triode is connected with the primary side of the control optocoupler, the energy storage filter circuit is connected with the secondary side of the control optocoupler, and the controllable current module and the power module are connected with the primary side of the communication optocoupler. And the two are cooperatively used for providing current required by saturation conduction for the communication optocoupler. A saturated conduction state of the communication optocoupler can be kept, different numbers of communication nodes and high-temperature operation environments can be adapted, and the technical effect of stable communication is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of communication control technology, and in particular relates to a UART optical coupler isolation communication control method. Background Technology

[0002] In existing multi-node communication control schemes, especially in household and commercial air conditioners and water heaters, UART (Universal Asynchronous Receiver / Transmitter) is commonly used for inter-board communication. Due to potential differences or electromagnetic interference between different circuit boards, electrical isolation is usually required. Traditionally, optocouplers are used for isolation; however, optocouplers suffer from problems such as temperature-dependent current transfer ratio (CTR) variations and saturation due to insufficient input current. Especially in high-temperature environments, the CTR drops significantly, leading to signal distortion or even communication failure. Furthermore, the input current requirements for optocouplers differ between single-node and multi-node communication; improper input current settings will affect the stability and reliability of communication.

[0003] Therefore, the existing technology lacks a control method that can dynamically adjust the input current of the optocoupler according to the number of communication nodes and the ambient temperature to ensure communication stability. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a UART optical coupler isolation communication control system and method, which solves the technical problems in multi-node UART optical coupler isolation communication, such as insufficient optical coupler input current due to changes in the number of nodes and reduced optical coupler current transmission ratio due to high temperature environment, which prevents saturation conduction and thus causes communication abnormalities.

[0005] The present invention adopts the following technical solution.

[0006] The first aspect of this invention provides a UART optically isolated communication control system, comprising: The system comprises an optocoupler, a master unit, and a slave unit, with the master unit and the slave unit connected via the optocoupler for electrical isolation between them. The optocoupler includes a control optocoupler and a communication optocoupler, each comprising a primary side and a secondary side. The master unit includes a UART interface, a controllable current module, and a power supply module. The controllable current module includes an energy storage filter circuit, a controllable current signal input terminal, and a transistor. The UART interface is connected to the primary side of the communication optocoupler, the slave unit is connected to the secondary side of the communication optocoupler, the controllable current signal input terminal is connected to the transistor, the transistor is connected to the primary side of the control optocoupler, the energy storage filter circuit is connected to the secondary side of the control optocoupler, and the controllable current module and the power supply module are connected to the primary side of the communication optocoupler. Both work together to provide the current required for the communication optocoupler to saturate and conduct.

[0007] Preferably, the controllable current signal input terminal is a PWM pin.

[0008] Preferably, the UART interface includes a host transmitter and a host receiver, and the slave device includes a slave receiver and a slave transmitter. In the transmission link, the host transmitter is connected to the primary side of the communication optocoupler, and the slave receiver is connected to the secondary side of the communication optocoupler. In the reception link, the slave transmitter is connected to the primary side of the communication optocoupler, and the host receiver is connected to the secondary side of the communication optocoupler.

[0009] A second aspect of the present invention provides a control method for the above-described UART optically isolated communication control system, comprising: Step 1: Power on the device. The controllable current signal input terminal is the PWM pin, which outputs a high-level signal. The variable current module outputs the maximum current value. Step 2: Based on the maximum current value, perform host name selection and determine the number of slave responses. If there are 2 or more slave responses, it is considered multiple slave responses, proceed to step 3; if there is 1 slave response, it is considered single slave responses, proceed to step 4; if there are no slave responses, it means no slave is connected. Step 3: Based on the number of slave responses, the PWM pin outputs a PWM waveform with the corresponding duty cycle according to the number of nodes, and returns to step 2; Step 4: Based on the number of slave responses, output a low-level signal from the PWM pin; Step 5: Based on the low-level signal, perform master name calling. If only one slave responds, it indicates that single-node communication is normal; if no slave responds, proceed to step 6. Step 6: Based on the lack of slave response in Step 5, it is determined that the optocoupler's current ratio has decreased due to high temperature. The PWM duty cycle is adjusted by the PWM pin to restore normal communication for the single slave, and then the process returns to Step 5.

[0010] Preferably, when the PWM pin outputs a high-level signal: The PWM pin outputs a high-level signal → the transistor turns on → the primary side of the control optocoupler turns on → the secondary side of the control optocoupler turns on → the power module supplies power to the energy storage filter circuit → the energy storage filter circuit provides current to the primary side of the communication optocoupler through a resistor.

[0011] Preferably, when the PWM pin outputs a low-level signal: When the PWM pin outputs a low-level signal, the transistor is cut off, the primary side of the control optocoupler is not turned on, the secondary side of the control optocoupler is not turned on, the power module does not supply power to the energy storage filter circuit, and the energy storage filter circuit does not supply current to the primary side of the communication optocoupler through the resistor.

[0012] A third aspect of the present invention provides an air conditioner, The control method described above is adopted.

[0013] The fourth aspect of this invention provides a water heater, The control method described above is adopted.

[0014] The fifth aspect of the present invention provides a terminal, including a processor and a storage medium; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the steps according to the method described above.

[0015] A sixth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.

[0016] The beneficial effect of this invention is that, compared with the prior art, by adjusting the input current through PWM (Pulse Width Modulation), the secondary current of the control optocoupler changes with the input current, thereby maintaining the saturated conduction state of the communication optocoupler. This can adapt to different numbers of communication nodes and high-temperature operating environments, achieving the technical effect of stable communication.

[0017] This invention provides a UART optically isolated communication control method adaptable to different numbers of communication nodes and high-temperature operating environments. It employs a master-slave UART optically isolated communication structure to achieve low-cost isolation for multi-node communication. This invention controls the switching of a transistor via a PWM pin, thereby adjusting the conduction state of the optocoupler. After the PWM waveform is filtered by RC energy storage, a controllable input current is provided to multiple communication optocouplers through a current-limiting resistor. The PWM duty cycle is dynamically adjusted according to the number of communication nodes and the communication status to regulate the input current of the control optocoupler, ensuring that the communication optocoupler is in a saturated conduction state to adapt to communication requirements under different operating conditions. In high-temperature operating environments, the PWM duty cycle is increased to compensate for the decrease in the CTR of the communication optocoupler and maintain communication stability.

[0018] This invention provides a UART optocoupler-isolated communication control method that can adapt to different numbers of communication nodes and high-temperature operating environments. The communication status can be obtained from the communication between the master and slave devices. Upon power-on, the PWM pin outputs a high level, the master device identifies the slave device, and the master device initially determines whether it is multi-node communication based on the responses of each slave device. The number of nodes is determined based on the slave device responses, and then the PWM duty cycle is determined (the number of nodes corresponding to the PWM duty cycle can be obtained through experiments, which are combined with the usage conditions).

[0019] When the temperature is too high, the PWM duty cycle is adjusted to ensure the optocoupler is saturated and conducting. This achieves saturated conduction of the optocoupler at low cost, ensuring smooth communication between the master and slave devices. Attached Figure Description

[0020] Figure 1 A schematic diagram of an optically isolated communication system with one master and three slaves (1 master and 3 slaves) provided by the present invention, showing the master transmitting and the slave receiving data. Figure 2 A schematic diagram of a master-slave (1 master and 3 slaves) optically isolated communication master receiving transmissions from slaves provided by the present invention; Figure 3 The flowchart of UART optical coupler isolated communication control provided by the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this invention. The embodiments described in this application are merely some embodiments of this invention, and not all embodiments. Based on the spirit of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of this invention.

[0022] The embodiments of the present invention solve two problems existing in the current UART optically isolated communication structure: 1. In high-temperature environments, the current transfer ratio (CTR) of the optocoupler decreases significantly, leading to signal distortion or even communication failure. 2. The requirements for the input current of the optocoupler differ between single-node and multi-node communication. If the input current is not set properly, it will affect the stability and reliability of the communication.

[0023] Example 1 like Figure 1-2 As shown, Embodiment 1 of the present invention provides a UART optically isolated communication control system, suitable for use in household and commercial air conditioners and water heaters, etc., to achieve low-cost, high-reliability isolated communication between the main control board and multiple driver board slaves. It includes: Optical coupler, master and slave, the master and slave are connected through the optical coupler; the optical coupler is used for electrical isolation between the master and slave.

[0024] The optical coupler includes a control optical coupler and a communication optical coupler. The control optical coupler includes a control optical coupler U11, and the communication optical coupler includes a first communication optical coupler U4, a second communication optical coupler U1, a third communication optical coupler U2, and a fourth communication optical coupler U6. Each optical coupler includes a primary side and a secondary side.

[0025] The host includes a UART interface, a controllable current module, and a power supply module; the UART interface includes a host transmitter UART-TX and a host receiver UART-RX; the slave includes a slave receiver and a slave transmitter. In a preferred but non-limiting embodiment of the present invention, there are three slaves, including a first slave, a second slave, and a third slave. The first slave includes a first slave receiver MCU_RXD1 and a first slave transmitter MCU_TDX1, the second slave includes a second slave receiver MCU_RXD2 and a second slave transmitter MCU_TDX2, and the third slave includes a third slave receiver MCU_RXD3 and a third slave transmitter MCU_TDX3.

[0026] The UART interface includes a master transmitter and a master receiver, and the slave includes a slave receiver and a slave transmitter. In the transmission link, the master transmitter is connected to the primary side of the communication optocoupler, and the slave receiver is connected to the secondary side of the communication optocoupler. In the reception link, the slave transmitter is connected to the primary side of the communication optocoupler, and the master receiver is connected to the secondary side of the communication optocoupler.

[0027] The UART interface is connected to the communication optical coupler, and the host transmitter UART-TX is connected to the primary side of the first communication optical coupler U4, the second communication optical coupler U1, and the third communication optical coupler U2, respectively.

[0028] The controllable current module includes an RC energy storage filter circuit, a PWM pin, and a transistor. The RC energy storage filter circuit is used for energy storage and filtering, the PWM pin is used to output a PWM (Pulse Width Modulation) signal, and the transistor is used to control the conduction of the optocoupler U11.

[0029] The transistors are connected to the PWM pin and the primary side of the control optocoupler U11, respectively. The secondary side of the control optocoupler U11 is connected to the power module and the RC energy storage filter circuit, respectively. Meanwhile, the other end of the RC energy storage filter circuit is connected to the primary side of the first communication optocoupler U4, the second communication optocoupler U1, and the third communication optocoupler U2 after merging with the power module.

[0030] The controllable current module and the power supply module work together to provide the current required for the communication optocoupler to saturate and conduct.

[0031] The first slave receiver MCU_RXD1 is connected to the secondary side of the first communication optocoupler U4, the second slave receiver MCU_RXD2 is connected to the secondary side of the second communication optocoupler U1, and the third slave receiver MCU_RXD3 is connected to the secondary side of the third communication optocoupler U2.

[0032] The host receiver UART-RX is connected to the secondary side of the fourth communication optocoupler U6, and the first slave transmitter MCU_TDX1, the second slave transmitter MCU_TDX2, and the third slave transmitter MCU_TDX3 are respectively connected to the primary side of the fourth communication optocoupler U6.

[0033] The control system includes a master unit and slave units. The master unit communicates with multiple slave units through a UART interface, and the master unit and slave units are electrically isolated by optocouplers.

[0034] The host has a PWM pin used to control the conduction state of the primary side of optocoupler U11. The PWM signal is processed by an RC energy storage and filtering circuit, which includes resistor R81 and capacitor C205, serving both energy storage and filtering functions. This circuit provides controllable input current to the primary side of multiple communication optocouplers (such as U4, U1, and U2) through current-limiting resistor R4. By adjusting the duty cycle of the PWM signal, the current on the primary side of optocoupler U11 can be changed, thereby regulating the output current on the secondary side of optocoupler U11 and ensuring that the communication optocoupler is always in a saturated conduction state.

[0035] Example 2 like Figure 3 As shown, Embodiment 2 of the present invention provides a UART optically isolated communication control method that can adapt to different numbers of communication nodes and high-temperature operating environments. It adopts the master-slave UART optically isolated communication structure of Embodiment 1 to achieve low-cost isolation of multi-node communication; The PWM pin controls the switching of the transistor, thereby controlling the conduction state of the optocoupler U11. After passing through the RC energy storage filter circuit, the PWM waveform provides controllable input current to multiple communication optocouplers through the current-limiting resistor R4. The PWM duty cycle is dynamically adjusted according to the number of communication nodes and the communication status to regulate the input current of the communication optocouplers, ensuring that the communication optocouplers are in a saturated conduction state to adapt to the communication requirements under different operating conditions. In high-temperature operating environments, the PWM duty cycle is increased to compensate for the decrease in the CTR of the communication optocouplers and maintain communication stability.

[0036] The optically isolated communication control method of Embodiment 2 of the present invention includes: Step 1: Power on the device. The PWM pin outputs a high-level (100% duty cycle) signal. At this time, the variable current module outputs the maximum current. Briefly describe how the signal output from the PWM pin affects the primary-side current of the control optocoupler U11: The PWM pin outputs a high-level signal → transistor Q2 turns on → the primary side of control optocoupler U11 turns on → the secondary side of control optocoupler U11 turns on → the power module VCC supplies power to the RC energy storage filter circuit → the energy storage filter circuit provides current to the primary side of the first communication optocoupler U4, the second communication optocoupler U1, and the third communication optocoupler U2 through resistor R4.

[0037] When the PWM pin outputs a low-level signal, transistor Q2 is cut off, the primary side of control optocoupler U11 is not conducting, the secondary side of control optocoupler U11 is not conducting, the power module VCC does not supply power to the RC energy storage filter circuit, and the energy storage filter circuit does not provide current to the primary side of the first communication optocoupler U4, the second communication optocoupler U1, and the third communication optocoupler U2 through resistor R4.

[0038] The PWM high-low level switching allows the power module VCC to supply power to the energy storage filter circuit when the PWM is high, and to stop supplying power to the energy storage filter circuit when the PWM is low, thereby controlling the magnitude of the primary side current value of the communication optocoupler.

[0039] The capacitor C205 in the energy storage filter circuit continuously provides current to the primary side of the first communication optocoupler U4, the second communication optocoupler U1, and the third communication optocoupler U2. However, the PWM signal output by the PWM pin indirectly controls the energy of the capacitor C205, which in turn controls the current supplied to the primary side of the first communication optocoupler U4, the second communication optocoupler U1, and the third communication optocoupler U2.

[0040] In a preferred but non-limiting embodiment of the present invention, transistor Q2 is an NPN transistor.

[0041] Step 2: Based on the controllable current value in Step 1, perform master name calling and determine the number of slave responses; if there are more than or equal to 2 slave responses, it is a multi-slave response, proceed to Step 3; if there is 1 slave response, it is a single-slave response, proceed to Step 4; if there is no slave response, it means no slave is connected.

[0042] Step 3: Based on the judgment result in Step 2, if multiple slave devices respond, the PWM pin outputs a PWM waveform with the corresponding duty cycle according to the number of nodes, and returns to the master device name in Step 2 to re-determine the number of slave device responses.

[0043] Step 4: Based on the judgment result in Step 2, when it is a single slave response, a low-level signal is output by the PWM pin.

[0044] Step 5: Based on the low-level signal in Step 4, re-probe the master node. If there is no response from the slave node, it indicates that the single-node communication is normal; if there is no response from the slave node, proceed to Step 6. Step 6: Based on the lack of slave response in Step 5, it indicates that the optocoupler current ratio has decreased due to high temperature. The PWM duty cycle is adjusted by the PWM pin to restore normal communication for the single slave and return to Step 5 to cycle through the master name call.

[0045] Closed-loop control system, including: PWM control generation → filtering → current conversion → optocoupler drive (saturation conduction) → master / slave communication → dynamic duty cycle adjustment A UART optocoupler isolation communication control method adaptable to different numbers of communication nodes and high-temperature operating environments is presented. A master-slave UART optocoupler isolation communication structure is adopted to achieve low-cost isolation for multi-node communication. The on / off state of the optocouplers is controlled by controlling the transistor's switching via a PWM pin. The PWM waveform, after being filtered by RC energy storage, provides controllable input current to multiple communication optocouplers through current-limiting resistors. The PWM duty cycle is dynamically adjusted according to the number of communication nodes and communication status to regulate the optocoupler input current, ensuring the optocouplers are in a saturated conduction state to adapt to communication requirements under different operating conditions. In high-temperature operating environments, the PWM duty cycle is increased to compensate for the decrease in optocoupler CTR, maintaining communication stability.

[0046] The communication status can be obtained from master / slave communication. When the device is powered on, the PWM pin outputs a high level, the master calls the name, and the response of each slave device initially determines whether it is multi-node communication. The number of nodes is determined based on the slave device responses, and then the PWM duty cycle is determined (the number of nodes corresponding to the PWM duty cycle can be obtained through experiments, which are combined with the usage situation). Using this method, the cost is very low.

[0047] Combination Figure 3In a logical example, the communication status can be obtained from master / slave communication. Upon power-on, the PWM pin outputs a high level, the master calls the name, and based on the responses of each slave, it is initially determined whether it is multi-node communication. The number of nodes is determined based on the slave responses, and then the PWM duty cycle is determined (the number of nodes corresponding to the PWM duty cycle can be obtained through experiments, which are combined with the usage situation).

[0048] When the temperature is too high, the PWM duty cycle also needs to be adjusted to ensure the optocoupler is saturated and conducting. This is determined experimentally. Typically, the operating environments of the master and slave devices are known, and the CTR curve of the optocoupler versus temperature is also known (provided by the optocoupler manufacturer). Therefore, the appropriate PWM duty cycle for different temperatures can be determined experimentally.

[0049] During system operation, the main control module first outputs a high-level PWM signal to drive the optocoupler to conduct and send a call command. If multiple slave devices respond, it is determined to be multi-node communication, and the main control module adjusts the PWM duty cycle according to the number of nodes to ensure sufficient optocoupler input current; if no slave device responds, it is determined that no slave device is connected; if only one slave device responds, it enters single-node communication mode.

[0050] In single-node communication mode, the master controller sends the name call command again. If the slave responds normally, the communication proceeds normally. If there is no response, it is determined that the communication is abnormal due to the decrease of the optocoupler CTR under high temperature environment. At this time, the master controller increases the PWM duty cycle and increases the optocoupler input current to restore normal communication.

[0051] This method solves the communication instability problem caused by changes in the number of nodes and high-temperature environments by dynamically adjusting the input current of the optocoupler, thereby improving the reliability and adaptability of communication.

[0052] Example 3 Based on Embodiment 1 of this invention, an alternative implementation method is proposed: using a digital potentiometer instead of the PWM pin control method, and adjusting the primary-side current of the optocoupler by controlling the resistance value of the digital potentiometer. This method can achieve more precise current control, is suitable for systems sensitive to PWM frequency, and avoids the response delay problem caused by RC energy storage filter circuits.

[0053] Example 4 Embodiment 4 of the present invention provides an air conditioner, including the system of Embodiment 1 or 3 above, or using the control method of Embodiment 2.

[0054] Example 5 Embodiment 5 of the present invention provides a water heater, including the system of Embodiment 1 or 3 above, or using the control method of Embodiment 2.

[0055] It adopts a master-slave UART optocoupler isolation communication method and uses PWM to control the primary current of the optocoupler to adapt to single-node, multi-node and high-temperature operating environments.

[0056] The system incorporates PWM pin output level signal control, RC energy storage filter circuit, and communication node identification mechanism, and dynamically adjusts the primary current of the optocoupler based on the number of nodes and ambient temperature.

[0057] This invention provides a scheme and method for dynamically adjusting the input current of an optocoupler, thereby improving the stability of the optocoupler-isolated communication structure.

[0058] The embodiments of the present invention solve two problems existing in the use of the existing UART optical coupler isolation communication structure: 1. In high-temperature environments, the current transfer ratio (CTR) of the optocoupler decreases significantly, leading to signal distortion or even communication failure. 2. The requirements for the input current of the optocoupler differ between single-node and multi-node communication. If the input current is not set properly, it will affect the stability and reliability of the communication.

[0059] Therefore, a control method is needed to dynamically adjust the input current of the optocoupler to ensure communication stability.

[0060] This invention has specific application scenarios for the UART optically isolated communication structure, including: 1. High temperature environment; 2. Switching between single-node and multi-node communication.

[0061] To address the specific technical problem of "insufficient input current of optocoupler leading to failure to saturate conduction", a combination of "PWM + filtering + dynamic current adjustment" is adopted to improve the stability of optocoupler isolation communication structure.

[0062] The PWM duty cycle is determined based on the slave response. The slave response can be used to determine whether the communication is normal, whether it is single-node communication, multi-node communication, no slave, and whether it is a high-temperature operating environment.

[0063] This is a closed-loop control system, including: PWM pin outputs level control signal → energy storage filter circuit → current conversion → communication optocoupler drive (saturation conduction) → master and slave communication → dynamic adjustment of PWM duty cycle.

[0064] The advantages of this invention are: 1) After the PWM waveform passes through the RC energy storage filter circuit, it provides controllable input current to multiple communication optocouplers through the current limiting resistor; 2) Based on the slave response, determine the number of communication nodes and the communication status dynamically to adjust the PWM duty cycle, thereby regulating the control optocoupler input current and ensuring that the optocoupler is in a saturated conduction state to meet the requirements under different conditions; 3) In high-temperature operating environments, the PWM duty cycle is increased to compensate for the decrease in optocoupler CTR and maintain communication stability.

[0065] Differences from existing technologies: 1. After the PWM waveform is filtered by RC energy storage, it provides controllable input current to multiple communication optocouplers through a current-limiting resistor; 2. Based on the slave response, determine the number of communication nodes and the communication status dynamically to adjust the PWM duty cycle, thereby regulating the input current of the control optocoupler and ensuring that the communication optocoupler is in a saturated conduction state to meet communication requirements under different conditions (no slave, single node, and multiple nodes). 3. In high-temperature operating environments, the PWM duty cycle is increased to compensate for the decrease in optocoupler CTR and maintain communication stability.

[0066] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.

[0067] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0068] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0069] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.

[0070] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.

Claims

1. A UART optically isolated communication control system, characterized in that, include: The system comprises an optocoupler, a master unit, and a slave unit, with the master unit and the slave unit connected via the optocoupler for electrical isolation between them. The optocoupler includes a control optocoupler and a communication optocoupler, each comprising a primary side and a secondary side. The master unit includes a UART interface, a controllable current module, and a power supply module. The controllable current module includes an energy storage filter circuit, a controllable current signal input terminal, and a transistor. The UART interface is connected to the primary side of the communication optocoupler, the slave unit is connected to the secondary side of the communication optocoupler, the controllable current signal input terminal is connected to the transistor, the transistor is connected to the primary side of the control optocoupler, the energy storage filter circuit is connected to the secondary side of the control optocoupler, and the controllable current module and the power supply module are connected to the primary side of the communication optocoupler. Both work together to provide the current required for the communication optocoupler to saturate and conduct.

2. The UART optically isolated communication control system according to claim 1, characterized in that: The controllable current signal input terminal is a PWM pin.

3. The UART optically isolated communication control system according to claim 1 or 2, characterized in that: The UART interface includes a master transmitter and a master receiver, and the slave device includes a slave receiver and a slave transmitter. In the transmission link, the master transmitter is connected to the primary side of the communication optocoupler, and the slave receiver is connected to the secondary side of the communication optocoupler. In the reception link, the slave transmitter is connected to the primary side of the communication optocoupler, and the master receiver is connected to the secondary side of the communication optocoupler.

4. A control method using the UART optically isolated communication control system according to any one of claims 1-3, characterized in that, include: Step 1: Power on the device. The controllable current signal input terminal is the PWM pin, which outputs a high-level signal. The variable current module outputs the maximum current value. Step 2: Based on the maximum current value, perform master name calling and determine the number of slave responses. If there are more than or equal to 2 slave responses, it is considered multiple slave responses, and proceed to step 3. If only one slave device responds, it is considered a single slave device response, proceed to step 4; If there is no response from the slave device, it means that no slave device has been connected. Step 3: Based on the number of slave responses, the PWM pin outputs a PWM waveform with the corresponding duty cycle according to the number of nodes, and returns to step 2; Step 4: Based on the number of slave responses, output a low-level signal from the PWM pin; Step 5: Based on the low-level signal, perform a master call. If only the slave responds, it indicates that the single-node communication is normal. If there is no response from the slave device, proceed to step 6; Step 6: Based on the lack of slave response in Step 5, it is determined that the optocoupler's current ratio has decreased due to high temperature. The PWM duty cycle is adjusted by the PWM pin to restore normal communication for the single slave, and then the process returns to Step 5.

5. The control method according to claim 4, characterized in that: When the PWM pin outputs a high-level signal: The PWM pin outputs a high-level signal → the transistor turns on → the primary side of the control optocoupler turns on → the secondary side of the control optocoupler turns on → the power module supplies power to the energy storage filter circuit → the energy storage filter circuit provides current to the primary side of the communication optocoupler through a resistor.

6. The control method according to claim 4, characterized in that: When the PWM pin outputs a low-level signal: When the PWM pin outputs a low-level signal, the transistor is cut off, the primary side of the control optocoupler is not turned on, the secondary side of the control optocoupler is not turned on, the power module does not supply power to the energy storage filter circuit, and the energy storage filter circuit does not supply current to the primary side of the communication optocoupler through the resistor.

7. An air conditioner, characterized in that: The control method described in any one of claims 4-6 shall be adopted.

8. A water heater, characterized in that: The control method described in any one of claims 4-6 shall be adopted.

9. A terminal, comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the steps of the method according to any one of claims 4-6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method according to any one of claims 4-6.