Button mistaken touch prevention delay switch control system
By adopting a combination of software and hardware design in the switch control system, and using components such as NPN transistors, PMOS tubes and microcontrollers, anti-fault touch delay switch control is achieved, solving the problems of complex switch design, high cost and false touch problems, and achieving small, efficient and low-cost switch control effects.
Patent Information
- Application Number
- CN202510089923.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-06
AI Technical Summary
The existing switch design has mechanical jitter, complex implementation, high cost, and the software implementation effect is not ideal, which can easily turn on and off due to accidental touch, affecting the use experience.
Using a combination of software and hardware, NPN transistors, PMOS tubes, buttons, diodes and resistors are used to achieve an anti-detect delay switch control system through components such as NPN transistors, PMOS tubes, buttons, diodes and resistors, and microcontroller control. The system controls the working state of the PMOS tube and transistor by setting the time when the button is pressed and released, and realizes the switch's self-locking and anti-faulting functions.
It achieves anti-touch effect, controllable on and off time, small hardware size and low cost, and is suitable for mass production and use.
Smart Images

Figure CN119937411A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of switch control circuits, and in particular to a key-press anti-mistouch delayed switch control system. Background Art
[0002] Switch control technology is a fundamental and critical technology that plays an important role in many fields. Faced with increasingly complex equipment, the reliability and stability requirements for switches are becoming increasingly higher.
[0003] Various electronic products have a power on / off function. Existing switch designs mostly rely on pure hardware circuits. Pure hardware designs are subject to mechanical vibration, are complex to implement, and are costly. Software-only designs also offer suboptimal results, as accidental touches can sometimes cause the device to turn on or off, impacting user experience. Electronic products typically include a single-chip microcontroller (MCU) control unit. By adding some simple discrete components, a combination of hardware and software can be used to implement a switch design that prevents accidental touches. Summary of the Invention
[0004] In order to solve the above technical problems, the present invention provides a button anti-accidental touch delay switch control system, which controls the power on and off of the device by combining software and hardware, but solves the problems of complex implementation, high cost and unsatisfactory software implementation effect.
[0005] The technical solution of the present invention is:
[0006] A key anti-false touch delay switch control system includes the following parts: NPN transistor Q1, PMOS tube Q2, key S, diodes D1, D2, resistors R1, R2, R3, R4, R5, 3.3V power supply, 12V power supply, and single-chip microcomputer;
[0007] The switch S has one end connected to the gate of Q2 through a diode D2 and a resistor R2, and the other end is directly grounded. When S is pressed, the power control circuit is: 12V power supply, resistor R3, resistor R2, diode D2, switch S1, and ground. This circuit will lower the voltage of the gate of Q2.
[0008] The PMOS tube Q2, resistors R2 and R3 are used to set the resistance values of resistors R2 and R3 to provide a suitable turn-on voltage for Q2. Different PMOS transistors have different turn-on thresholds, generally -5 to -10V, that is, the PMOS transistor is turned on when the gate voltage is less than the source voltage of -5 to -10V.
[0009] Furthermore,
[0010] After the resistance values of R2 and R3 are set, button S is pressed, the gate of PMOS is pulled low, Q2 is turned on, the 12V power supply is supplied to the subsequent load, the microcontroller is powered on and starts working, and the entire system is turned on.
[0011] The transistor Q1, resistor R4, resistor R5, and single chip microcomputer, when the base of Q1 is at a high level, Q1 is turned on, the gate voltage of Q2 is pulled down by R2 and Q1, and Q2 is still turned on, that is, the switch is self-locked.
[0012] Another IO of the microcontroller, GPIO2, which is used to detect the button status, is connected between the resistor R1 and the diode D1. When the button S is pressed, the voltage at GPIO2 is pulled down to about 0.7V, which is the tube voltage drop of the diode D1. When the button S is released, the voltage at GPIO2 is pulled up by the 3.3V power supply through the resistor R1.
[0013] Furthermore,
[0014] The diodes D1 and D2 play an isolation role, preventing Q1 from affecting the voltage of GPIO2 when it is turned on, and D2 limits the current direction to prevent the 12V power supply from generating an overvoltage shock to the IO port of the microcontroller along the path R3, R2, and D2.
[0015] Furthermore,
[0016] The time t1 can be set. When the button is pressed for t1 seconds, the MCU detects that the level of GPIO2 changes from high to low for t1 seconds. The MCU controls GPIO1 to generate a high level to complete self-locking. Even if S1 is released again, Q2 is still in the on state and the 12V power supply can still power the subsequent load.
[0017] Furthermore,
[0018] During the t1 time, GPIO1 is not at a high level, the button S1 is released, and Q2 will not be turned on, thus preventing accidental power-on.
[0019] Furthermore,
[0020] You can set the time t2. When the button is pressed for t2 seconds, the MCU detects that the level of GPIO2 changes from high to low for t2 seconds. The MCU controls GPIO1 to generate a low level. At this time, release S to shut down the device.
[0021] The beneficial effects of the present invention are
[0022] In response to the problems that conventional power on and off design methods are prone to false triggering, complex implementation, high cost, and unsatisfactory software implementation effects, the present invention invents a key anti-false touch delay switch control method and system. The power on and off of the device is controlled by a combination of software and hardware to achieve an anti-false touch effect and controllable power on and off time. The design method has small hardware size, low cost, and is easy to use in large-scale production. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a schematic diagram of the workflow of the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0025] like Figure 1 As shown, the present invention includes the following parts: transistor Q1, PMOS tube Q2, button S, diodes D1, D2, resistors R1, R2, R3, R4, R5, 3.3V power supply, 12V power supply, and single chip microcomputer.
[0026] Assume that the power-on time is set to 2 seconds and the power-off time is set to 3 seconds. When the switch S is pressed, the system starts. The following describes the startup process.
[0027] When S is pressed, the gate of Q2 is pulled low by R2 and D2, Q2 is turned on, the load is energized, and the microcontroller starts working. The microcontroller detection port GPIO2 is pulled down from the original high level to the low level, and the duration is greater than 2 seconds. The microcontroller controls GPIO1 to output a high level, Q1 is turned on, thereby turning on Q2, completing the power-on self-locking. Releasing S will not affect the power-on;
[0028] When S is pressed again, the MCU detection port GPIO2 is pulled down from the original high level to the low level, and the duration is greater than 3 seconds. The MCU controls GPIO1 to output a low level, Q1 is cut off, and when S is released, Q2 is cut off to achieve shutdown.
[0029] It should be noted that the above time settings are all implemented by software, and the above design can be achieved by using the timer and IO port interrupt functions of the microcontroller in the existing method.
[0030] The above description is only a preferred embodiment of the present invention and is only used to illustrate the technical solution of the present invention, and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included in the scope of protection of the present invention.
Claims
1. A button anti-mistouch delay switch control system, characterized in that: It includes the following parts: NPN transistor Q1, PMOS tube Q2, button S, diodes D1, D2, resistors R1, R2, R3, R4, R5, 3.3V power supply, 12V power supply, and single-chip computer; One end of the switch S is connected to the gate of the PMOS tube Q2 through a diode D2 and a resistor R2, and the other end is directly grounded. When S is pressed, the power control circuit is: 12V power supply, resistor R3, resistor R2, diode D2, switch S1, ground. This circuit pulls down the voltage of the gate of Q2; The resistance values of resistors R2 and R3 are set to provide a turn-on voltage for the PMOS tube Q2. When the gate voltage is less than the source voltage of -5 to -10V, the PMOS is turned on.
2. The system according to claim 1, characterized in that After the resistance values of R2 and R3 are set, the button S is pressed, the gate of the PMOS is pulled low, Q2 is turned on, the 12V power supply supplies power to the subsequent load, the microcontroller is powered on and starts working, and the entire system is turned on.
3. The system according to claim 2, characterized in that When the base of transistor Q1 is at a high level, transistor Q1 is turned on, and the gate voltage of PMOS tube Q2 is pulled down by R2 and Q1, but Q2 is still turned on, thus achieving self-locking of the switch.
4. The system according to claim 3, characterized in that Another IO of the microcontroller is connected between the resistor R1 and the diode D1, namely GPIO2 for detecting the key status. When the key S is pressed, the voltage at the GPIO2 point is pulled down to about 0.7V, which is the tube voltage drop of the diode D1; when the key S is released, the voltage at the GPIO2 point is pulled up by the 3.3V power supply through the resistor R1.
5. The system according to claim 4, characterized in that The diodes D1 and D2, D1 plays an isolation role to prevent the transistor Q1 from affecting the voltage of GPIO2 when it is turned on, and D2 limits the current direction to prevent the 12V power supply from generating an overvoltage shock to the IO port of the microcontroller along the path R3, R2, and D2.
6. The system according to claim 5, characterized in that Set time t1, the button is pressed for t1 seconds, that is, the time it takes for the MCU to detect that the level of GPIO2 changes from high level to low level is t1 second. The MCU controls GPIO1 to generate a high level to complete self-locking. Even if S1 is released again, Q2 is still in the on state, and the 12V power supply still supplies power to the subsequent load.
7. The system according to claim 6, characterized in that During the t1 time, GPIO1 is not at a high level, the button S1 is released, and Q2 will not be turned on.
8. The system according to claim 5, characterized in that Set time t2, the button is pressed for t2 seconds, that is, the time it takes for the MCU to detect that the level of GPIO2 changes from high level to low level is t2 seconds, and the MCU controls GPIO1 to generate a low level. At this time, release S to shut down.