Multifunctional key switch circuit for electronic product

文档序号:687337 发布日期:2021-04-30 浏览:16次 中文

阅读说明:本技术 一种用于电子产品的多功能按键开关电路 (Multifunctional key switch circuit for electronic product ) 是由 刘子寒 沈美根 周垚宇 于 2020-12-14 设计创作,主要内容包括:本发明属于电路技术领域,具体为一种用于电子产品的多功能按键开关电路。本开关电路包括按键开关、系统控制单元、供电单元和开关单元;按键开关连接系统控制单元、供电单元和开关单元;按键开关通过长按和短按两种方式切换所述系统控制单元的控制芯片的运行状态;系统控制单元通过所述控制芯片的运行状态向所述开关单元提供电压;供电单元为所述多功能按键开关电路以及被控对象供电;开关单元根据所述系统控制单元提供的电压切换不同的运行状态。本开关电路结构简单,安全性高,实用性强,不仅能实现基本的开关机功能,还能实现其他不同的工作功能。(The invention belongs to the technical field of circuits, and particularly relates to a multifunctional key switch circuit for an electronic product. The switch circuit comprises a key switch, a system control unit, a power supply unit and a switch unit; the key switch is connected with the system control unit, the power supply unit and the switch unit; the key switch switches the running state of the control chip of the system control unit in a long-pressing mode and a short-pressing mode; the system control unit provides voltage for the switch unit through the running state of the control chip; the power supply unit supplies power to the multifunctional key switch circuit and the controlled object; the switch unit switches different operation states according to the voltage provided by the system control unit. The switching circuit is simple in structure, high in safety and strong in practicability, not only can realize the basic on-off function, but also can realize other different working functions.)

1. A multifunctional key switch circuit for an electronic product is used for controlling whether a controlled object is enabled or not, and is characterized by comprising a power supply unit, a system control unit, a switch unit and a key switch; wherein:

the power supply unit is used for supplying power to the whole multifunctional key switch circuit; the power supply unit is connected with the key switch, the system control unit and the switch unit;

the power supply unit comprises a battery VBAT +, a PMOS tube Q2, a diode D11, a resistor R2 and a capacitor C1; the drain electrode of the PMOS tube Q2 is connected with the anode of a diode D11, the grid electrode of the PMOS tube Q2 is connected with one end of a key switch, and the source electrode of the PMOS tube Q2 is connected with a battery VBAT +;

the system control unit is used for switching the operation state according to the action of the key switch and providing corresponding voltage for the switch unit according to the operation state;

the system control unit includes: an NMOS tube Q3, a resistor R7, a resistor R6 and a resistor R5; the drain electrode of the NMOS tube is connected with R7, the grid electrode of the NMOS tube is connected with R6, and the source electrode of the NMOS tube is grounded; one end of the resistor R7 is connected with 3.3V voltage, and the other end is connected with the drain electrode of the NMOS tube Q3; one end of the resistor R6 is connected with the key switch, and the other end of the resistor R6 is connected with the grid of the NMOS tube Q3; one end of the R5 is connected with the key switch, and the other end of the R5 is grounded;

the switch unit is used for changing the working state according to the state of the key switch; the working state comprises a conducting state and a disconnecting state; when the switch unit is in an on state, a controlled object is in an enabled state, and when the switch unit is in an off state, the controlled object is in an disabled state;

the switch unit comprises a resistor R1, an NPN triode Q1 and a capacitor C128; one end of the resistor R1 is connected with one end of the grid of the Q2, which is connected with the resistor R2 and the capacitor C1, and the other end is connected with the collector of the NPN triode Q1; a collector of the NPN triode Q1 is connected with the resistor R1, a base of the NPN triode Q1 is connected with one end of the capacitor C128 and a PE5 pin of the control chip, and an emitter of the NPN triode Q1 is connected with the other end of the capacitor C128 and the ground; one end of the capacitor C128 is connected with one end of the base electrode of the NPN triode Q1 connected with the pin PE5 of the control chip, and the other end of the capacitor C128 is connected with one end of the emitter electrode of the NPN triode Q1 connected with the ground;

