One-to-many electromagnetic valve control system
By designing a one-to-many solenoid valve control system, using master-slave architecture and WiFi remote control, the existing sewage control system has solved the problems of complex structure, high cost, poor scalability and lack of remote control, and achieved intelligent and reliable sewage control.
Patent Information
- Application Number
- CN202510218490.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-05-30
AI Technical Summary
The existing pollutant discharge control system mainly adopts a one-to-one control mode, resulting in complex system structure, high cost, poor scalability, and lack of remote control and networking functions, making it difficult to meet the development needs of industrial automation and Internet of Things technology.
A one-to-many solenoid valve control system is designed, and the master-slave architecture of the master-slave control board and the slave control board is adopted. The communication between the master and multiple slave devices is realized through the CAN communication protocol, and remote control is realized through the WiFi module and the Web interface.
It realizes intelligent remote control of solenoid valves, improves the universality and stability of the system, meets the development needs of the industrial Internet of Things, reduces the system failure rate, improves control efficiency, and ensures the reliability and safety of sewage discharge control.
Smart Images

Figure CN120065858A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of automation technology, and particularly relates to a one-to-many solenoid valve control system. Background Art
[0002] With the rapid development of industrial automation and Internet of Things technology, the demand for automatic sewage discharge control and centralized management is increasing day by day; in many industrial production and environmental treatment scenarios, it is often necessary for the control center to manage and control multiple electromagnetic sewage discharge valves simultaneously; the traditional sewage discharge control method often adopts a one-to-one control mode, which not only increases the system complexity and hardware cost, but also causes a waste of human resources in practical applications and is difficult to meet the development needs of industrial automation; currently, there are mainly many problems in the sewage discharge control systems on the market, as follows:
[0003] 1. Adopting a one-to-one control mode, each sewage discharge valve needs to be equipped with an independent control unit, the system structure is complex and the cost is high, the system depends on the control unit of a specific device for signal transmission, and the applicable range is limited. For example, a system for controlling a relay using a trigger, with the authorization publication number: CN111918787A, relates to a system and method for controlling a relay using a trigger, which is installed with a trigger for controlling the relay by receiving a signal from the control unit in the battery management system of a vehicle, and when the operating power of the battery management system of the vehicle is interrupted, the trigger operating power is supplied to the trigger through a monitoring circuit connected to the vehicle's battery to maintain the closed state of the relay for controlling the driving power of the vehicle and maintain the power of the vehicle for a predetermined time. However, this solution depends on the control unit in the battery management system of the vehicle to send a signal to control the trigger of the relay. This dependence limits the applicable range of the system to specific types of devices. Secondly, this solution maintains the closed state of the relay through the monitoring circuit when the power of the battery management system is interrupted, which may lead to instability and delay and affect the reliable control of the vehicle's driving power;
[0004] 2. Lack of remote control and networking functions, unable to achieve centralized monitoring and management. The scalability of the system is limited, and it is difficult to flexibly adjust the control scale according to actual sewage discharge requirements. For example, a pluggable relay control board card with the authorization publication number: CN219844619U involves a pluggable relay control board card; the relay control board card is an 18-channel relay control board card, and each of the relay controls includes a voltage stabilization circuit, a relay drive circuit, a CAN communication circuit, and a single-chip microcomputer MCU. The voltage stabilization circuit is respectively connected to the relay drive circuit, the CAN communication circuit, and the single-chip microcomputer MCU, and the single-chip microcomputer MCU is respectively connected to the relay drive circuit and the CAN communication circuit; the pluggable relay control board card has the advantages of simple structure, high cost performance, convenient operation, and universal applicability; however, this solution lacks networking and remote control capabilities, and in the context of the development of the industrial Internet of Things, it cannot meet the requirements of remote monitoring and mobile terminal control; in addition, this system adopts a pluggable design, and the system architecture is relatively closed, making it difficult to integrate or expand with other types of control systems, and it is insufficiently adaptable in complex industrial application scenarios; for this reason, we propose a one-to-many solenoid valve control system. Summary of the Invention
[0005] The purpose of the present invention is to provide a one-to-many solenoid valve control system to solve the problems raised in the above background technology.
[0006] To achieve the above purpose, the present invention provides the following technical solution: A one-to-many solenoid valve control system includes: a master device control board, a slave device control board, a control terminal, and a router;
[0007] The master device control board is composed of a single-chip microcomputer MCU, a voltage stabilization module, a CAN transceiver circuit, and a WiFi module;
[0008] The slave device control board is composed of a single-chip microcomputer MCU, a voltage stabilization module, a CAN transceiver circuit, and a relay control module.
[0009] Between the master device control board and multiple slave device control boards, relying on the CAN transceiver circuit and according to the CAN communication protocol, communication between the master device and multiple slave devices is achieved;
[0010] The master device control board forms a network through a certain slave device control board, and other slave devices automatically send network access requests to join the network established by the master device, and the master device dynamically allocates a network ID;
[0011] After the network is established, the master device can communicate with each slave device to access and control the relay status of the slave device control board;
[0012] The WiFi module of the master device can connect to a specified router and publish a setting page via the HTTP protocol based on the set mDNS service. A control terminal within the same local area network can subscribe to this page by accessing the set mDNS domain name, thereby realizing communication between the terminal and the control board of the master device. Subsequently, the control board of the master device controls the control boards of slave devices through the CAN communication protocol to achieve the control of relays.
[0013] Preferably, the WiFi module uses the ESP32-C3-WROOM-02 / 02U module to achieve network interaction of the WiFi protocol and build a Web server, and at the same time realizes interaction with the single-chip microcomputer MCU through asynchronous serial communication.
[0014] Preferably, the relay uses the SRD-05VDC-SL-C series power relay, which has three-terminal interfaces of NC, NO, and COM; each group of relays is equipped with an indicator light, and the indicator light lights up when the relay is energized; it is equipped with a load drive and a relay coil discharge circuit; each relay corresponds to a solenoid valve, and each slave device corresponds to 4 solenoid valve groups.
[0015] Preferably, the relay uses the CHINT 4V210-08 24V solenoid valve.
[0016] Preferably, the single-chip microcomputer MCU of the master and slave control boards uses the STC32G12K128 series single-chip microcomputer;
[0017] The slave device is onboard with 2 relay control buttons, 7 relay status indicator lights, and 1 single-chip microcomputer working indicator light;
[0018] The master device uses 4 control status indicator lights, 7 relay status indicator lights, 1 single-chip microcomputer working indicator light, and 4 control buttons;
[0019] The master device can display the on and off states of the relays of the controlled slave devices. At the same time, the master device can search for and select slave devices to send control instructions;
[0020] The slave device controls the solenoid valve in a direct control manner. When the slave device is in the ID indication state, the current slave ID number is indicated by the 7 relay status indicator lights on the slave device. If the single-chip microcomputer is working properly, the working indicator light flashes continuously. If the button KEY1 is pressed, the slave device enters the control mode. In this state, the button KEY1 selects the relay through shift operations. If the KEY2 is pressed, the state of the selected relay is toggled, thereby controlling the solenoid valve; if there is no operation within 5s, it automatically enters the ID indication state;
[0021] The master device controls the solenoid valve through an indirect control method, and this indirect control method is further divided into manual control and WiFi control;
[0022] If the manual control mode is adopted, control instructions are sent to the designated slave device through the buttons on the master device by means of the CAN communication protocol, and the slave device controls the solenoid valve controlled by the selected relay.
[0023] If it is the WiFi control mode, control instructions are sent to the host through the control terminal connected to the same local area network as the WiFi module of the master device, and the host conveys the instructions to the slave device through the CAN communication protocol to achieve WiFi control.
[0024] The control logic of the master device controlling the slave device is specifically as follows:
[0025] The four control status indicator lights are T, F, C, and E respectively, where T indicates successful search, F indicates failed search, C indicates the control status, E flashing indicates searching for the slave device, and E being constantly on indicates the search is completed; the four buttons are KEY0, KEY1, KEY2, and KEY3.
[0026] In the default state of the master device, only the single-chip microcomputer working indicator light works. When the button KEY0 or KEY1 is pressed, the master device will enter the slave device ID selection state. In this state, if KEY0 is pressed, the selected slave device ID increases, if KEY1 is pressed, the selected slave device ID decreases, if KEY2 is pressed, the selected slave device ID is determined and it turns to the target slave device search state, and at the same time, the blue indicator light labeled "E" among the control status indicator lights starts to flash; after a period of time, if the target slave device can be found in the network, the blue indicator light labeled "E" being constantly on indicates the search is completed, the green indicator light labeled "T" being constantly on indicates the selected slave device is found, and at the same time, the 7 relay status indicator lights indicate the relay switch status of the target slave device; if KEY2 is pressed in this state, it will enter the relay control state of this slave device, and if KEY3 is pressed, it will return to the slave device ID selection state.
[0027] If it enters the relay control state, the indicator light labeled "C" is constantly on. At this time, the button KEY0 is used to select the relay through shift operation, and the indicator lights labeled "T" or "F" indicate the relay switch status of the target slave device. "T" indicates that the current relay is in the on state, and "F" indicates that the current relay is in the off state; clicking KEY1 toggles the status of the selected relay. If KEY2 is pressed again, the previously set relay switch status is configured to the target slave device, that is, the control instruction is sent to the corresponding slave device to control the solenoid valve.
[0028] If the target slave device cannot be found in the network, the blue LED indicator light labeled "E" is constantly on, the red indicator light labeled "F" is constantly on, and the relay status indicator lights flash slowly; in this state, pressing KEY2 has no response, and pressing KEY3 will return to the slave device ID selection state.
[0029] For the WiFi control method, the ESP32 module on the single-chip microcomputer is configured as the STA mode using the WiFi protocol, joins the set WiFi network, and publishes the set control page through the mDNS service and the HTTP protocol; at this time, other Internet-connected devices within the network access the control page by accessing the host name.local of the mDNS, set the control parameters through the control page, and send them to the main device single-chip microcomputer. The control parameters are the same as those in the manual control method and are transmitted to the corresponding solenoid valve of the slave device to achieve WiFi control.
[0030] Preferably, the voltage stabilization module uses an LM2596S-5.0 step-down voltage regulator to stabilize the input voltage of the power supply DC24V to DC5V;
[0031] The voltage stabilization part integrates multiple protection mechanisms. One is to connect a self-recovery fuse with a rated current of 500mA at the power input end, which can effectively resist instantaneous overcurrent impact and play a role in short-circuit protection; the other is to use an SS54 Schottky diode to construct a reverse voltage protection circuit, which can quickly short-circuit VIN and GND when the external power supply is reversely connected, playing a role in protecting the subsequent circuit.
[0032] Preferably, the CAN transceiver circuit uses a TJA1050T CAN transceiver, the communication rate is set to 50Kbps, the theoretical transmission distance can reach 1000 meters, and the TJA1050T / CM transceiver itself supports up to 110 nodes.
[0033] Preferably, the sizes of the main and slave device control boards are 85×76mm.
[0034] Compared with the prior art, the beneficial effects of the present invention are:
[0035] The present invention can realize the intelligent remote control of the solenoid valve, and achieve flexible configuration and multi-device management in combination with the Internet of Things technology; compared with the patent CN111918787A, the present invention does not rely on the control unit of a specific device, adopts an independent master-slave architecture design, and has stronger versatility and stability;
[0036] Compared with the patent CN111918787A, the limitations of system closure and poor scalability are avoided. The present invention realizes remote control through the WiFi protocol and the Web interface, meeting the development needs of the industrial Internet of Things; through the wide-voltage power supply method and the reliable CAN communication mechanism, the system failure rate is reduced, the control efficiency is improved, and the reliability and safety of industrial control such as sewage discharge are ensured. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] As Figure 1 shown is the structure diagram of the control system of the present invention;
[0038] AsFigure 2 The following is the control flow chart of the slave device of the present invention;
[0039] As shown in Figure 3 the following is the control flow chart of the master device of the present invention;
[0040] As shown in Figure 4 the following is the relay control circuit diagram of the present invention;
[0041] As shown in Figure 5 the following is the circuit diagram of the voltage stabilizing module of the present invention;
[0042] As shown in Figure 6 the following is the CAN transceiver circuit diagram of the present invention.
[0043] Symbol description: Figure 4 CON1 in represents the control pin for the MCU to control the corresponding relay No. 1, Figure 6 in CAN_TX and CAN_RX respectively represent the CAN communication pins of the MCU, and CANH and CANL respectively represent the high and low level lines of the CAN communication bus. Specific embodiments
[0044] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying 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. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0045] Embodiment 1
[0046] Please refer to Figures 1-6 , the present invention provides a one-to-many solenoid valve control system, including: a master device control board, a slave device control board, a control terminal, and a router;
[0047] The master device control board is composed of a single-chip microcomputer MCU, a voltage stabilizing module, a CAN transceiver circuit, and a WiFi module. The slave device control board is composed of a single-chip microcomputer MCU, a voltage stabilizing module, a CAN transceiver circuit, and a relay control module; the master device of the control system can control the relays of multiple slave devices to work, and the master device can achieve WiFi communication with the control terminal and can be indirectly controlled through the terminal;
[0048] Between the master device control board and multiple slave device control boards, communication between the master device and multiple slave devices is achieved through the CAN transceiver circuit using the CAN communication protocol; the master device control board forms a network through a certain slave device control board, and other slave devices automatically send network access requests to join the network established by the master device. At the same time, the network ID dynamically allocated by the master device is used to establish the network, and after the network is established, the master device can communicate with each slave device to access and control the relay status of the slave device control board;
[0049] The WiFi module of the master device can connect to a specified router and publish a setting page through the HTTP protocol according to the set mDNS service. Subsequently, the control terminal within the same local area network can access the set mDNS domain name to subscribe to the page, realizing communication between the terminal and the master device control board. Subsequently, the master device control board controls each slave device control board through the CAN communication protocol to achieve relay control;
[0050] The WiFi module uses the ESP32-C3-WROOM-02 / 02U module to achieve network interaction of the WiFi protocol and build a Web server, and at the same time realizes interaction with the single-chip microcomputer MCU through the asynchronous serial communication method;
[0051] The relay uses the SRD-05V DC-SL-C series power relay, which has three-terminal interfaces of NC, NO, and COM. Each group of relays is equipped with an indicator light. When the relay is energized, the indicator light is on. It also has a load drive and a relay coil discharge circuit. Each relay corresponds to a solenoid valve, and each slave device corresponds to 4 solenoid valve groups;
[0052] The relay uses the CHINT 4V210-08 24V solenoid valve;
[0053] The single-chip microcomputer MCU of the master and slave control boards uses the STC32 G12K128 series single-chip microcomputer. The slave device board has 2 relay control buttons, 7 relay status indicator lights, and 1 single-chip microcomputer working indicator light, while the master device uses 4 control status indicator lights, 7 relay status indicator lights, 1 single-chip microcomputer working indicator light, and 4 control buttons. Thus, the master device can display the on and off states of the relays of the controlled slave devices, and at the same time, the master device can search for and select slave devices to send control instructions;
[0054] The slave device controls the solenoid valve using a direct control method as shown in Figure 2, when the slave device is in the ID indication state (idle state), the current slave ID number is indicated by 7 relay status indicator lights on the slave device. If the single-chip microcomputer is working properly, the working indicator light will keep flashing. If the button KEY1 is pressed, the slave device will enter the control mode. In this state, the button KEY1 selects the relay through a shift operation. If the KEY2 is pressed, the state of the selected relay will be toggled, thereby controlling the solenoid valve. If there is no operation within 5 seconds, it will automatically enter the ID indication state;
[0055] The master device controls the solenoid valve through an indirect control method, and this indirect control method is further divided into manual control and WiFi control;
[0056] If the manual control method is adopted, the button on the master device is used to send control instructions to the specified slave through the CAN communication protocol, and the slave controls the solenoid valve controlled by the selected relay. If it is the WiFi control method, the control instructions are sent to the host by the control terminal (such as a mobile phone and other Internet devices) connected to the same local area network as the WiFi module of the master device, and the host conveys the instructions to the slave through the CAN communication protocol to achieve WiFi control;
[0057] The control logic of the master device controlling the slave device is shown in Figure 3 , specifically:
[0058] The four control status indicator lights are T, F, C, and E respectively. Among them, T indicates successful search, F indicates failed search, C indicates control status, and E flashing indicates searching for slaves, and constant lighting indicates search completion; the four buttons are KEY0, KEY1, KEY2, and KEY3;
[0059] In the default state of the master device, only the single-chip microcomputer working indicator light is working. When the button KEY0 or KEY1 is pressed, the master device will enter the slave ID selection state; in this state, if KEY0 is pressed, the selected slave ID +, if KEY1 is pressed, the selected slave ID -, if KEY2 is pressed, the selected slave ID is confirmed and the target slave search state is entered, and at the same time, the blue indicator light labeled "E" among the control status indicator lights starts to flash; after a period of time, if the target slave can be found in the network, the blue indicator light labeled "E" will be constantly lit to indicate search completion, and the green indicator light labeled "T" will be constantly lit to indicate that the selected slave has been found. At the same time, the 7 relay status indicator lights indicate the relay switch state of the target slave; if KEY2 is pressed in this state, it will enter the relay control state of this slave, and if KEY3 is pressed, it will return to the slave ID selection state;
[0060] After entering the relay control state, the indicator light labeled "C" is always on. At this time, the key KEY0 is used to select the relay through a shift operation. The indicator lights labeled "T" or "F" indicate the corresponding relay switch state of the target slave. "T" means the current relay is in the on state, and "F" means the current relay is in the off state; clicking KEY1 toggles the state of the selected relay. If KEY2 is pressed again, the previously set relay switch state is configured to the target slave, that is, the control instruction is sent to the corresponding slave to control the solenoid valve.
[0061] If the target slave cannot be found in the network, the blue LED indicator light labeled "E" is always on, the red indicator light labeled "F" is always on, and the labeled relay status indicator light flashes slowly; in this state, pressing KEY2 has no response, and pressing KEY3 will return to the slave ID selection state.
[0062] For the WiFi control method, the ESP32 module on the single-chip microcomputer is configured as the STA mode using the WiFi protocol and joins the set WiFi network. At the same time, the set control page is published through the mDNS service and the HTTP protocol; at this time, other Internet devices in the network access the control page by accessing the hostname.local of the mDNS. The control parameters are set through the control page and sent to the main device single-chip microcomputer. The control parameters are the same as those in the manual control method and are transmitted to the corresponding solenoid valve of the slave device to achieve WiFi control.
[0063] The voltage stabilization module uses the LM2596 S-5.0 buck voltage regulator to stabilize the input voltage of the power supply DC24V to DC5V; at the same time, multiple protection mechanisms are integrated in the voltage stabilization part. One is to connect a self-recovery fuse with a rated current of 500mA at the power input end, which can effectively resist instantaneous overcurrent impact and play a role in short-circuit protection; the other is to use the SS54 Schottky diode to construct a reverse voltage protection circuit, which can quickly short-circuit VIN and GND when the external power supply is reversely connected, playing a role in protecting the subsequent circuit.
[0064] The CAN transceiver circuit uses the TJA 1050T CAN transceiver, and the communication rate is set to 50Kbps. The theoretical transmission distance can reach 1000 meters, and the TJA1050T / CM transceiver itself supports up to 110 nodes.
[0065] The sizes of the master and slave device control boards are 85×76mm.
[0066] Embodiment 2
[0067] For the control test of the present invention, the patent applicant made the master and slave device control boards by himself and built a test system. The experiment conducted a control experiment on six solenoid valves as follows:
[0068] In the experiment, pressFigure 1 After the wiring is completed and the network is debugged and connected, the control system works normally in a predetermined manner. The relay is controlled to start and stop by the slave device control board to control the solenoid valve. After the start button is pressed, the control device performs the solenoid valve switching operation at a preset time interval. Respectively, the relay state is controlled through the slave device control board, the master device controls the slave device, the transmission relay control command, and the terminal communicates with the master device to transmit the control command to the master device and then transmit the control command to the slave device, and so on in a cycle. After a stability test lasting up to 10 hours and nearly 10,000 times, the operation of the control device is smooth, basically meeting the control effect of the expected design. However, during the control process, it is found that the connection between the master and slave devices through wires is limited by the transmission distance, resulting in a large amount of wire and a lot of effort required for wiring maintenance. This means that the current device cannot achieve fully intelligent communication during the control process and there are limitations. The limitation problem needs to be further solved to ensure the efficiency and sustainability of the control system;
[0069] Specific application scenario of the embodiment - automatic sewage discharge of land-based circular ponds:
[0070] With the rapid development of the aquaculture industry, the demand for automatic control and centralized management is increasing day by day. The land-based circular pond aquaculture technology is the most rapidly developed aquaculture technology model in China in recent years. The diameter of land-based circular ponds is mostly 6 - 12 meters, and the bottom is a conical surface with a slope of 5 - 12 degrees. In the land-based circular pond aquaculture system, sewage discharge is a very important task. If the sewage is not discharged in time and thoroughly, the water quality will deteriorate rapidly, resulting in the death of cultured fish. The traditional manual sewage discharge method by pulling out pipes is time-consuming and laborious. A culture pond requires at least 3 sewage discharge operations per day, and each operation takes about 6 minutes. In a modern aquaculture base with dozens or even hundreds of culture ponds, this method not only occupies a large amount of human resources, but also is difficult to ensure the timeliness and regularity of sewage discharge, lacks remote control and networking functions, and cannot meet the needs of centralized management. In a modern aquaculture base, it is often necessary for a control center to manage and control multiple sewage valves at the same time. And currently, the sewage control systems on the market mainly adopt a one-to-one control mode, and each sewage valve needs to be equipped with an independent control unit, with a complex system structure and high cost. A one-to-many solenoid valve control system described in the present invention, each solenoid valve controls the sewage pipe of a circular pond. The designed slave device control board can control four solenoid valves at a time. After adding a time relay, it can realize the timed opening and closing of the solenoid valve and thus realize timed sewage discharge. With the assistance of WiFi control and manual control methods, it can automatically or manually control the specified sewage valve to discharge sewage and realize the automation function of sewage discharge.
[0071] Although embodiments of the present invention have been shown and described, those of ordinary skill in the art will appreciate that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A one-to-many solenoid valve control system, comprising: The master device control board, slave device control board, control terminal, and router are characterized by: The main device control board is composed of a single-chip microcomputer MCU, a voltage stabilization module, a CAN transceiver circuit and a WiFi module; The slave device control board is composed of a single-chip microcomputer MCU, a voltage stabilization module, a CAN transceiver circuit and a relay control module; The master device control board and the multiple slave device control boards communicate with each other through a CAN transceiver circuit according to the CAN communication protocol; The control board of the master device is networked through a control board of a slave device. Other slave devices automatically send network access requests to join the network established by the master device. The network ID is dynamically allocated by the master device. After the network is established, the master device can communicate with each slave device to access and control the relay status of the slave device control board; The WiFi module of the master device can connect to a designated router and publish a setting page through the HTTP protocol based on the set mDNS service; the control terminal in the same local area network can subscribe to the page by accessing the set mDNS domain name, thereby realizing communication between the terminal and the master device control board, and then the master device control board controls each slave device control board through the CAN communication protocol to realize the control of the relay.
2. A one-to-many solenoid valve control system according to claim 1, characterized in that: The WiFi module adopts the ESP32-C3-WROOM-02 / 02U module to realize network interaction of the WiFi protocol and build a Web server, and at the same time interact with the microcontroller MCU through asynchronous serial communication.
3. The one-to-many solenoid valve control system according to claim 1, characterized in that: The relay adopts SRD-05VDC-SL-C series power relay, which has NC, NO, and COM three-terminal interfaces; each group of relays is equipped with an indicator light, which lights up when the relay is energized; it is equipped with a load drive and relay coil discharge circuit; each relay corresponds to a solenoid valve, and each slave device corresponds to 4 solenoid valve groups.
4. The one-to-many solenoid valve control system according to claim 3, characterized in that: The relay adopts CHINT 4V210-0824V solenoid valve.
5. The one-to-many solenoid valve control system according to claim 1, characterized in that: The MCU of the master-slave control board adopts the STC32G12K128 series MCU; The slave device has 2 relay control buttons, 7 relay status indicators and 1 MCU working indicator onboard; The main device uses 4 control status indicators, 7 relay status indicators, 1 microcontroller working indicator and 4 control buttons; The master device can display the open and closed status of the relay of the controlled slave device, and can search and select the slave device to send control instructions; The slave device controls the solenoid valve in direct control mode. When the slave device is in the ID indication state, the 7 relay status indicators on the slave device indicate the current slave ID number. If the single-chip microcomputer works normally, the working indicator light flashes continuously. If the key KEY1 is pressed, the slave device enters the control mode. In this state, the key KEY1 selects the relay through the shift operation. If KEY2 is pressed, the state of the selected relay is flipped to control the solenoid valve. If there is no operation within 5s, it automatically enters the ID indication state. The main device controls the solenoid valve through indirect control, which is divided into manual control and WiFi control; If manual control is adopted, the control command is sent to the designated slave by manually controlling the buttons on the master device through the CAN communication protocol, and the slave controls the solenoid valve controlled by the selected relay; If the WiFi control method is adopted, the control terminal connected to the same local area network as the WiFi module of the master device sends the control command to the host, and the host transmits the command to the slave through the CAN communication protocol to realize WiFi control; The control logic of the master device controlling the slave device is as follows: The four control status indicators are T, F, C, and E. T indicates a successful search, F indicates a failed search, C indicates the control status, E flashes to indicate the slave is being searched, and stays on to indicate the search is complete. The four buttons are KEY0, KEY1, KEY2, and KEY3. In the default state, only the microcontroller working indicator of the master device works. When the key KEY0 or KEY1 is pressed, the master device will enter the slave ID selection state. In this state, if KEY0 is pressed, the selected slave ID+ is selected, if KEY1 is pressed, the selected slave ID- is selected, if KEY2 is pressed, the selected slave ID is confirmed and the target slave search state is switched. At the same time, the blue indicator labeled "E" in the control status indicator starts flashing; after a period of time, if the target slave can be found in the network, the blue indicator labeled "E" is always on to indicate that the search is complete, and the green indicator labeled "T" is always on to indicate that the selected slave is found. At the same time, the 7 relay status indicators indicate the relay switch status of the target slave; in this state, if KEY2 is pressed, the relay control state of the slave is entered, and pressing KEY3 returns to the slave ID selection state; If the indicator light labeled "C" is always on after entering the relay control state, the button KEY0 is used to select the relay through the shift operation, and the indicator light labeled "T" or "F" indicates the switch state of the corresponding relay of the target slave. "T" means that the current relay is in the on state, and "F" means that the current relay is in the off state. Click KEY1 to flip the selected relay state. If KEY2 is pressed again, the previously set relay switch state is configured on the target slave, that is, the control instruction is sent to the corresponding slave to control the solenoid valve. If the target slave cannot be found in the network, the blue LED indicator labeled "E" is always on, the red indicator labeled "F" is always on, and the relay status indicator flashes slowly; in this state, pressing KEY2 has no response, and pressing KEY3 will return to the slave ID selection state; The WiFi control method is that the ESP32 module on the microcontroller uses the WiFi protocol to configure the STA mode, joins the set WiFi network, and publishes the set control page through the mDNS service and HTTP protocol; at this time, other Internet devices in the network access the control page by accessing the mDNS host name.local, set the control parameters through the control page, and send them to the master device microcontroller. The control parameters are the same as the manual control method and are transmitted to the corresponding solenoid valve of the slave device to realize WiFi control.
6. The one-to-many solenoid valve control system according to claim 1, characterized in that: The voltage stabilization module uses LM2596S-5.0 step-down regulator to stabilize the input voltage of the power supply DC24V to DC5V; The voltage stabilization part integrates multiple protection mechanisms. First, a self-recovery fuse with a rated current of 500mA is connected to the power input end, which can effectively resist instantaneous over-current impact and play a role in short-circuit protection; second, the SS54 Schottky diode is used to construct a reverse voltage protection circuit. When the external power supply is reversed, it can quickly short-circuit VIN and GND to protect the subsequent circuit.
7. The one-to-many solenoid valve control system according to claim 1, characterized in that: The CAN transceiver circuit adopts the TJA1050T CAN transceiver, the communication rate is set to 50Kbps, the theoretical transmission distance can reach 1000 meters, and the TJA1050T / CM transceiver itself supports up to 110 nodes.
8. The one-to-many solenoid valve control system according to claim 1, characterized in that: The size of the master and slave device control board is 85×76mm.
Citation Information
Patent Citations
System and method for controlling relay using flip-flop
CN111918787A
Automatic excrement discharge system for circulating water fishpond
CN219844619U