Intelligent household remote switch control system based on MCU
By using MCU-controlled dual-channel current and voltage acquisition and intelligent algorithms, the operation results of smart home remote switches are monitored in real time, solving the problem of lack of real-time detection and anomaly handling in existing technologies, improving the safety and reliability of the system, and providing fault recording function.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-24
- Publication Date
- 2026-03-24
AI Technical Summary
Existing smart home remote switch control systems lack real-time detection and anomaly handling mechanisms for the actual effect of switch operation, leading to safety hazards and equipment damage.
Employing a dual-channel current and voltage acquisition and intelligent control algorithm based on an MCU, the system monitors the switching operation results in real time, identifies anomalies through transient and steady-state characteristic values, and triggers adaptive retry and lockout protection mechanisms.
It enables automatic verification and anomaly handling of switch operations, improves electrical safety and reliability, extends equipment life, and provides event logging and traceability functions.
Smart Images

Figure CN121722016A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart home control technology, and in particular to a smart home remote switch control system based on an MCU. Background Technology
[0002] Currently, most smart home remote switch control systems on the market focus on remote and linkage control functions, only performing one-way control operations on the switches themselves, lacking feedback monitoring of actual execution results and electrical status.
[0003] Furthermore, existing technologies generally lack mechanisms for real-time verification of voltage and current data and automatic response to anomalies during switching operations. When relays or other switching actuators malfunction (e.g., contacts not closing or sticking together) or when load abnormalities occur (e.g., short circuits or open circuits), traditional smart switches often fail to detect or take immediate action, potentially leading to safety hazards or equipment damage. Therefore, there is an urgent need for a switch control system that enables remote control while comprehensively detecting and verifying the actual effect of each switching operation, and promptly taking retry, protection, and recording measures in abnormal situations. Summary of the Invention
[0004] The purpose of this invention is to provide a smart home remote switch control system based on an MCU. Through dual-channel current and voltage acquisition and intelligent control algorithms, it can realize real-time verification and anomaly handling of the results of each remote switch operation, thereby improving the safety and reliability of smart home power control.
[0005] To achieve the above objectives, the following technical solution is adopted: A smart home remote switch control system based on an MCU includes an MCU control module, and a switch actuator, a current acquisition module, a voltage acquisition module, and a remote communication interface, all connected to the MCU control module. The switch actuator is used to connect or disconnect the AC power supply circuit containing the controlled load. The current acquisition module and the voltage acquisition module are used to acquire the current and voltage signals of the AC power supply circuit, respectively. The MCU control module monitors the AC power supply circuit controlled by the switch actuator in real time through the current and voltage acquisition modules, and acquires the current and voltage signals within a complete AC cycle synchronized with the grid voltage zero point during each switch operation. The module is also used to extract transient and steady-state characteristic values of the current and voltage signals collected within the cycle, and to determine whether there is an inconsistency in the switching operation results based on the extracted characteristic values and to determine the cause of the inconsistency. When an inconsistency is determined, the MCU control module triggers an adaptive retry operation. If an inconsistency is still detected after the retry, a lockout protection mechanism is executed. The MCU control module also records the key data and determination results of each switching operation in the event traceability chain. The remote communication interface is configured to receive the switch on / off control command sent by the remote terminal and transmit the control command to the MCU control module, and is also configured to send the event traceability chain data generated by the MCU control module to the remote terminal.
[0006] Preferably, the current acquisition module includes a current sensor connected in series in the AC power supply circuit for acquiring the circuit current signal controlled by the switch actuator; the voltage acquisition module includes a voltage sensor connected in parallel across the two ends of the AC power supply circuit for acquiring the voltage signal of the circuit.
[0007] Preferably, the MCU control module can detect the voltage zero-crossing point in the AC power supply circuit and use the zero-crossing point as the starting reference for data acquisition, sampling voltage and current data for at least one AC cycle starting from the zero-crossing point each time the switch actuator is activated. Preferably, the transient characteristic value includes the current peak detected within the first half-cycle after the switch actuator is activated, and the steady-state characteristic value includes the effective value of the current within the complete AC cycle.
[0008] Preferably, the MCU control module determines that there is an inconsistency in the switching operation results if any of the following conditions are met: 1) When the target operation is to be turned on, the effective value of the current in the complete AC cycle is lower than the preset minimum load current threshold. 2) When the target operation is disconnected, the effective value of the current during the complete AC cycle exceeds the leakage current threshold; 3) When the target operation is to be turned on, the peak current during the complete AC cycle exceeds the safe current threshold.
[0009] Preferably, the MCU control module determines the corresponding fault attribution based on the determined inconsistency conditions. The fault attribution includes at least one of the following: load not connected or the switch actuator not closing properly, the switch actuator contacts sticking together, and load overload or short circuit.
[0010] Preferably, the adaptive one-time retry operation includes: when an inconsistency is detected, the MCU control module re-executes the action of the switch actuator after a preset delay, wherein the preset delay is adjusted according to the type of inconsistency and the current AC phase to synchronize the retry action with the AC voltage zero crossing point as much as possible; if the inconsistency disappears after the retry, the abnormal state is lifted; otherwise, the lockout protection mechanism is executed while maintaining the abnormal indication.
[0011] Preferably, the locking protection mechanism includes: when an inconsistency is still detected after the retry execution, the MCU control module prohibits subsequent operation commands to the switch actuator and generates a fault alarm signal or reports the fault status to a remote terminal.
[0012] Preferably, the event record traceability chain includes a non-volatile memory for storing event records of each switching operation in chronological order. Each event record includes at least the operation time, the target switching state command, the transient and steady-state characteristic values, the judgment result, the fault attribution, and the retry and locking operation information.
[0013] By adopting the above solution, the beneficial effects of the present invention are: 1) Automatic verification of switch operation results: Through dual-channel current and voltage acquisition and monitoring, the system can obtain actual electrical response data after each remote switch command is executed, realizing automatic verification of whether the switch action is successful or not, avoiding misjudgment that may occur based solely on the assumed state of the command.
[0014] 2) Timely Anomaly Detection and Handling: By combining transient and steady-state characteristics, the system can detect abnormal surges and arcing at the moment of power-on, as well as abnormal current loss (open circuit) and overload in steady state. Once an inconsistency in execution results is detected, the system will autonomously identify the cause of the fault and immediately perform an automatic retry; if the fault is not resolved, it will lock and stop subsequent operations and issue an alarm, intervening in the early stages of the fault to ensure electrical safety.
[0015] 3) Improve operational reliability and lifespan: The one-time adaptive retry mechanism can correct switching failures caused by environmental interference or occasional poor contact, thereby improving the success rate of remote control command execution. At the same time, synchronizing the retry action with the AC zero-crossing point reduces inrush current impact and arc generation, reduces stress and wear on switching devices, improves system reliability, and extends device lifespan.
[0016] 4) Traceable Event Records: The system establishes a complete event record traceability chain, storing detailed parameters and processing procedures for each switch operation. Users or maintenance personnel can query historical records through a remote communication interface to understand the operating status of the switch and load and the causes of failures, providing a basis for troubleshooting and system optimization. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the system structure of the present invention; Figure 2 This is a system functional block diagram of the present invention; Figure 3 This is a flowchart of the remote switch control and verification process of the present invention; Figure 4 This is a schematic diagram of the voltage zero-crossing point alignment sampling period of the present invention. Detailed Implementation
[0018] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0019] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of the second feature includes the first feature directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature includes the first feature directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.
[0020] In the description of this embodiment, the terms "upper," "lower," "left," and "right," etc., refer to the orientation or positional relationship shown in the accompanying drawings. They are used only for ease of description and simplification of operation, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the present invention. In addition, the terms "first" and "second" are used only for distinction in description and have no special meaning.
[0021] Reference Figures 1 to 4 As shown, this invention provides a smart home remote switch control system based on an MCU, including an MCU control module, and a switch actuator, a current acquisition module, a voltage acquisition module, and a remote communication interface, all connected to the MCU control module. The switch actuator is used to connect or disconnect the AC power supply circuit where the controlled load is located. The current acquisition module and the voltage acquisition module are used to acquire the current signal and voltage signal of the AC power supply circuit, respectively. The MCU control module is used to monitor the AC power supply circuit controlled by the switch actuator in real time through the current acquisition module and the voltage acquisition module, and to acquire the current and voltage signals within a complete AC cycle synchronized with the zero point of the power grid voltage during each switch operation.
[0022] The MCU control module is also used to extract transient and steady-state characteristic values from the current and voltage signals acquired within the cycle, and to determine whether there is inconsistency in the switching operation results and the cause of the inconsistency based on the extracted characteristic values. The transient characteristic value includes the current peak value detected in the first half-cycle after the switch actuator operates, and the steady-state characteristic value includes the effective value of the current within the complete AC cycle. The MCU control module determines the corresponding fault attribution based on the determined inconsistency conditions, and the fault attribution includes at least one of the following: load not connected or the switch actuator not closing properly, switch actuator contacts sticking, and load overload or short circuit.
[0023] When an inconsistency is detected, the MCU control module triggers an adaptive retry operation. If the inconsistency is still detected after the retry, a lockout protection mechanism is executed. The adaptive one-time retry operation includes: when an inconsistency is detected, the MCU control module re-executes the action of the switch actuator after a preset delay, wherein the preset delay is adjusted according to the type of inconsistency and the current AC phase to synchronize the retry action with the AC voltage zero-crossing point as much as possible; if the inconsistency disappears after the retry, the abnormal state is lifted; otherwise, the lockout protection mechanism is executed while maintaining the abnormal indication. The lockout protection mechanism includes: when an inconsistency is still detected after the retry, the MCU control module prohibits subsequent operation commands to the switch actuator and generates a fault alarm signal or reports the fault status to a remote terminal.
[0024] The MCU control module also records key data and judgment results of each switching operation in the event traceability chain. The event record traceability chain includes a non-volatile memory for storing event records of each switching operation in chronological order. Each event record includes at least the operation time, target switching state command, transient and steady-state characteristic values, judgment result, fault attribution, and retry and locking operation information.
[0025] The remote communication interface is configured to receive on / off control commands sent by a remote terminal and transmit the control commands to the MCU control module, and is also configured to send event trace chain data generated by the MCU control module to the remote terminal.
[0026] The current acquisition module includes a current sensor connected in series in the AC power supply circuit for acquiring the circuit current signal controlled by the switch actuator; the voltage acquisition module includes a voltage sensor connected in parallel across the two ends of the AC power supply circuit for acquiring the voltage signal of the circuit.
[0027] The MCU control module can detect the voltage zero-crossing point in the AC power supply circuit and use the zero-crossing point as the starting reference for data acquisition. It samples voltage and current data for at least one AC cycle starting from the zero-crossing point each time the switch actuator is activated. This invention provides a smart home remote switch control system based on an MCU. The MCU control module uses a dual-channel current and voltage acquisition mechanism to monitor the AC power supply circuit controlled by the switch actuator in real time during each switch operation. After detecting the AC voltage zero crossing, it begins acquiring voltage and current data for a complete cycle and extracts transient and steady-state characteristic values. Based on these characteristic values, the MCU control module determines whether the actual state of the switch operation is consistent with the target command. If an inconsistency is detected, it identifies possible fault causes and triggers an adaptive retry operation. If the fault is not eliminated after the retry, it executes a lockout protection to prohibit further switch operations. Simultaneously, the system records key parameters of each switch event (including characteristic values, judgment results, fault categories, etc.) in an event traceability chain for future query and analysis.
[0028] In one specific embodiment, the MCU control module of this switch control system uses an STM32 series microcontroller, the switch actuator is a relay, the current acquisition module is a Hall current sensor or a sampling resistor, and the voltage acquisition module is a voltage divider measurement circuit or a voltage sensor. Additionally, it includes a wireless module (such as a Wi-Fi or ZigBee module) for remote communication. The MCU control module controls the on / off state of the relay coil through a drive circuit, thereby controlling the supply or disconnection of AC mains power to the external load. The current sensor is installed in the series branch of the load circuit to convert the load current into a signal that the MCU control module can acquire; the voltage sensor is connected in parallel across the load circuit to measure the AC voltage. The analog-to-digital converter unit of the MCU control module reads the outputs of the current and voltage sensors at a sufficiently high sampling rate.
[0029] The software algorithm of this invention enables it to monitor and determine electrical parameters each time a remote control command is issued and executed. Its working process includes the following steps: 1) Remote Command Reception and Execution: When a user sends a switch on / off command via a remote terminal (e.g., a mobile app or central controller), the remote communication interface receives the command and transmits it to the MCU control module. The MCU control module controls the switch actuator according to the command requirements: for an on command, it drives the switch actuator to close the contacts to connect the circuit; for an off command, it controls the switch actuator to release the contacts to disconnect the circuit.
[0030] 2) Synchronous Acquisition of AC Signals: While controlling the switch actuator, the MCU control module simultaneously initiates monitoring of the AC power supply circuit's voltage and current signals, acquiring sampled data through the voltage and current acquisition modules respectively. To obtain standard periodic data, the MCU control module detects the zero-crossing point of the AC power supply voltage; after detecting the zero-crossing point (i.e., v(t) = 0) at time t0, it samples the voltage and current signals within a complete cycle T starting from time t0. In a typical 50Hz AC environment, T = 20ms. The voltage signal can be represented as a sine function: v(t) = V p sin(2πft) Among them, V p The voltage peak value is given by f = 50Hz, and the zero-crossing point corresponds to v(t0) = 0. The MCU control module samples the voltage and current multiple times within the interval from t0 to t0+T at a fixed sampling interval, obtaining a discrete sample sequence {v n} and {i n (where n=1,2,…,N, and N is the total number of sampling points in the period), the sampling data will be used for subsequent feature calculations.
[0031] 3) Transient and Steady-State Feature Extraction: The MCU control module calculates the transient and steady-state characteristic values of the current based on the acquired waveform data for one cycle. The transient characteristic value can be selected as the peak current detected within that cycle.
[0032] This value reflects the maximum current (e.g., inrush current) at the instant the switch is turned on. The steady-state characteristic value can be represented by the effective value of the current, I. rms The calculation formula is as follows:
[0033] Where i(t) is the instantaneous current that varies with time, i n This represents the current value sampled in the nth cycle. The calculated I... rms It reflects the magnitude of the steady-state current of the load during that cycle.
[0034] 4) Switching Operation Result Determination: The MCU control module compares the calculated characteristic value with a preset threshold to determine whether the switching action was executed normally. A minimum load current threshold I is preset in the MCU control module. min (Indicates the minimum current required for the load to operate normally), leakage current threshold I thr (Represents the maximum allowable residual current in the disconnected state) and the safe current threshold I max (The upper limit of current is set according to the switch actuator and load specifications).
[0035] For the connection operation, if I is measured rms min If I..., it indicates that the load may not be connected or the switch actuator may not have actually closed, and this is judged as an inconsistent state of "unsuccessful connection"; for disconnection operations, if I... rms >I thr This indicates that there is still abnormal current in the circuit after disconnection, which is determined to be an inconsistent state of "disconnection failure" caused by the sticking of the switch actuator contacts; in addition, when the target operation is to connect, if I is detected peak >I max If so, an overload or short-circuit fault is determined. See Table 1 below for a breakdown of inconsistencies and fault attributions:
[0036] Table 1 The above-described judgment process not only identifies whether there is an abnormality in the switch operation, but also corresponds to possible fault causes based on different conditions. For example, no current when connected corresponds to an open circuit in the load or a malfunction in the switch actuator; current when disconnected corresponds to sticking of the switch actuator contacts; and excessive current corresponds to a short circuit or severe overload in the load. The MCU control module stores the judgment results and preliminary attribution information in status variables for subsequent processing.
[0037] 5) Adaptive Retry: Upon detecting an inconsistent abnormal state, the MCU control module initiates an adaptive one-time retry mechanism. Specifically, if this is the first time an abnormality is detected for this instruction, the MCU control module re-executes the same switching instruction after a short delay (repeating step 1 above). This delay time is selected based on the type of abnormality and the current grid phase: when a failed connection is detected, the system waits until the next voltage zero-crossing moment before controlling the switch actuator to close, in order to reduce inrush current; when a failed disconnection is detected, the system performs the disconnection action again after the switch actuator has been released for a period of time to attempt disconnection. The retry process is executed only once. During the retry, the MCU control module continues to monitor electrical parameters through the current acquisition module and voltage acquisition module to determine whether the abnormality has been eliminated.
[0038] 6) Lockout Protection: If, after a retry operation, the MCU control module still detects an inconsistent abnormal state (no current after a retry to connect, or current still present after a retry to disconnect), the remote switch operation is deemed a failure and the fault persists. In this case, the MCU control module triggers a lockout protection measure: temporarily prohibiting subsequent control command input to the switch actuator (i.e., locking the switch state) and recording the fault lockout status. During the lockout period, the MCU control module sends a fault alarm message to the user terminal via the remote communication interface, reminding the user to conduct on-site inspection and repair. Once the fault is manually resolved and a reset command is received, the lockout status is released to restore normal operation.
[0039] 7) Event Logging and Traceability: During the above process, the MCU control module stores key events and parameters in real time into non-volatile memory, forming a traceable event chain. Each switching operation generates an event log, which includes a timestamp, the received target instruction (on / off), the action result of the switch actuator (success / failure), and the calculated I... rms with I peak The system records numerical values, the determined anomaly type and cause of the fault, whether a retry was performed and the result, and whether a lockout protection was triggered. Multiple event records are linked together in chronological order to form a historical record. Users can read the historical record through a remote communication interface to analyze the equipment's operating status and fault causes, providing a basis for maintenance and optimization.
[0040] The above are merely preferred embodiments of the present invention and are not intended to limit the invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention. Obviously, the above embodiments of the present invention are merely examples to clearly illustrate the present invention and are not intended to limit the implementation of the present invention. For those skilled in the art, various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A smart home remote switch control system based on an MCU, comprising an MCU control module, and a switch actuator, a current acquisition module, a voltage acquisition module, and a remote communication interface respectively connected to the MCU control module, characterized in that: The switch actuator is used to connect or disconnect the AC power supply circuit where the controlled load is located; The current acquisition module and the voltage acquisition module are used to acquire the current signal and voltage signal of the AC power supply circuit, respectively. The MCU control module is used to monitor the AC power supply circuit controlled by the switch actuator in real time through the current acquisition module and the voltage acquisition module, and to acquire the current and voltage signals within a complete AC cycle synchronized with the zero point of the grid voltage during each switch operation; The MCU control module is also used to extract transient and steady-state characteristic values of the current and voltage signals collected within the cycle, and to determine whether there is inconsistency in the switching operation results and the cause of the inconsistency based on the extracted characteristic values. When an inconsistency is detected, the MCU control module triggers an adaptive retry operation. If an inconsistency is still detected after the retry, a lockout protection mechanism is executed. The MCU control module also records the key data and judgment results of each switching operation in the event traceability chain; The remote communication interface is configured to receive on / off control commands sent by a remote terminal and transmit the control commands to the MCU control module, and is also configured to send event trace chain data generated by the MCU control module to the remote terminal.
2. The MCU-based smart home remote switch control system according to claim 1, characterized in that, The current acquisition module includes a current sensor connected in series in the AC power supply circuit, used to acquire the circuit current signal controlled by the switch actuator; The voltage acquisition module includes a voltage sensor connected in parallel across the two ends of the AC power supply circuit, used to acquire the voltage signal of the circuit.
3. The MCU-based smart home remote switch control system according to claim 1, characterized in that, The MCU control module can detect the voltage zero-crossing point in the AC power supply circuit and use the zero-crossing point as the starting reference for data acquisition. It samples voltage and current data for at least one AC cycle starting from the zero-crossing point each time the switch actuator is activated.
4. The MCU-based smart home remote switch control system according to claim 1, characterized in that, The transient characteristic value includes the current peak value detected within the first half-cycle after the switch actuator is activated, and the steady-state characteristic value includes the effective value of the current within the complete AC cycle.
5. The MCU-based smart home remote switch control system according to claim 1, characterized in that, The MCU control module determines that there is an inconsistency in the switching operation result if any of the following conditions are met: 1) When the target operation is to be turned on, the effective value of the current in the complete AC cycle is lower than the preset minimum load current threshold. 2) When the target operation is disconnected, the effective value of the current during the complete AC cycle exceeds the leakage current threshold; 3) When the target operation is to be turned on, the peak current during the complete AC cycle exceeds the safe current threshold.
6. The MCU-based smart home remote switch control system according to claim 5, characterized in that, The MCU control module determines the corresponding fault attribution based on the determined inconsistency conditions. The fault attribution includes at least one of the following: load not connected or the switch actuator not closing properly, the switch actuator contacts sticking together, and load overload or short circuit.
7. The MCU-based smart home remote switch control system according to claim 1, characterized in that, The adaptive one-time retry operation includes: When an inconsistency is detected, the MCU control module re-executes the action of the switch actuator after a preset delay. The preset delay is adjusted according to the type of inconsistency and the current AC phase to synchronize the retry action with the AC voltage zero crossing point as much as possible. If the inconsistency disappears after retrying, the abnormal state is lifted; otherwise, the locking protection mechanism is executed while maintaining the abnormal indication.
8. The MCU-based smart home remote switch control system according to claim 7, characterized in that, The locking protection mechanism includes: when an inconsistency is still detected after the retry execution, the MCU control module prohibits subsequent operation commands to the switch actuator and generates a fault alarm signal or reports the fault status to the remote terminal.
9. The MCU-based smart home remote switch control system according to claim 1, characterized in that, The event record traceability chain includes a non-volatile memory for storing event records of each switching operation in chronological order. Each event record includes at least the operation time, the target switching state command, the transient and steady-state characteristic values, the judgment result, the fault attribution, and the retry and locking operation information.