the key switch is used for switching the operating states of the control unit and the switch unit; one end of the key switch is connected with a PMOS tube of the power supply unit, a resistor R2 and a capacitor C1, and the other end is connected with the control unit through a resistor R6 and is connected with the ground through a resistor R5.

2. The multi-function key switch circuit of claim 1, wherein the system control unit comprises a control chip, the control chip being a programmable logic control device;

the PE4/SW pin of the control chip is connected to one end of the resistor R7, which is connected with the drain electrode of the NMOS tube;

a pin PE5 of the control chip is connected to one end of the capacitor C128 connected with the base electrode of the NPN triode;

the running state of the control chip comprises a starting state, a shutdown state, a function setting state and a dormant state.

3. The multi-function keyswitch circuit of claim 2, wherein:

when the control chip operates in a starting-up state, a pin PE5 of the control chip outputs a high level;

when the control chip operates in a shutdown state, a pin PE5 of the control chip outputs a low level;

when the control chip operates in a function setting state, the PE4/SW pin of the control chip outputs a low level, and the operating parameters of the control chip can be set through programming;

and the control chip operates in a dormant state and does not perform instruction operation.

4. The multi-function key switch circuit of claim 3,

when the control chip operates in a power-off state, the power supply unit is switched on after the key switch is pressed for a long time for a first preset time, the control chip is switched on, the pin PE5 is controlled to output a high level, the switch unit is switched on, the system is switched to a power-on state, and at the moment, the potential of the pin PE4/SW is not changed and is always high under the control of programming;

when the control chip operates in a power-on state, and a key switch is pressed for a long time and lasts for a first preset time, and a PE4/SW pin of the control chip detects voltage change, the PE5 pin is controlled to output a low level and is switched to a power-off state;

the control chip operates in a dormant state, after the key switch is pressed for a short time, the PE4/SW pin of the control chip detects a low level lasting for a second preset time, and then the control chip is awakened to start working;

the control chip operates in a function setting state, after the key switch is pressed for a short time, the PE4/SW pin of the control chip detects voltage change, and the system starts/stops working.

5. The multi-function keyswitch circuit of claim 2, wherein a PMOS transistor is used in the power supply unit, and a 12V voltage is applied in practical applications.

Technical Field

The invention belongs to the technical field of circuits, and particularly relates to a multifunctional key switch circuit for an electronic product.

Background

With the development of social economy and the popularization of artificial intelligence, various electric products are increasing day by day, so that the switch also becomes a very important part in daily life of people, and a switch circuit in the switch also becomes very important. The current switching circuit is mainly realized by two methods, namely a semiconductor power electronic element and a mechanical relay. The mechanical switching circuit adopting the mechanical relay has low switching frequency, larger size of a switching device and shorter service life. At present, semiconductor power electronic elements such as transistors and MOS transistors are mostly used in more common switching circuits. However, the switching circuit can only realize a single switching function at present, and the function is simpler.

Disclosure of Invention

The invention aims to provide a multifunctional key switch circuit for an electronic product, which has a simple structure and high safety.

The invention provides a multifunctional key switch circuit for an electronic product, which is used for controlling whether a controlled object is enabled or not, and comprises a power supply unit, a system control unit, a switch unit and a key switch; wherein:

the power supply unit is used for supplying power to the whole multifunctional key switch circuit; the power supply unit is connected with the key switch, the system control unit and the switch unit;

the power supply unit comprises a battery VBAT +, a PMOS tube Q2, a diode D11, a resistor R2 and a capacitor C1; the drain electrode of the PMOS tube Q2 is connected with the anode of a diode D11, the grid electrode of the PMOS tube Q2 is connected with one end of a key switch, and the source electrode of the PMOS tube Q2 is connected with a battery VBAT +;

the system control unit is used for switching the operation state according to the action of the key switch and providing corresponding voltage for the switch unit according to the operation state;

the system control unit includes: an NMOS tube Q3, a resistor R7, a resistor R6 and a resistor R5; the drain electrode of the NMOS tube is connected with R7, the grid electrode of the NMOS tube is connected with R6, and the source electrode of the NMOS tube is grounded; one end of the resistor R7 is connected with 3.3V voltage, and the other end is connected with the drain electrode of the NMOS tube Q3; one end of the resistor R6 is connected with the key switch, and the other end of the resistor R6 is connected with the grid of the NMOS tube Q3; one end of the R5 is connected with the key switch, and the other end of the R5 is grounded;

