Knob control method, control device, storage medium and intelligent faucet
By using Hall effect sensors and magnetic angle sensors to detect user operations in smart faucets, contact wear is avoided, the problem of short knob life caused by mechanical structures is solved, and the long life of sensors and operational accuracy are achieved, thus extending the service life of the equipment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHU MIDEA KITCHEN & BATH APPLIANCES MFG CO LTD
- Filing Date
- 2024-12-09
- Publication Date
- 2026-06-09
Smart Images

Figure CN122170270A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of water purification devices, and more specifically, to a knob control method, control device, storage medium, and smart faucet. Background Technology
[0002] In related technical fields, mechanical structures are often used to detect the pressing and rotation of knobs. However, due to the limited lifespan of mechanical structures, the lifespan of knobs is relatively short, resulting in a short lifespan for smart faucets. Summary of the Invention
[0003] This application provides a knob control method, control device, storage medium, and smart faucet. The aim is to use a Hall sensor alone to detect user pressing operations on a moving part, and a magnetic angle sensor alone to detect user rotation operations on the moving part. This improves the accuracy of the Hall and magnetic angle detection signals acquired by the controller, thereby enhancing the accuracy of the smart faucet's response to user pressing and rotation operations. Furthermore, it avoids wear on the Hall and magnetic angle sensors, thus extending their service life and consequently, the lifespan of the smart faucet.
[0004] This application provides a knob control method for a smart faucet. The knob includes a fixed component and a moving component coaxially mounted. One of the fixed component and the moving component is provided with a magnetic component, and the other of the fixed component and the moving component is provided with a sensor group, which includes a Hall sensor and a magnetic angle sensor. The knob control method includes:
[0005] When a Hall detection signal is obtained from a Hall sensor, the movement parameters of the moving part being pressed or reset relative to the fixed part along the axial direction are obtained based on the Hall detection signal; when a magnetic angle detection signal is obtained from a magnetic angle sensor, the rotation parameters of the moving part rotating relative to the fixed part around the axial direction are obtained based on the magnetic angle detection signal.
[0006] The working state of the smart faucet is controlled based on at least one of the movement parameters and rotation parameters. The working state includes at least one of the following: water outlet switch, water temperature, and water flow rate.
[0007] In some embodiments, the step of obtaining the movement parameters of the moving part relative to the fixed part along the axial direction being pressed or reset based on the Hall detection signal includes:
[0008] The movement parameter is calculated based on the difference between the Hall detection signal and the first preset signal.
[0009] In some embodiments, after the step of calculating the movement parameter based on the difference between the Hall detection signal and the first preset signal, the method further includes:
[0010] If the absolute value of the movement parameter is greater than the first preset parameter, it is determined that the moving part has moved along the axial direction, and the movement distance is the absolute value of the movement parameter.
[0011] The direction of movement of the moving part along the axial direction is determined by the positive or negative value of the movement parameter.
[0012] In some embodiments, after the step of calculating the movement parameter based on the difference between the Hall detection signal and the first preset signal, the method further includes:
[0013] If the absolute value of the movement parameter is less than or equal to the first preset parameter, it is determined that the moving part has no axial movement.
[0014] In some embodiments, after the step of obtaining the movement parameters based on the Hall detection signal, the method further includes:
[0015] Set the value of the first preset signal to the value of the Hall detection signal.
[0016] In some embodiments, before the step of calculating the movement parameter based on the difference between the Hall detection signal and the first preset signal, the method further includes:
[0017] The first signal is obtained by sampling the signal output by the Hall sensor;
[0018] The Hall detection signal is obtained based on the first signal.
[0019] In some embodiments, the step of acquiring the Hall detection signal based on the first signal includes:
[0020] Add the first signal to the first first-in-first-out queue;
[0021] If the number of first signals in the first first-in-first-out queue meets the first preset number, then the first average value is calculated based on the first signals in the first first-in-first-out queue, and the first average value is the Hall detection signal.
[0022] In some embodiments, the step of obtaining the rotation parameters of the moving part relative to the fixed part about the axial direction based on the magnetic angle detection signal includes:
[0023] The rotation parameters are calculated based on the difference between the magnetic angle detection signal and the second preset signal.
[0024] In some embodiments, after the step of calculating the rotation parameters based on the difference between the magnetic angle detection signal and the second preset signal, the method further includes:
[0025] If the absolute value of the rotation parameter is greater than the second preset parameter, it is determined that the moving part has rotational motion around the axis, and the rotation angle is the absolute value of the rotation parameter.
[0026] The direction of rotation of a moving part around its axis is determined by the sign of the rotation parameters.
[0027] In some embodiments, after the step of calculating the rotation parameters based on the difference between the magnetic angle detection signal and the second preset signal, the method further includes:
[0028] If the absolute value of the rotation parameter is less than or equal to the second preset parameter, it is determined that the moving part has no rotational motion around the axial direction.
[0029] In some embodiments, after the step of obtaining rotation parameters based on magnetic angle detection signals, the method further includes:
[0030] Set the value of the second preset signal to the value of the magnetic angle detection signal.
[0031] In some embodiments, before the step of obtaining the rotation parameters of the moving part relative to the fixed part about the axial direction based on the magnetic angle detection signal, the method further includes:
[0032] The second and third signals are obtained by sampling the signal output from the magnetic angle sensor;
[0033] The magnetic angle detection signal is obtained based on the second and third signals.
[0034] In some embodiments, the step of acquiring the magnetic angle detection signal based on the second signal and the third signal includes:
[0035] Add the second signal to the second FIFO queue, and add the third signal to the third FIFO queue;
[0036] If the number of second signals in the second first-in-first-out queue meets the second preset number, then the second average value is calculated based on the second signals in the second first-in-first-out queue; if the number of third signals in the third first-in-first-out queue meets the third preset number, then the third average value is calculated based on the third signals in the third first-in-first-out queue.
[0037] The result of calculating the arctangent function based on the quotient of the second and third average values is the magnetic angle detection signal.
[0038] This application embodiment also provides a control device for a smart faucet, including a detection unit and an execution unit. The detection unit can acquire Hall detection signals through a Hall sensor and acquire corresponding movement parameters of the moving part being pressed or reset relative to the fixed part along the axial direction based on the Hall detection signals; it can also acquire magnetic angle detection signals through a magnetic angle sensor and acquire corresponding rotation parameters of the moving part rotating relative to the fixed part around the axial direction based on the magnetic angle detection signals; the execution unit controls the working state of the smart faucet according to at least one of the movement parameters and the rotation parameters, the working state including at least one of water outlet switch, water temperature, and water flow rate.
[0039] This application also provides a computer storage medium storing multiple instructions adapted for a processor to load and execute the steps of a knob control method for a smart faucet.
[0040] This application also provides a smart faucet, including a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and execute the steps of a knob control method for the smart faucet.
[0041] Based on the knob control method of the smart faucet of this application, when the user presses the moving part, the moving part can move axially towards the fixed part, so that the magnetic part and the Hall sensor are brought closer to each other. As the relative position between the magnetic part and the Hall sensor changes, the magnetic field strength of the space where the Hall sensor is located changes. The Hall sensor can output a Hall detection signal corresponding to the magnetic field strength. After receiving the Hall detection signal, the controller can obtain the movement parameters of the moving part, and then respond to the user's pressing operation according to the movement parameters.
[0042] When the user rotates the moving part, the moving part can rotate relative to the fixed part around the axis, so that the magnetic angle sensor receives a change in the magnetic field, so that the angle sensor can output a magnetic angle detection signal corresponding to the magnetic field angle. After receiving the magnetic angle detection signal, the controller can obtain the rotation parameters of the moving part, and then respond to the user's rotation operation according to the rotation parameters.
[0043] Because the sensor group can sense the movement of magnetic components by changing the magnetic field, it can detect the movement of moving components relative to fixed components. This eliminates the need for the magnetic components to come into contact with the sensor group, thus avoiding wear and tear on the sensor group and allowing it to have a longer service life. This, in turn, allows the smart faucet to have a longer service life.
[0044] Furthermore, in this embodiment, the Hall sensor is used alone to detect the user's pressing operation on the moving part, and the magnetic angle sensor is used alone to detect the user's rotation operation on the moving part. This avoids mutual interference between the Hall detection signal and the magnetic angle detection signal, thereby improving the accuracy of the Hall detection signal and the magnetic angle detection signal acquired by the controller. As a result, the accuracy of the smart faucet in responding to the user's pressing operation and rotation operation can be improved. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0046] Figure 1 This is a cross-sectional structural diagram of a knob in one embodiment of this application;
[0047] Figure 2 This is a flowchart of a knob control method for a smart faucet in one embodiment of this application;
[0048] Figure 3 This is a flowchart of a knob control method for a smart faucet in another embodiment of this application;
[0049] Figure 4 A flowchart of a knob control method for a smart faucet in another embodiment of this application;
[0050] Figure 5 This is a flowchart of a knob control method for a smart faucet in another embodiment of this application;
[0051] Figure 6 This is a flowchart of a knob control method for a smart faucet in another embodiment of this application;
[0052] Figure 7 This is a flowchart of a knob control method for a smart faucet in another embodiment of this application;
[0053] Figure 8 This is a flowchart of a knob control method for a smart faucet in another embodiment of this application;
[0054] Figure 9 This is a flowchart of a knob control method for a smart faucet in another embodiment of this application;
[0055] Figure 10 This is a flowchart of a knob control method for a smart faucet in another embodiment of this application;
[0056] Figure 11 This is a schematic diagram of the framework of the smart faucet in the embodiments of this application;
[0057] Figure 12 This is a schematic diagram of the control device of the smart faucet in the embodiments of this application.
[0058] Explanation of reference numerals in the attached drawings: 1. Knob; 11. Fixing component; 12. Moving component; 13. Magnetic component; 14. Sensor group; 141. Hall sensor; 142. Magnetic angle sensor; 15. Elastic component; 2. Smart faucet; 21. Processor; 22. Network interface; 23. Input / output interface; 24. Memory; 25. Communication bus; 3. Control device of the smart faucet; 31. Detection unit; 32. Execution unit. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0060] This application provides a smart faucet, which includes a body and a knob 1. The knob 1 includes a fixing part 11 and a moving part 12.
[0061] The fixed part 11 is fixedly connected to the body, and the moving part 12 is coaxially installed with the fixed part 11. The moving part 12 can move relative to the fixed part 11 along the axial direction, or rotate relative to the fixed part 11 around the axial direction.
[0062] The user can press the moving part 12 to move it axially relative to the fixed part 11, or rotate the moving part 12 to rotate it about its axial direction relative to the fixed part 11. This allows the smart faucet to receive the user's pressing and rotating operations, thereby controlling the smart faucet's operating status. For example, the operating status includes water outlet switch, water temperature, and water flow rate.
[0063] For example, a user can press the moving part 12 to move it closer to the fixed part 11, so that the smart faucet can dispense water; when the user releases the moving part 12, the moving part 12 moves away from the fixed part 11, so that the smart faucet can stop dispensing water.
[0064] In other embodiments, the smart faucet can also be used in conjunction with a display screen. Users can rotate knob 1 to move a cursor on the display screen and press knob 1 to select a function. For example, the display screen can at least show icons corresponding to the water switch, water temperature, and water flow rate. Users can select one from these icons by rotating knob 1 and control the corresponding function by pressing knob 1. The operation of pressing knob 1 includes at least one of long press, short press, single click, double click, and multiple presses. The selection can be based on the usage requirements of the corresponding product; in this embodiment, no specific limitation is made.
[0065] In related technologies, rotation and pressure detection are often achieved through mechanical structures. However, due to the limited lifespan of mechanical structures, the lifespan of knob 1 is relatively short, which in turn leads to a short lifespan for smart faucets.
[0066] Based on the above issues, please refer to Figure 1 In this embodiment of the application, the knob 1 includes a fixed member 11 and a moving member 12 coaxially mounted. A magnetic member 13 is provided on one of the fixed member 11 and the moving member 12, and a sensor group 14 is provided on the other of the fixed member 11 and the moving member 12. The sensor group 14 includes a Hall sensor 141 and a magnetic angle sensor 142.
[0067] When the user presses the moving part 12, the moving part 12 can move axially towards the fixed part 11, so that the magnetic part 13 and the Hall sensor 141 move closer to each other. As the relative position between the magnetic part 13 and the Hall sensor 141 changes, the magnetic field strength of the space where the Hall sensor 141 is located changes. The Hall sensor 141 can output a Hall detection signal corresponding to the magnetic field strength. After receiving the Hall detection signal, the controller can obtain the movement parameters of the moving part 12, and then respond to the user's pressing operation according to the movement parameters.
[0068] Please refer to Figure 1 It is understood that an elastic element 15, such as a spring, can be provided between the moving part 12 and the fixed part 11. One end of the spring is connected to the moving part 12, and the other end is connected to the fixed part 11. When the user presses the moving part 12, the spring can be compressed, causing the spring to undergo elastic deformation. When the external force applied by the user is removed, the elastic deformation of the spring recovers, pushing the moving part 12 away from the fixed part 11, thereby allowing the moving part 12 to reset. In other embodiments, the reset of the moving part 12 can also be achieved in other ways. In the embodiments of this application, the reset method of the moving part 12 is not limited.
[0069] When the user rotates the moving part 12, the moving part 12 can rotate relative to the fixed part 11 around the axis, so that the magnetic angle sensor 142 receives a change in the magnetic field, so that the angle sensor can output a magnetic angle detection signal corresponding to the magnetic field angle. After receiving the magnetic angle detection signal, the controller can obtain the rotation parameters of the moving part 12, and then respond to the user's rotation operation according to the rotation parameters.
[0070] Please refer to Figure 1 In this embodiment, the magnetic component 13 can be disposed on the moving component 12, and the sensor group 14 can be disposed on the fixed component 11. This facilitates the electrical connection between the sensor group 14 and the controller, thereby improving the connection stability between the sensor group 14 and the controller and ensuring that the controller can acquire the corresponding Hall detection signal and magnetic angle detection signal.
[0071] Since the sensor group 14 can sense the movement of the magnetic component 13 by changing the magnetic field, it can detect the movement of the moving component 12 relative to the fixed component 11. Therefore, the magnetic component 13 does not need to contact the sensor group 14, which can avoid wear of the sensor group 14 and thus enable the sensor group 14 to have a longer service life, so that the smart faucet can have a longer service life.
[0072] Furthermore, in this embodiment, the Hall sensor 141 is used alone to detect the user's pressing operation on the moving part 12, and the magnetic angle sensor 142 is used alone to detect the user's rotation operation on the moving part 12. This avoids mutual interference between the Hall detection signal and the magnetic angle detection signal, thereby improving the accuracy of the Hall detection signal and the magnetic angle detection signal acquired by the controller. This improves the accuracy of the smart faucet in responding to the user's pressing and rotation operations.
[0073] Please refer to Figure 1 Furthermore, the center of the magnetic angle sensor 142 can be set on the straight line of the axis, which can improve the accuracy of the magnetic angle sensor 142 in obtaining the change of magnetic field angle, thereby improving the accuracy of the magnetic angle detection signal obtained by the controller.
[0074] In other embodiments, the magnetic component 13 can also be disposed on the fixed component 11, and the sensor group 14 can also be disposed on the moving component 12. Both can detect and output corresponding Hall effect detection signals and magnetic angle detection signals, enabling the smart faucet to respond to the user's pressing and rotating operations. Further details are omitted in this embodiment.
[0075] Please refer to Figure 1In one embodiment, considering that the environment in which the smart faucet is used is often wet, water can easily enter the knob 1, causing the sensor assembly 14 to come into contact with water and potentially short-circuit. Therefore, in this embodiment, the sensor assembly 14 can be positioned on the side of the fixing member 11 away from the moving member 12, thereby reducing the probability of water contacting the sensor assembly 14 and thus reducing the probability of damage to the sensor assembly 14, resulting in a longer service life for the smart faucet.
[0076] Please refer to Figure 1 and Figure 2 This application provides a method for controlling a knob 1 of a smart faucet. The method for controlling the knob 1 includes:
[0077] Step S100: When the Hall detection signal detected by the Hall sensor 141 is obtained, the movement parameters of the moving part 12 being pressed or reset relative to the fixed part 11 along the axial direction are obtained according to the Hall detection signal; when the magnetic angle detection signal detected by the magnetic angle sensor 142 is obtained, the rotation parameters of the moving part 12 rotating relative to the fixed part 11 around the axial direction are obtained according to the magnetic angle detection signal.
[0078] In this embodiment, when the user presses the moving part 12, the moving part 12 can move axially towards the fixed part 11, so that the magnetic part 13 and the Hall sensor 141 move closer to each other. Because the relative position between the magnetic part 13 and the Hall sensor 141 changes, the magnetic field strength of the space where the Hall sensor 141 is located changes, and the Hall sensor 141 can output a Hall detection signal corresponding to the magnetic field strength. Conversely, when the user releases the moving part 12, the moving part 12 can move axially away from the fixed part 11, so that the magnetic part 13 and the Hall sensor 141 move further apart, which also changes the magnetic field strength of the space where the Hall sensor 141 is located, and the Hall sensor 141 can also output a Hall detection signal corresponding to the magnetic field strength. When the controller receives the Hall detection signal, the controller can obtain the movement parameters of the moving part 12 relative to the fixed part 11 along the axial direction being pressed or reset, and then respond to the user's pressing operation according to the movement parameters.
[0079] When the user rotates the moving part 12, the moving part 12 can rotate about the axis relative to the fixed part 11, so that the magnetic angle sensor 142 receives a change in the magnetic field, so that the angle sensor can output a magnetic angle detection signal corresponding to the magnetic field angle. When the controller receives the magnetic angle detection signal, the controller can obtain the rotation parameters of the moving part 12 rotating about the axis relative to the fixed part 11, and then respond to the user's rotation operation according to the rotation parameters.
[0080] Step S200: Control the working state of the smart faucet according to at least one of the movement parameters and rotation parameters. The working state includes at least one of the water outlet switch, water temperature, and water flow rate.
[0081] In this embodiment, the controller can control the operating state of the smart faucet based on movement parameters. The operating state includes at least one of the following: water outlet switch, water temperature, and water flow rate. It is understood that the controller can also control the operating state of the smart faucet based on rotation parameters. Of course, the controller can also control the operating state of the smart faucet based on both movement and rotation parameters. Further details on this are not elaborated upon in this embodiment.
[0082] Please refer to Figure 1 , Figure 2 and Figure 3 In one embodiment, the step of obtaining the movement parameters of the moving part 12 relative to the fixed part 11 along the axial direction as pressed or reset based on the Hall detection signal includes:
[0083] Step S300: Calculate the movement parameter based on the difference between the Hall detection signal and the first preset signal.
[0084] In this embodiment, after the controller acquires the Hall detection signal, it calculates the movement parameter based on the difference between the Hall detection signal and the first preset signal. It is understood that in other embodiments, the movement parameter can also be calculated in other ways. In this embodiment, there is no limitation on the method of calculating the movement parameter.
[0085] Please refer to Figure 1 and Figure 3 In one embodiment, after step S300, the method further includes:
[0086] Step S310: If the absolute value of the movement parameter is greater than the first preset parameter, it is determined that the moving part 12 has moved along the axial direction, and the moving distance is the absolute value of the movement parameter.
[0087] In this embodiment of the application, the controller compares the absolute value of the movement parameter with the first preset parameter. When the absolute value of the movement parameter is greater than the first preset parameter, the controller determines that the moving part 12 has moved along the axial direction and the moving distance is the absolute value of the movement parameter.
[0088] Step S320: Determine the direction of movement of the moving part 12 along the axial direction based on the positive or negative value of the movement parameters.
[0089] In this embodiment, the controller calculates the movement parameter by the difference between the Hall detection signal and the first preset signal. If the movement parameter is positive, the controller determines that the moving part 12 moves axially towards the fixed part 11, meaning the controller determines that the user presses the moving part 12, and the pressing distance is the absolute value of the movement parameter. Based on this, the controller can control the working state of the smart faucet. If the movement parameter is negative, the controller determines that the moving part 12 moves axially away from the fixed part 11, meaning the controller determines that the moving part 12 resets.
[0090] It is understood that in other embodiments, when the movement parameter is negative, the controller can determine that the moving part 12 moves axially towards the fixed part 11; when the movement parameter is positive, the controller can determine that the moving part 12 moves axially away from the fixed part 11. Therefore, in this embodiment, there is no limitation on the specific correspondence between the positive and negative values of the movement parameter and the direction of movement of the moving part 12 along the axial direction, and it can be selected according to the actual design requirements.
[0091] Please refer to Figure 1 and Figure 3 In one embodiment, after step S300, the method further includes:
[0092] Step S330: If the absolute value of the movement parameter is less than or equal to the first preset parameter, it is determined that the moving part 12 has no axial movement.
[0093] In this embodiment, if the absolute value of the movement parameter acquired by the controller is less than or equal to the first preset parameter, the controller determines that the moving part 12 has no axial movement, thereby preventing accidental user touch and improving the accuracy of the movement parameter acquired by the controller. In this embodiment, the specific value of the first preset parameter is not limited; a corresponding first preset parameter can be set according to the specific usage scenario.
[0094] Please refer to Figure 1 , Figure 2 and Figure 4 In one embodiment, after obtaining the movement parameters of the moving member 12 relative to the fixed member 11 along the axial direction based on the Hall detection signal, the method further includes:
[0095] Step S340: Set the value of the first preset signal to the value of the Hall detection signal.
[0096] In this embodiment, the Hall detection signal obtained by the controller through the Hall sensor 141 is the current position of the moving part 12 relative to the fixed part 11. After the controller obtains the corresponding movement parameters based on the Hall detection signal, the controller can assign the value of the Hall detection signal to the first preset signal. This allows the controller to calculate the movement parameters for the next press based on the Hall detection signal when the user presses the moving part 12 again. In other words, the controller can calculate the movement parameters for the next press based on the current position of the moving part 12 relative to the fixed part 11 and the position of the moving part 12 relative to the fixed part 11 when the user presses the moving part 12 again. This can eliminate the cumulative error of multiple press actions and improve the accuracy of the movement parameters obtained by the controller.
[0097] It is understandable that regardless of whether the controller determines that the moving part 12 has axial movement, the controller will assign the value of the Hall detection signal to the first preset signal, thereby further eliminating the error of multiple movements of the moving part 12, thereby improving the accuracy of the movement parameters obtained by the controller, improving the accuracy of responding to the user's pressing operation, and improving the user experience.
[0098] Please refer to Figure 1 , Figure 2 and Figure 5 In one embodiment, before the step of obtaining the movement parameters of the corresponding moving member 12 being pressed or reset relative to the fixed member 11 along the axial direction based on the Hall detection signal, the method further includes:
[0099] Step S350: Obtain the first signal by sampling the signal output by Hall sensor 141.
[0100] In this embodiment, when the moving part 12 is pressed or reset relative to the fixed part 11 along the axial direction, the moving part 12 can drive the magnetic part 13 to move, so that the magnitude of the magnetic field where the Hall sensor 141 is located changes, which can cause the Hall sensor 141 to output a changing analog signal. The controller can sample the changing analog signal output by the Hall sensor 141 to obtain a first signal, thereby reducing the signal processing burden of the controller and improving the signal processing efficiency of the controller.
[0101] Step S360: Obtain the Hall detection signal based on the first signal.
[0102] In this embodiment, the controller can acquire the Hall detection signal based on the first signal. It is understood that the controller can obtain the Hall detection signal based on the first signal through various calculation methods; however, in this embodiment, no specific calculation method is limited.
[0103] Please refer to Figure 1 and Figure 6 In one embodiment, step S360 includes:
[0104] Step S361: Add the first signal to the first first-in-first-out queue.
[0105] In this embodiment, the controller adds the sampled first signal to the first first-in-first-out queue.
[0106] Step S362: If the number of first signals in the first first-in-first-out queue meets the first preset number, then calculate the first average value based on the first signals in the first first-in-first-out queue. The first average value is the Hall detection signal.
[0107] In this embodiment of the application, when the number of first signals in the first first-in-first-out queue meets the first preset number, the controller can calculate the first average value based on the first signals in the first first-in-first-out queue and use the first average value as the Hall detection signal, thereby eliminating the error of a single first signal, improving the accuracy of the Hall detection signal obtained by the controller, and further improving the accuracy of the movement parameters obtained by the controller, so as to improve the accuracy of the smart faucet in responding to the user's pressing operation.
[0108] Please refer to Figure 1 , Figure 2 and Figure 7 In one embodiment, the step of obtaining the rotation parameters of the moving part 12 relative to the fixed part 11 about the axial direction based on the magnetic angle detection signal includes:
[0109] Step S400: Calculate the rotation parameters based on the difference between the magnetic angle detection signal and the second preset signal.
[0110] In this embodiment of the application, after the controller obtains the magnetic angle detection signal, it calculates the rotation parameters based on the difference between the magnetic angle detection signal and the second preset signal.
[0111] Please refer to Figure 1 and Figure 7 In one embodiment, after step S400, the method further includes:
[0112] Step S410: If the absolute value of the rotation parameter is greater than the second preset parameter, it is determined that the moving part 12 has rotational motion around the axis, and the rotation angle is the absolute value of the rotation parameter.
[0113] In this embodiment of the application, the controller compares the absolute value of the rotation parameter with the second preset parameter. When the absolute value of the rotation parameter is greater than the second preset parameter, the controller determines that the moving part 12 has a rotation about the axis and the rotation angle is the absolute value of the rotation parameter.
[0114] Step S420: Determine the direction of rotation of the moving part 12 around the axial direction based on the positive or negative value of the rotation parameters.
[0115] In this embodiment, after calculating the rotation parameter by the difference between the magnetic angle detection signal and the second preset signal, if the rotation parameter is positive, the controller can determine that the moving part 12 rotates clockwise relative to the fixed part 11 around the axis, that is, the controller determines that the user rotates the moving part 12 clockwise, and the rotation angle is the absolute value of the rotation parameter. The controller can then control the working state of the smart faucet based on this. If the rotation parameter is negative, the controller can determine that the moving part 12 rotates counterclockwise relative to the fixed part 11 around the axis, that is, the controller determines that the user rotates the moving part 12 counterclockwise, and the rotation angle is the absolute value of the rotation parameter.
[0116] It is understood that in other embodiments, when the rotation parameter is negative, the controller can determine that the moving part 12 rotates clockwise relative to the fixed part 11 about the axial direction; when the movement parameter is positive, the controller can determine that the moving part 12 rotates counterclockwise relative to the fixed part 11 about the axial direction. Therefore, in this embodiment, the specific correspondence between the positive and negative values of the rotation parameter and the rotation direction of the moving part 12 relative to the fixed part 11 about the axial direction is not limited, and can be selected according to actual design requirements.
[0117] Please refer to Figure 1 and Figure 7 In one embodiment, after step S400, the method further includes:
[0118] Step S430: If the absolute value of the rotation parameter is less than or equal to the second preset parameter, it is determined that the moving part 12 has no rotational motion around the axial direction.
[0119] In this embodiment, if the absolute value of the rotation parameter acquired by the controller is less than or equal to the second preset parameter, the controller determines that the moving part 12 has no rotational movement around the axial direction, thereby preventing accidental user touch and improving the accuracy of the rotation parameter acquired by the controller. In this embodiment, the specific value of the second preset parameter is not limited; the corresponding second preset parameter can be set according to the specific usage scenario.
[0120] Please refer to Figure 1 , Figure 2 and Figure 8 In one embodiment, after obtaining the rotation parameters of the moving part 12 relative to the fixed part 11 about the axial direction based on the magnetic angle detection signal, the method further includes:
[0121] Step S440: Set the value of the second preset signal to the value of the magnetic angle detection signal.
[0122] In this embodiment, the magnetic angle detection signal obtained by the controller through the magnetic angle sensor 142 represents the current position of the moving part 12 relative to the fixed part 11. After the controller obtains the corresponding rotation parameters based on the magnetic angle detection signal, it can assign the value of the magnetic angle detection signal to a second preset signal. This allows the controller to calculate the rotation parameters for the next rotation based on the current magnetic angle detection signal when the user rotates the moving part 12 again. In other words, it can calculate the rotation parameters for the next rotation based on the current position of the moving part 12 relative to the fixed part 11 and the position of the moving part 12 relative to the fixed part 11 when rotating it again. This eliminates the cumulative error from multiple rotations, improving the accuracy of the rotation parameters obtained by the controller. It also facilitates multiple rotations of the moving part 12 by the user.
[0123] It is understandable that regardless of whether the controller determines that the moving part 12 has rotational motion around the axis, the controller will assign the value of the magnetic angle detection signal to the second preset signal, thereby further eliminating the error of multiple rotations of the moving part 12, thereby improving the accuracy of the rotation parameters obtained by the controller, improving the accuracy of responding to the user's rotation operation, and improving the user experience.
[0124] Please refer to Figure 1 , Figure 2 and Figure 9 In one embodiment, before the step of obtaining the rotation parameters of the moving part 12 rotating relative to the fixed part 11 about the axial direction based on the magnetic angle detection signal, the method further includes:
[0125] Step S450: Obtain the second signal and the third signal by sampling the signal output by the magnetic angle sensor 142.
[0126] In this embodiment, when the moving part 12 rotates relative to the fixed part 11 around the axis, the moving part 12 can drive the magnetic part 13 to rotate, so that the direction of the magnetic field where the magnetic angle sensor 142 is located changes, which can make the magnetic angle sensor 142 output a changing analog signal. The controller can sample the changing analog signal output by the magnetic angle sensor 142 to obtain a second signal and a third signal, thereby reducing the signal processing burden of the controller and improving the signal processing efficiency of the controller.
[0127] Step S460: Obtain the magnetic angle detection signal based on the second signal and the third signal.
[0128] In this embodiment, the controller can acquire the magnetic angle detection signal based on the second signal and the third signal. It is understood that the controller can obtain the magnetic angle detection signal through various calculation methods based on the second signal and the third signal; however, in this embodiment, no specific calculation method is limited.
[0129] Please refer to Figure 1 and Figure 10 In one embodiment, step S460 includes:
[0130] Step S461: Add the second signal to the second FIFO queue and add the third signal to the third FIFO queue.
[0131] In this embodiment, the controller adds the sampled second signal to the second first-in-first-out queue and adds the sampled third signal to the third first-in-first-out queue.
[0132] Step S462: If the number of second signals in the second first-in-first-out queue meets the second preset number, then calculate the second average value based on the second signals in the second first-in-first-out queue; if the number of third signals in the third first-in-first-out queue meets the third preset number, then calculate the third average value based on the third signals in the third first-in-first-out queue.
[0133] In this embodiment, when the number of second signals in the second first-in-first-out queue meets the second preset number, the controller can calculate the second average value based on the second signals in the second first-in-first-out queue; when the number of third signals in the third first-in-first-out queue meets the third preset number, the controller can calculate the third average value based on the third signals in the third first-in-first-out queue, thereby eliminating the error of a single second signal and third signal, improving the accuracy of the magnetic angle detection signal acquired by the controller, and further improving the accuracy of the rotation parameters acquired by the controller, thereby improving the accuracy of the smart faucet in responding to the user's rotation operation.
[0134] Step S463: The result of calculating the arctangent function based on the quotient of the second average value and the third average value is the magnetic angle detection signal.
[0135] In this embodiment, the result of calculating the arctangent function based on the quotient of the second and third average values is the magnetic angle detection signal. In other embodiments, the magnetic angle detection signal can also be calculated in other ways. In this embodiment, there are no limitations on the calculation method of the magnetic angle detection signal.
[0136] This specification also provides a computer storage medium that can store multiple program instructions, which are adapted to be loaded and executed by a processor as described above. Figures 2-12The method steps of the illustrated embodiment can be found in the following documentation for detailed execution. Figures 2-12 The specific details of the illustrated embodiments will not be elaborated here.
[0137] Please refer to Figure 11 This document provides a schematic diagram of the structure of a smart faucet 2 as an embodiment of the present specification. Figure 11 As shown, the smart faucet 2 may include: at least one processor 21, such as a CPU, at least one network interface 22, an input / output interface 23, a memory 24, and at least one communication bus 25. The communication bus 25 is used to enable communication between these components. The network interface 22 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 24 may be a high-speed RAM memory 24, or it may be non-volatile memory 24, such as at least one disk storage device 24. Optionally, the memory 24 may also be at least one storage device located remotely from the aforementioned processor 21. Figure 11 As shown, the memory 24, which serves as a computer storage medium, may include an operating system, a network communication module, an input / output interface module, and an application program for the knob control method of a smart faucet.
[0138] exist Figure 11 In the smart faucet 2 shown, the input / output interface 23 is mainly used to provide an input interface for the user and to obtain the user's input data.
[0139] In one embodiment, the processor 21 can be used to call an application storing the knob control method of a smart faucet in the memory 24, and specifically perform the following operations:
[0140] When the Hall detection signal detected by the Hall sensor 141 is obtained, the movement parameters of the moving part 12 being pressed or reset relative to the fixed part 11 along the axial direction are obtained according to the Hall detection signal; when the magnetic angle detection signal detected by the magnetic angle sensor 142 is obtained, the rotation parameters of the moving part 12 rotating relative to the fixed part 11 around the axial direction are obtained according to the magnetic angle detection signal.
[0141] The working state of the smart faucet 2 is controlled according to at least one of the movement parameters and rotation parameters. The working state includes at least one of the following: water outlet switch, water temperature, and water flow rate.
[0142] Please refer to Figure 12 This specification provides a detailed description of the control device 3 for the intelligent faucet provided in the embodiments. It should be noted that... Figure 12 The control device 3 of the smart faucet is used to execute the embodiments described in this specification. Figures 2 to 10The methods shown in the embodiments are illustrated for ease of explanation, showing only the parts related to the embodiments of this specification. For specific technical details not disclosed, please refer to the embodiments of this specification. Figures 2 to 10 The example shown.
[0143] Please see Figure 12 This is a schematic diagram of the structure of a smart faucet control device 3 provided in an embodiment of this specification. Figure 12 As shown, the control device 3 of the smart faucet in the embodiments of this specification may include a detection unit 31 and an execution unit 32.
[0144] The detection unit 31 can acquire Hall detection signals through Hall sensor 141 and acquire the movement parameters of the corresponding moving part 12 being pressed or reset relative to the fixed part 11 along the axial direction based on the Hall detection signals; it can also acquire magnetic angle detection signals through magnetic angle sensor 142 and acquire the rotation parameters of the corresponding moving part 12 rotating relative to the fixed part 11 around the axial direction based on the magnetic angle detection signals.
[0145] The execution unit 32 controls the working state of the smart faucet 2 according to at least one of the movement parameters and rotation parameters. The working state includes at least one of the water outlet switch, water temperature, and water flow rate.
[0146] It is understood that the control device 3 of the smart faucet can be at least one of household appliances and portable electronic devices. For example, the control device 3 of the smart faucet can be a water purifier; the control device 3 of the smart faucet can also be a watch, mobile phone, or tablet computer. In the embodiments of this application, the specific form of the control device 3 of the smart faucet is not limited.
[0147] In the description of this application, it should be understood that if terms such as "upper," "lower," "left," and "right" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, they are only for the convenience of describing this application and simplifying the description, 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, the terms used to describe positional relationships in the accompanying drawings are only for illustrative purposes and should not be construed as limiting this application. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0148] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0149] In the description of this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "joining," "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components, unless otherwise expressly limited. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0150] It should be noted that when an element is referred to as being "fixed to" or "set on" another element, it can be directly on the other element or there may be an intervening element. When an element is considered to be "connected to" another element, it can be directly connected to the other element or there may be an intervening element. The terms "vertical," "horizontal," "upper," "lower," "left," "right," and similar expressions used herein are for illustrative purposes only and do not represent the only possible implementation.
[0151] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A knob control method for an intelligent faucet, characterized in that, The knob includes a fixed component and a moving component mounted coaxially. A magnetic element is disposed on one of the fixed component and the moving component, and a sensor group is disposed on the other of the fixed component and the moving component. The sensor group includes a Hall sensor and a magnetic angle sensor. The knob control method includes: When the Hall detection signal detected by the Hall sensor is obtained, the movement parameters of the moving part being pressed or reset relative to the fixed part along the axial direction are obtained according to the Hall detection signal; when the magnetic angle detection signal detected by the magnetic angle sensor is obtained, the rotation parameters of the moving part rotating relative to the fixed part around the axial direction are obtained according to the magnetic angle detection signal. The working state of the smart faucet is controlled according to at least one of the movement parameters and the rotation parameters, wherein the working state includes at least one of the water outlet switch, water temperature, and water flow rate.
2. The knob control method for a smart faucet as described in claim 1, characterized in that, The step of obtaining the corresponding movement parameters of the moving part relative to the fixed part along the axial direction when it is pressed or reset based on the Hall detection signal includes: The movement parameters are calculated based on the difference between the Hall detection signal and the first preset signal.
3. The knob control method for a smart faucet as described in claim 2, characterized in that, After the step of calculating the movement parameter based on the difference between the Hall detection signal and the first preset signal, the method further includes: If the absolute value of the movement parameter is greater than the first preset parameter, it is determined that the moving part has moved along the axis, and the moving distance is the absolute value of the movement parameter. The direction of movement of the moving part along the axial direction is determined based on the sign of the movement parameter.
4. The knob control method for a smart faucet as described in claim 3, characterized in that, After the step of calculating the movement parameter based on the difference between the Hall detection signal and the first preset signal, the method further includes: If the absolute value of the movement parameter is less than or equal to the first preset parameter, it is determined that the moving part has no movement along the axis.
5. The knob control method for a smart faucet as described in claim 2, characterized in that, After the step of obtaining the corresponding movement parameters of the moving part relative to the fixed part along the axial direction being pressed or reset based on the Hall detection signal, the method further includes: Set the value of the first preset signal to the value of the Hall detection signal.
6. The knob control method for a smart faucet as described in claim 1, characterized in that, Before the step of obtaining the corresponding movement parameters of the moving part relative to the fixed part along the axial direction being pressed or reset based on the Hall detection signal, the method further includes: The first signal is obtained by sampling the signal output by the Hall sensor; The Hall detection signal is obtained based on the first signal.
7. The knob control method for a smart faucet as described in claim 6, characterized in that, The step of acquiring the Hall detection signal based on the first signal includes: Add the first signal to the first first-in-first-out queue; If the number of the first signals in the first first-in-first-out queue meets the first preset number, then a first average value is calculated based on the first signals in the first first-in-first-out queue, and the first average value is the Hall detection signal.
8. The knob control method for a smart faucet as described in claim 1, characterized in that, The step of obtaining the rotation parameters of the moving part relative to the fixed part about the axis based on the magnetic angle detection signal includes: The rotation parameters are calculated based on the difference between the magnetic angle detection signal and the second preset signal.
9. The knob control method for a smart faucet as described in claim 8, characterized in that, After the step of calculating the rotation parameters based on the difference between the magnetic angle detection signal and the second preset signal, the method further includes: If the absolute value of the rotation parameter is greater than the second preset parameter, it is determined that the moving part has rotational motion about the axis, and the rotation angle is the absolute value of the rotation parameter. The direction of rotation of the moving part around the axis is determined based on the sign of the rotation parameter.
10. The knob control method for a smart faucet as described in claim 9, characterized in that, After the step of calculating the rotation parameters based on the difference between the magnetic angle detection signal and the second preset signal, the method further includes: If the absolute value of the rotation parameter is less than or equal to the second preset parameter, it is determined that the moving part has no rotational movement around the axis.
11. The knob control method for a smart faucet as described in claim 8, characterized in that, After the step of obtaining the rotation parameters of the moving part relative to the fixed part about the axis based on the magnetic angle detection signal, the method further includes: Set the value of the second preset signal to the value of the magnetic angle detection signal.
12. The knob control method for a smart faucet as described in claim 1, characterized in that, Before the step of obtaining the rotation parameters of the moving part relative to the fixed part about the axis based on the magnetic angle detection signal, the method further includes: The second signal and the third signal are obtained by sampling the signal output by the magnetic angle sensor; The magnetic angle detection signal is obtained based on the second signal and the third signal.
13. The knob control method for a smart faucet as described in claim 12, characterized in that, The step of obtaining the magnetic angle detection signal based on the second signal and the third signal includes: Add the second signal to the second first-in-first-out queue, and add the third signal to the third first-in-first-out queue; If the number of the second signals in the second first-in-first-out queue meets the second preset number, then the second average value is calculated based on the second signals in the second first-in-first-out queue; if the number of the third signals in the third first-in-first-out queue meets the third preset number, then the third average value is calculated based on the third signals in the third first-in-first-out queue. The result of calculating the arctangent function based on the quotient of the second average value and the third average value is the magnetic angle detection signal.
14. A control device for an intelligent faucet, characterized in that, include: The detection unit is capable of acquiring Hall detection signals through a Hall sensor and obtaining corresponding movement parameters of the moving part being pressed or reset relative to the fixed part along the axial direction based on the Hall detection signals; it is also capable of acquiring magnetic angle detection signals through a magnetic angle sensor and obtaining corresponding rotation parameters of the moving part rotating relative to the fixed part around the axial direction based on the magnetic angle detection signals. The execution unit controls the working state of the smart faucet according to at least one of the movement parameters and the rotation parameters, wherein the working state includes at least one of the water outlet switch, water temperature, and water flow rate.
15. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions adapted for loading by a processor and executing the steps of the method as described in any one of claims 1 to 13.
16. A smart faucet, characterized in that, It includes a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to execute the steps of the method as claimed in any one of claims 1 to 13.