Switching circuit, driving device and electric tool
By introducing a first resistor, a second resistor, a connector, and an MCU into the switching circuit, and using ADC sampling and a comparator to determine the switch state, the problem of not being able to determine the open circuit of the switch connection in the prior art is solved. This enables accurate determination of multiple switch states and improves the control precision and reliability of power tools.
Patent Information
- Application Number
- CN202423202328.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2034-12-25
AI Technical Summary
The existing switching circuit cannot determine the state of the switch connection being open, resulting in an inability to accurately control the working state of the power tool.
The circuit design includes a first resistor, a second resistor, a switch, a first connector, a second connector, and an MCU. The MCU's ADC sampling pin and comparator determine the various states of the switch, and the voltage value and preset conditions are used to determine whether the switch is closed, open, or has an abnormal circuit connection.
It enables accurate judgment of multiple switch states, including closed, open, and abnormal circuit connection, thereby improving the control precision and reliability of power tools.
Smart Images

Figure CN223613320U_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of electric power tools, in particular to a switch circuit, a driving device and an electric power tool. BACKGROUND
[0002] An electric power tool is a hand-held or portable tool that uses electric energy as a power source and completes various work tasks through a driving device such as a motor or an electromagnet. They are widely used in construction, decoration, machining, automobile maintenance, gardening and many other fields, which can greatly improve work efficiency.
[0003] A switch is a key component for controlling the on-off of the power supply of an electric power tool. Taking a drill as an example, when the user presses the switch, the circuit is closed, and the current can pass through the motor, and the motor starts to operate, thereby driving the drill bit to rotate for drilling operation. When the switch is released, the circuit is opened, and the motor stops working. This simple operation makes it easy for the user to control the working state of the electric power tool.
[0004] In the existing switch circuit, the IO input pin of the MCU is connected with the switch through a pull-up resistor or a pull-down resistor. When determining whether the switch is in a closed state or a pop-off state, the MCU reads the 01 result of the IO input voltage signal through the IO input pin, thereby determining whether the switch is in a closed state or a pop-off state.
[0005] However, this determination method cannot determine the state of the switch connection circuit. CONTENT OF THE INVENTION
[0006] The purpose of the present application is to provide a switch circuit, a driving device and an electric power tool, which can determine multiple states of the switch.
[0007] To achieve the above purpose, the present application provides the following solutions:
[0008] In a first aspect, the present application provides a switch circuit, which comprises:
[0009] a first resistor, a second resistor, a switch, a first plug-in element, a second plug-in element and an MCU;
[0010] One end of the switch is connected with a first terminal of the first plug-in element and one end of the first resistor, respectively;
[0011] The other end of the switch is connected with a second terminal of the first plug-in element and the other end of the first resistor, respectively;
[0012] The first terminal of the first plug-in element is further plugged with a first terminal of the second plug-in element; and the second terminal of the first plug-in element is further plugged with a second terminal of the second plug-in element;
[0013] The second plug is connected with an ADC sampling pin of the MCU and one end of the second resistor, and the other end of the second resistor is connected with the MCU; the MCU is configured to determine that the connection of the lines corresponding to the first plug and the second plug is abnormal when detecting that a sampling value of the ADC sampling pin meets a first condition, determine that the switch is open when detecting that the sampling value meets a second condition, and determine that the switch is closed when detecting that the sampling value meets a third condition.
[0014] In a second aspect, the application provides a driving device comprising the switch circuit according to the first aspect.
[0015] In a third aspect, the application provides an electric tool comprising the driving device according to the second aspect.
[0016] According to the embodiments provided in the application, the following technical effects are disclosed.
[0017] The application provides a switch circuit, a driving device and an electric tool. The switch circuit comprises a first resistor, a second resistor, a switch, a first plug, a second plug and an MCU. One end of the switch is connected with a first terminal of the first plug and one end of the first resistor. The other end of the switch is connected with a second terminal of the first plug and the other end of the first resistor. The first terminal of the first plug is also plugged with a first terminal of the second plug. The second terminal of the first plug is also plugged with a second terminal of the second plug. The second plug is connected with an ADC sampling pin of the MCU and one end of the second resistor. The other end of the second resistor is connected with the MCU. The MCU is configured to determine that the connection of the lines corresponding to the first plug and the second plug is abnormal when detecting that a sampling value of the ADC sampling pin meets a first condition, determine that the switch is open when detecting that the sampling value meets a second condition, and determine that the switch is closed when detecting that the sampling value meets a third condition. In the disclosure, the MCU determines the state of the switch by the voltage value of the ADC sampling pin, and determines the state of the switch based on the voltage value and the preset conditions, so that the multiple states of the switch can be determined. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0019] Figure 1 is a schematic diagram of a switch circuit according to an exemplary embodiment Figure 1 ;
[0020] Figure 2 is a schematic diagram of a switch circuit according to an exemplary embodiment Figure 2 ;
[0021] Figure 3 is a schematic diagram of a switch circuit according to an exemplary embodiment Figure 3 ;
[0022] BRIEF DESCRIPTION OF DRAWINGS
[0023] R1 - first resistor; R2 - second resistor; S1 - switch; P1 - first plug; P2 - second plug. DETAILED DESCRIPTION
[0024] The technical solutions in the embodiments of the present application will be apparently and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by a person of ordinary skill in the art without any creative work fall within the scope of protection of the present application.
[0025] The above purposes, features and advantages of the present application can be more apparent and easy to understand. The present application will be further described in detail below with reference to the drawings and specific embodiments.
[0026] Figure 1 is a schematic diagram of a switch circuit according to an exemplary embodiment, as shown in Figure 1 , the switch circuit comprises a first resistor R1, a second resistor R2, a switch S1, a first plug P1, a second plug P2 and an MCU.
[0027] One end of the switch S1 is connected with the first terminal 1 of the first plug P1 and one end of the first resistor R1 respectively;
[0028] The other end of the switch S1 is connected with the second terminal 2 of the first plug P1 and the other end of the first resistor R1 respectively;
[0029] The first terminal 1 of the first plug P1 is also plugged with the first terminal 1 of the second plug P2; the second terminal 2 of the first plug P1 is also plugged with the second terminal 2 of the second plug P2;
[0030] The second plug P2 is connected with an ADC sampling pin of the MCU and one end of a second resistor R2, and the other end of the second resistor R2 is connected with the MCU; the MCU is configured to determine that a connection of a line corresponding to the first plug P1 and the second plug P2 is abnormal when detecting that a sampling value of the ADC sampling pin meets a first condition, determine that the switch S1 is open when detecting that the sampling value meets a second condition, and determine that the switch S1 is closed when detecting that the sampling value meets a third condition.
[0031] In the corresponding embodiments, the MCU is configured to determine that the connection of the line corresponding to the first plug P1 and the second plug P2 is abnormal when detecting that the sampling value of the ADC sampling pin meets the first condition, determine that the switch S1 is open when detecting that the sampling value meets the second condition, and determine that the switch S1 is closed when detecting that the sampling value meets the third condition, including:
[0032] In one embodiment, as shown in FIG. 1, the first plug P1 is connected with the second plug P2, and the second plug P2 is connected with the MCU and the second resistor R2. Figure 2 In one embodiment, as shown in FIG. 1, the first plug P1 is connected with the second plug P2, and the second plug P2 is connected with the MCU and the second resistor R2.
[0033] In the corresponding embodiments, the MCU is configured to determine that the connection of the line corresponding to the first plug P1 and the second plug P2 is abnormal when detecting that the sampling value of the ADC sampling pin meets the first condition, determine that the switch S1 is open when detecting that the sampling value meets the second condition, and determine that the switch S1 is closed when detecting that the sampling value meets the third condition, including: Figure 2 In the corresponding embodiments, the MCU is configured to determine that the connection of the line corresponding to the first plug P1 and the second plug P2 is abnormal when detecting that the sampling value of the ADC sampling pin meets the first condition, determine that the switch S1 is open when detecting that the sampling value meets the second condition, and determine that the switch S1 is closed when detecting that the sampling value meets the third condition, including:
[0034] In the corresponding embodiments, the MCU is configured to determine that the connection of the line corresponding to the first plug P1 and the second plug P2 is abnormal when detecting that the sampling value of the ADC sampling pin meets the first condition, determine that the switch S1 is open when detecting that the sampling value meets the second condition, and determine that the switch S1 is closed when detecting that the sampling value meets the third condition, including:
[0035] Figure 2 In the corresponding embodiments, the MCU includes a first comparator and a second comparator.
[0036] In the corresponding embodiments, the MCU includes a first comparator and a second comparator. In the corresponding embodiments, the MCU includes a first comparator and a second comparator.
[0037] The positive input end of the first comparator is connected with the ADC sampling pin, the negative input end of the first comparator is connected with the first threshold voltage module, and the output end of the first comparator is connected with the first output pin of the MCU;
[0038] The positive input end of the second comparator is connected with the ADC sampling pin, the negative input end of the second comparator is connected with the second threshold voltage module, and the output end of the second comparator is connected with the second output pin of the MCU.
[0039] When the voltage value output by the ADC sampling pin to the positive input end of the first comparator is greater than the first threshold voltage value of the negative input end of the first comparator, the output end of the first comparator outputs high level; when the voltage value output by the ADC sampling pin to the positive input end of the first comparator is less than the first threshold voltage value of the negative input end of the first comparator, the output end of the first comparator outputs low level. When the voltage value output by the ADC sampling pin to the positive input end of the second comparator is greater than the second threshold voltage value of the negative input end of the second comparator, the output end of the second comparator outputs high level; when the voltage value output by the ADC sampling pin to the positive input end of the second comparator is less than the second threshold voltage value of the negative input end of the second comparator, the output end of the second comparator outputs low level. Then, when the MCU detects that the signals output by the first comparator and the second comparator are both high level, the MCU determines that the line connection corresponding to the first plug P1 and the second plug P2 is abnormal; when the MCU detects that the first comparator outputs low level and the second comparator outputs high level, the MCU determines that the switch S1 is in the open state; when the MCU detects that both the comparators output low level, it is determined that the switch S1 is in the closed state.
[0040] The voltage provided by the first threshold voltage module is the same as the size of the first threshold voltage value, and the voltage provided by the second threshold voltage module is the same as the size of the second threshold voltage value.
[0041] In the above embodiment, the first condition is that the sampling value output by the ADC sampling pin is greater than the first threshold voltage value; the second condition is that the sampling value output by the ADC sampling pin is less than the first threshold voltage value and greater than the second threshold voltage value; and the third condition is that the sampling value output by the ADC sampling pin is less than the second threshold voltage value.
[0042] In this embodiment, the first threshold voltage value and the second threshold voltage value can be determined according to the resistance value of the first resistor R1, the resistance value of the second resistor R2 and the power supply voltage value of the MCU, specifically:
[0043] The first threshold voltage value is obtained according to the following formula:
[0044]
[0045] wherein A represents a first threshold voltage value, V represents a power supply voltage value of the MCU, R1 represents a resistance value of the first resistor R1, and R2 represents a resistance value of the second resistor R2;
[0046] The second threshold voltage value is obtained according to the following formula:
[0047]
[0048] wherein B represents a second threshold voltage value, V represents a power supply voltage value of the MCU, R1 represents a resistance value of the first resistor R1, and R2 represents a resistance value of the second resistor R2.
[0049] In another embodiment, as shown in FIG. 2, the first terminal 1 of the second connector P2 is connected to the power supply terminal of the MCU, the second terminal 2 of the second connector P2 is connected to one end of the second resistor R2 and the ADC sampling pin of the MCU respectively, the other end of the second resistor R2 is connected to the ground terminal of the MCU, and the MCU is configured to determine that the connection of the line corresponding to the first connector P1 and the second connector P2 is abnormal when detecting that the sampling value of the ADC sampling pin meets a first condition, determine that the switch S1 is open when detecting that the sampling value meets a second condition, and determine that the switch S1 is closed when detecting that the sampling value meets a third condition. Figure 3 In the corresponding embodiment, the MCU is configured to determine that the connection of the line corresponding to the first connector P1 and the second connector P2 is abnormal when detecting that the sampling value of the ADC sampling pin meets a first condition, determine that the switch S1 is open when detecting that the sampling value meets a second condition, and determine that the switch S1 is closed when detecting that the sampling value meets a third condition, including:
[0050] Figure 3 The MCU is configured to determine that the connection of the line corresponding to the first connector P1 and the second connector P2 is abnormal when detecting that the sampling value of the ADC sampling pin is less than the second threshold voltage value, determine that the switch S1 is open when detecting that the sampling value of the ADC sampling pin is less than the first threshold voltage value and greater than the second threshold voltage value, and determine that the switch S1 is closed when detecting that the sampling value of the ADC sampling pin is greater than the first threshold voltage value.
[0051] In the corresponding embodiment, the MCU includes a first comparator and a second comparator.
[0052] In the corresponding embodiment, the MCU includes a first comparator and a second comparator. Figure 3 The first terminal of the second connector P2 is connected to the power supply terminal of the MCU, the second terminal of the second connector P2 is connected to one end of the second resistor R2 and the ADC sampling pin of the MCU respectively, and the other end of the second resistor R2 is connected to the ground terminal of the MCU.
[0053]
[0054] The positive input end of the first comparator is connected with the first threshold voltage module, the negative input end of the first comparator is connected with the ADC sampling pin, and the output end of the first comparator is connected with the second output pin of the MCU.
[0055] The positive input end of the second comparator is connected with the second threshold voltage module, the negative input end of the second comparator is connected with the ADC sampling pin, and the output end of the second comparator is connected with the first output pin of the MCU.
[0056] When the voltage value output by the ADC sampling pin to the negative input end of the first comparator is less than the first threshold voltage value of the positive input end of the first comparator, the output end of the first comparator outputs a high level; when the voltage value output by the ADC sampling pin to the negative input end of the first comparator is greater than the first threshold voltage value of the positive input end of the first comparator, the output end of the first comparator outputs a low level. When the voltage value output by the ADC sampling pin to the negative input end of the second comparator is less than the second threshold voltage value of the positive input end of the second comparator, the output end of the second comparator outputs a high level; when the voltage value output by the ADC sampling pin to the negative input end of the second comparator is greater than the second threshold voltage value of the positive input end of the second comparator, the output end of the second comparator outputs a low level. Then, when the MCU detects that the signals output by the first comparator and the second comparator are both high levels, the MCU determines that the connection of the line corresponding to the first plug P1 and the second plug P2 is abnormal; when the MCU detects that the signal output by the first comparator is a high level and the signal output by the second comparator is a low level, it is determined that the switch S1 is in the open state; when the MCU detects that the signals output by the two comparators are both low levels, the MCU determines that the switch S1 is in the closed state.
[0057] The first threshold voltage module provides a voltage with the same size as the first threshold voltage value, and the second threshold voltage module provides a voltage with the same size as the second threshold voltage value.
[0058] In the above embodiment, the first condition is that the sampling value output by the ADC sampling pin is less than the second threshold voltage value; the second condition is that the sampling value output by the ADC sampling pin is less than the first threshold voltage value and greater than the second threshold voltage value; and the third condition is that the sampling value output by the ADC sampling pin is greater than the first threshold voltage value.
[0059] In this embodiment, the first threshold voltage value and the second threshold voltage value can be determined according to the resistance value of the first resistor R1, the resistance value of the second resistor R2 and the power supply voltage value of the MCU, specifically:
[0060] The first threshold voltage value is obtained according to the following formula:
[0061] The first threshold voltage value is obtained according to the following formula:
[0062] wherein A represents a first threshold voltage value, V represents a power supply voltage value of the MCU, R1 represents a resistance value of the first resistor R1, and R2 represents a resistance value of the second resistor R2.
[0063] The second threshold voltage value is obtained according to the following formula:
[0064]
[0065] wherein B represents a second threshold voltage value, V represents a power supply voltage value of the MCU, R1 represents a resistance value of the first resistor R1, and R2 represents a resistance value of the second resistor R2.
[0066] In the above embodiments, the resistance value of the first resistor R1 is the same as the resistance value of the second resistor R2.
[0067] In one embodiment, the first plug P1 is a plug, and the second plug P2 is a socket; or, the first plug P1 is a socket, and the second plug P2 is a plug.
[0068] The plug is an electronic component for connecting and controlling the on-off of a circuit. It is mainly composed of a plug (male head) and a socket (female head), and has a switch S1 mechanism that can control the connection or disconnection of the circuit. This component can conveniently realize the electrical connection between devices, and can flexibly control the conduction of current through the switch S1 operation.
[0069] The plug part usually has a metal pin for inserting into the metal socket of the socket to realize electrical connection, and the switch S1 controls the connection path through the internal mechanical or electronic structure.
[0070] The connection of the first plug P1 and the second plug P2 can adopt plug-in type or screw type, of which the plug-in type is the most common. The connection is established by inserting the plug into the socket, and the connection is disconnected by pulling out the plug. The screw type adopts a screw structure for connection, and the plug is tightly connected with the socket by rotating the plug.
[0071] In the present disclosure, the MCU samples the voltage value of the switch S1 signal through the ADC sampling pin, determines that the switch S1 is in three states of closing, opening or the first plug P1 and the second plug P2 are not connected well, so as to realize the judgment of multiple states of the switch S1.
[0072] The present disclosure also provides a driving device comprising the switch circuit in any one of the above embodiments.
[0073] The present disclosure also provides an electric tool comprising the driving device in any one of the above embodiments.
[0074] Any technical features in the above embodiments can be combined, and for the sake of brevity, not all possible combinations are described above, however, it should be understood that the application encompasses all possible combinations of the technical features unless such a combination is not technically possible.
[0075] The principles and implementation manners of the present application are described herein by using specific examples, and the above embodiments are only used to help understand the method of the present application and its core idea; meanwhile, according to the idea of the present application, the specific implementation manners and application ranges will be changed by those skilled in the art. In conclusion, the content of the present specification should not be understood as a limitation of the present application.
Claims
1. A switching circuit, characterized by, The switch circuit comprises: a first resistor, a second resistor, a switch, a first plug, a second plug and an MCU; one end of the switch is connected with a first terminal of the first plug and one end of the first resistor respectively; the other end of the switch is connected with a second terminal of the first plug and the other end of the first resistor respectively; the first terminal of the first plug is also plugged with a first terminal of the second plug; the second terminal of the first plug is also plugged with a second terminal of the second plug; the second plug is connected with an ADC sampling pin of the MCU and one end of the second resistor; the other end of the second resistor is connected with the MCU; the MCU is used for determining that the line connection corresponding to the first plug and the second plug is abnormal when detecting that a sampling value of the ADC sampling pin meets a first condition, determining that the switch is opened when detecting that the sampling value meets a second condition, and determining that the switch is closed when detecting that the sampling value meets a third condition.
2. The switching circuit of claim 1, wherein The MCU comprises a first comparator and a second comparator; the first terminal of the second plug is connected with one end of the second resistor and the ADC sampling pin of the MCU; the other end of the second resistor is connected with a power supply end of the MCU; the second terminal of the second plug is also connected with a grounding end of the MCU; the positive input end of the first comparator is connected with the ADC sampling pin; the negative input end of the first comparator is connected with a first threshold voltage module; the output end of the first comparator is connected with a first output pin of the MCU; the positive input end of the second comparator is connected with the ADC sampling pin; the negative input end of the second comparator is connected with a second threshold voltage module; the output end of the second comparator is connected with a second output pin of the MCU.
3. The switching circuit of claim 1, wherein The MCU comprises a first comparator and a second comparator; the first terminal of the second plug is connected with a power supply end of the MCU; the second terminal of the second plug is connected with one end of the second resistor and an ADC sampling pin of the MCU respectively; the other end of the second resistor is connected with a grounding end of the MCU; the positive input end of the first comparator is connected with a first threshold voltage module; the negative input end of the first comparator is connected with the ADC sampling pin; the output end of the first comparator is connected with a second output pin of the MCU; the positive input end of the second comparator is connected with a second threshold voltage module; the negative input end of the second comparator is connected with the ADC sampling pin; the output end of the second comparator is connected with a first output pin of the MCU.
4. The switch circuit according to claim 1, wherein the first plug is a plug; and the second plug is a socket; or, the first plug is a socket; and the second plug is a plug.
5. The switching circuit of claim 1, wherein The resistance value of the first resistor is the same as the resistance value of the second resistor.
6. A drive apparatus characterized by comprising: The switch circuit comprises any one of claims 1-5.
7. A power tool characterized by comprising: The driving device comprises claim 6.