the switch unit is used for changing the working state according to the state of the key switch; the working state comprises a conducting state and a disconnecting state; when the switch unit is in an on state, a controlled object is in an enabled state, and when the switch unit is in an off state, the controlled object is in an disabled state;

the switch unit comprises a resistor R1, an NPN triode Q1 and a capacitor C128; one end of the resistor R1 is connected with one end of the grid of the Q2, which is connected with the resistor R2 and the capacitor C1, and the other end is connected with the collector of the NPN triode Q1; a collector of the NPN triode Q1 is connected with the resistor R1, a base of the NPN triode Q1 is connected with one end of the capacitor C128 and a PE5 pin of the control chip, and an emitter of the NPN triode Q1 is connected with the other end of the capacitor C128 and the ground; one end of the capacitor C128 is connected with one end of the base electrode of the NPN triode Q1 connected with the pin PE5 of the control chip, and the other end of the capacitor C128 is connected with one end of the emitter electrode of the NPN triode Q1 connected with the ground;

the key switch is used for switching the operating states of the control unit and the switch unit; one end of the key switch is connected with a PMOS tube of the power supply unit, a resistor R2 and a capacitor C1, and the other end is connected with the control unit through a resistor R6 and is connected with the ground through a resistor R5.

Preferably, the system control unit comprises a control chip, and the control chip is a programmable logic control device; the PE4/SW pin of the control chip is connected to one end of the resistor R7, which is connected with the drain electrode of the NMOS tube;

the pin PE5 of the control chip is connected to one end of the capacitor C128 connected with the base of the NPN triode.

Preferably, the running states of the control chip include a starting state, a shutdown state, a function setting state and a dormant state;

when the control chip operates in a starting-up state, a pin PE5 of the control chip outputs a high level;

when the control chip operates in a shutdown state, a pin PE5 of the control chip outputs a low level;

when the control chip operates in a function setting state, the PE4/SW pin of the control chip outputs a low level, and the operating parameters of the control chip can be set through programming;

and the control chip operates in a dormant state and does not perform instruction operation.

Preferably, the control chip operates in a power-off state, after the key switch is pressed for a long time and lasts for a first preset time, the power supply unit is turned on, the control chip is turned on, the pin PE5 is controlled to output a high level, the switch unit is turned on, and the system is switched to a power-on state, and at this time, the potential of the pin PE4/SW is not changed and is always high under the control of programming.

Preferably, when the control chip operates in the power-on state, and the key switch is pressed for a long time for a first preset time, and the PE4/SW pin of the control chip detects a voltage change, the pin PE5 is controlled to output a low level, and the control chip is switched to the power-off state.

Preferably, the control chip operates in a sleep state, and after the key switch is pressed for a short time, the PE4/SW pin of the control chip detects a low level lasting for a second preset time, and then the control chip is awakened and can start to operate.

Preferably, the control chip operates in a function setting state, and after the key switch is pressed for a short time, the PE4/SW pin of the control chip detects a voltage change, and the system starts/suspends operation.

Preferably, the model of the control chip is STM32F103VET 6.

Preferably, a PMOS tube is used in a power supply unit of the circuit, 12V voltage can be accessed in practical engineering application, the circuit is more practical, and the field effect transistor has the advantages of low power consumption, small leakage current, good bidirectional symmetry and the like.

The application provides a multi-functional button switch circuit, its switch circuit is the electron device who adopts, simple structure, powerful, the security is high, and the practicality is strong.

Drawings

Fig. 1 is a schematic structural diagram of a multi-function key switch circuit according to the present application.

Fig. 2 is a pin diagram of an embodiment of a control chip of the present application.

Detailed Description

The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

As shown in fig. 1, the multifunctional key switch circuit for an electronic product is used for controlling whether a controlled object is enabled, and the multifunctional key switch circuit in this embodiment includes a key switch, a control unit, a power supply unit, and a switch unit.

In this embodiment, the controlled object is a control object of the multi-function key switch circuit, and a VIN terminal in fig. 1 is a connection portion between the controlled object and the multi-function key switch circuit. Specifically, the method comprises the following steps:

the power supply unit is used for supplying power to the whole circuit, and the power supply unit is connected with the key switch, the control unit and the switch unit. The power supply unit can be an external power supply or a battery. The power supply unit comprises a battery, a BAT + pin is led out from the positive pole of the battery, and a GND pin is led out from the negative pole of the battery.

The key switch is used for switching the running state of the system control unit, and different functions can be realized by long pressing and short pressing.

The system control unit is used for switching the operation state according to the action of the key switch and providing corresponding voltage for the switch unit according to the operation state. The control chip connected with the system control unit is a programmable logic control device, and an engineer can set parameters under different functions through programming and customization. In one embodiment, the engineer sets a long press for more than 2 seconds in programming, and sets the long press as a long press, otherwise sets the short press as a short press, so that the long press can be set in a power-off state, the switch unit can be continuously at a high level after the power-on, and the whole circuit can be continuously conducted; in the starting state, the long press is used for shutting down; in the starting state, the short press starts working, and in the working state, the short press suspends working.

The switch unit is used for changing working states according to the voltage provided by the system control unit, the working states comprise a conducting state and a disconnecting state, the controlled object is in an enabled state when the switch unit is in the conducting state, and the controlled object is in a non-enabled state when the switch unit is in the disconnecting state.

In this embodiment, the power supply unit not only supplies power to the entire multifunctional key switch circuit, but also supplies power to the controlled object through the VIN terminal.

In order to implement multiple functions of the multifunctional switch circuit of this embodiment, in an embodiment, the control unit includes the control chip, and the control chip is a programmable logic control device. The control chip at least operates in a starting state, a shutdown state, a function setting state and a dormant state.

Based on the above four operating states, the operation of the circuit is further described as follows:

(1) when the whole system is in a shutdown state, after a key switch is pressed for a long time and lasts for a first preset time, the grid potential of the PMOS tube in the power supply unit becomes low, the power supply unit is conducted, the control chip starts to work, the PE5 pin is controlled to output a high level, the switch unit is conducted, the system is switched to a startup state, and after the key switch is released, the whole system can be continuously conducted;

(2) when the whole system is in a power-on state, a key switch is pressed for a long time and lasts for a first preset time, and a PE4/SW pin of the control chip detects a low level lasting for the first preset time, the PE5 pin is controlled to output the low level, and the power-off state is switched;

(3) when the whole system is in a startup state, the key switch is pressed for a short time, and the PE4/SW pin of the control chip detects a low level lasting for a second preset time, the control chip enters a function setting state, for example, cleaning is started/suspended, and further, different functions can be set by detecting the time that the key switch is pressed in the function setting state; it should be noted that, after the control chip enters the function setting state, the state of the PE5 pin of the control chip does not change, that is, the PE5 pin still outputs a high level, so as to maintain the normal operation of the switch unit;

(4) when the whole system is in a power-on state, if the key switch is not operated for a period of time, the control chip automatically enters a sleep state, and at the moment, the pin PE5 of the control chip still outputs a high level, namely, the normal operation of the switch unit is maintained. After the key switch is pressed for a short time, the PE4/SW pin of the control chip detects that the low level is maintained for a second preset time, and then the control chip is awakened.

In summary, the present application provides a multifunctional key switch circuit for an electronic product, the multifunctional key switch circuit includes a key switch, a system control unit, a power supply unit, and a switch unit; the system control unit is used for detecting different times of pressing the key switch to realize different functions; the power supply unit is used for supplying power to the multifunctional key switch circuit and the system; the switch unit is used for maintaining the continuous conduction of the whole circuit. The power supply unit is respectively connected with the switch unit and the key switch; the key switch is respectively connected with the power supply unit, the switch unit and the system control unit. This application can not only realize basic switching on and shutting down operation through a multi-functional key switch, can also realize other functions, has improved key switch's practicality, in the engineering application of reality, and is very useful.

It should be understood that equivalents and modifications to the disclosed embodiments and concepts herein disclosed may occur to persons skilled in the art and that such modifications and equivalents are deemed to fall within the scope and spirit of the claims appended hereto.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种抗单粒子翻转的DSP加固电路

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类