Toggle switch and electronic circuit thereof

By designing an electronic circuit of a toggle switch and using a microcontroller to connect multiple control circuits and ports, the problem of waste in the traditional toggle switch design IO port is solved, and the saving of IO port and the simplification of circuit design is achieved.

CN222825814UActive Publication Date: 2025-05-02SHENZHEN TENGXIN ELECTRONIC TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202421418373.6
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2025-05-02
Estimated Expiration
2034-06-20

AI Technical Summary

Technical Problem

The traditional multi-speed toggle switch design requires an independent IO port to be assigned to each control gear, which makes it inadequately economical and efficient in case of space limitations and limited IO ports.

Method used

By designing an electronic circuit of a toggle switch, a microcontroller is used to connect the reading port, the first control port and the second control port, and combining the first control circuit, the second control circuit, the third control circuit and the fourth control circuit, the toggle switch is connected to four control circuits, and the microcontroller read port is used to detect and respond to different gear statuses.

Benefits of technology

The status of three control gears is realized using one IO port to identify and respond to three control gears, thereby saving IO ports, reducing circuit board wiring complexity and reducing production costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN222825814U_ABST
    Figure CN222825814U_ABST
Patent Text Reader

Abstract

The utility model provides an electronic circuit of a toggle switch. The electronic circuit comprises a reading port, a single-chip microcomputer, a first control port and a second control port. One end of the single-chip microcomputer is connected with the reading port, and the other end of the single-chip microcomputer is connected with the first control port and the second control port; wherein the single chip microcomputer comprises a toggle switch, a first control circuit, a second control circuit, a third control circuit and a fourth control circuit, the first control port is connected with the first control circuit, and the second control port is connected with the fourth control circuit. Four control circuits are connected through a toggle switch, and different gear states are detected and responded through a single-chip microcomputer reading port. Therefore, the IO ports are saved, the wiring complexity on the circuit board is reduced, and the production cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of toggle switches, and in particular to a toggle switch and an electronic circuit of the toggle switch. Background Art

[0002] In modern electronic circuit design, toggle switches are a common user interface component widely used in various electronic devices to turn devices on and off and switch between different working modes. The simple operation and reliability of toggle switches make them one of the preferred components for designers.

[0003] At present, the traditional multi-position toggle switch design usually requires an independent IO port to be allocated for each control position so that the microcontroller can recognize and respond to the user's switching operation. For example, a three-position toggle switch needs to occupy three IO ports in the traditional connection method, corresponding to the three different gear states of the switch. Although it can meet the adjustment requirements when the IO port resources are sufficient, in many application scenarios, especially when the circuit board space is limited and the number of IO ports of the microcontroller is limited, this traditional connection method is not economical and efficient enough.

[0004] Therefore, for a board with small space and single-chip computer IO port, there is an urgent need for a toggle switch and an electronic circuit of the toggle switch that can save the use of the IO port. Utility Model Content

[0005] In view of this, it is necessary to provide an electronic circuit that can save IO ports for a toggle switch to solve the above problem.

[0006] An embodiment of the present application provides an electronic circuit of a toggle switch, comprising:

[0007] A read port, a single chip microcomputer, a first control port and a second control port;

[0008] One end of the single chip microcomputer is connected to the read port, and the other end is connected to the first control port and the second control port;

[0009] Wherein, the single chip computer includes a toggle switch, a first control circuit, a second control circuit, a third control circuit and a fourth control circuit, the first control port is connected to the first control circuit, and the second control port is connected to the fourth control circuit;

[0010] Toggle the toggle switch to connect the first control circuit with the third control circuit to form a first control gear, toggle the toggle switch to connect the second control circuit with the third control circuit to form a second control gear, and toggle the toggle switch to connect the third control circuit with the fourth control circuit to form a third control gear.

[0011] In at least one embodiment of the present application, the single-chip microcomputer also includes a first interface, a second interface, a third interface and a fourth interface from top to bottom, and the toggle switch is connected to any two interfaces at intervals; toggle the toggle switch to connect the first interface with the third interface to form the first control gear; toggle the toggle switch to connect the second interface with the third interface to form the second control gear; toggle the toggle switch to connect the third interface with the fourth interface to form the third control gear.

[0012] In at least one embodiment of the present application, the first control circuit includes a resistor R1 and a first power module, one end of the resistor R1 is connected to the first interface, and the other end is connected to the first power module.

[0013] In at least one embodiment of the present application, the fourth control circuit includes a resistor R2 and a second power module, one end of the resistor R2 is connected to the fourth interface, and the other end is connected to the second power module.

[0014] In at least one embodiment of the present application, the third control circuit is connected to ground.

[0015] In at least one embodiment of the present application, the voltage of the first power module is 4.2V.

[0016] In at least one embodiment of the present application, the voltage of the second power module is 4.2V.

[0017] In at least one embodiment of the present application, the single chip microcomputer also includes a fifth interface, a sixth interface, a seventh interface and an eighth interface, and the fifth interface, the sixth interface, the seventh interface and the eighth interface correspond to the first interface, the second interface, the third interface and the fourth interface respectively.

[0018] In at least one embodiment of the present application, the third interface includes a first connection end and a second connection end, and the first connection end is connected to the second connection end.

[0019] In at least one embodiment of the present application, a toggle switch includes a housing, a circuit board and the electronic circuit disposed in the housing.

[0020] The electronic circuit of the toggle switch provided above, by setting a reading port connected to the single-chip microcomputer, a first control port and a second control port, enables the single-chip microcomputer to judge the change of the gear position according to the change of the first control port and the fourth control port. By setting the first control circuit, the second control circuit, the third control circuit and the fourth control circuit, the toggle switch is toggled to connect the two control circuits, so that the level signal of the first connection port and the second connection port changes. Four control circuits are connected through a toggle switch, and different gear states are detected and responded to through the single-chip microcomputer reading port. Using one IO port can realize the recognition and response of three control gears, thereby saving IO ports, thereby reducing the wiring complexity on the circuit board and reducing production costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 This is an electronic circuit diagram of a toggle switch in an embodiment of the present application.

[0022] Figure 2 is a circuit diagram of a first control circuit, a second control circuit, a third control circuit and a fourth control circuit in an embodiment of the present application.

[0023] Figure 3 This is a circuit diagram of the first control gear in an embodiment of the present application.

[0024] Figure 4 This is a circuit diagram of the second control gear in an embodiment of the present application.

[0025] Figure 5 This is a circuit diagram of the third control gear in the embodiment of the present application.

[0026] Main component symbols

[0027] 100. electronics; 11. first control gear; 12. second control gear; 13. third control gear; 20. single chip microcomputer; 21. toggle switch; 22. first control circuit; 221. first power supply module; 23. second control circuit; 24. third control circuit; 25. fourth control circuit; 251. second power supply module; KEY1. first control port; KEY2. second control port; 1. first interface; 2. second interface; 3. third interface; 4. fourth interface; 5. fifth interface; 6. sixth interface; 7. seventh interface; 8. eighth interface; 31. first connection terminal; 32. second connection terminal. DETAILED DESCRIPTION

[0028] The embodiments of the present application will be described below in conjunction with 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.

[0029] It should be noted that when a component is considered to be "connected" to another component, it may be directly connected to the other component or there may be a central component at the same time. When a component is considered to be "located on" another component, it may be directly located on the other component or there may be a central component at the same time. The terms "top", "bottom", "upper", "lower", "left", "right", "front", "back", and similar expressions used herein are for illustrative purposes only.

[0030] An embodiment of the present application provides an electronic circuit of a toggle switch, comprising:

[0031] A read port, a single chip microcomputer, a first control port and a second control port;

[0032] One end of the single chip microcomputer is connected to the read port, and the other end is connected to the first control port and the second control port;

[0033] Wherein, the single chip computer includes a toggle switch, a first control circuit, a second control circuit, a third control circuit and a fourth control circuit, the first control port is connected to the first control circuit, and the second control port is connected to the fourth control circuit;

[0034] Toggle the toggle switch to connect the first control circuit with the third control circuit to form a first control gear, toggle the toggle switch to connect the second control circuit with the third control circuit to form a second control gear, and toggle the toggle switch to connect the third control circuit with the fourth control circuit to form a third control gear.

[0035] Four control circuits are connected through a toggle switch, and different gear states are detected and responded to through the microcontroller reading port. Using one IO port can realize the recognition and response of three control gears, thus saving IO ports, thus reducing the wiring complexity on the circuit board and reducing production costs.

[0036] Some embodiments of the present application are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0037] according to Figure 1-Figure 5 In an embodiment of the present application, a device is provided including a read port, a single chip microcomputer 20, a first control port KEY1 and a second control port KEY2; one end of the single chip microcomputer 20 is connected to the read port, and the other end is connected to the first control port KEY1 and the second control port KEY2.

[0038] The single chip computer 20 includes a toggle switch 21, a first control circuit 22, a second control circuit 23, a third control circuit 24 and a fourth control circuit 25, the first control port KEY1 is connected to the first control circuit 22, and the second control port KEY2 is connected to the fourth control circuit 25;

[0039] Toggle the toggle switch 21 to connect the first control circuit 22 with the third control circuit 24 to form a first control gear 11, toggle the toggle switch 21 to connect the second control circuit 23 with the third control circuit 24 to form a second control gear 12, toggle the toggle switch 21 to connect the third control circuit 24 with the fourth control circuit 25 to form a third control gear 13.

[0040] Specifically, the read port is the interface for the single-chip microcomputer 20 to interact with the outside world, which is used to receive signals and process them. The first control port KEY1 and the second control port KEY2 are the physical connection points between the single-chip microcomputer 20 and the toggle switch 21, which are used to transmit control signals. The first control circuit 22, the second control circuit 23, the third control circuit 24 and the fourth control circuit 25 are logic units inside the single-chip microcomputer 20, which are responsible for performing specific operations according to the received signals. The first control gear 11, the second control gear 12 and the third control gear 13 are the states of the toggle switch 21 in different positions. By defining different control gears, the current state of the switch can be intuitively understood, and corresponding operations can be performed accordingly.

[0041] Furthermore, by toggling the toggle switch 21, the control circuits are connected in pairs, so that the level signals of the first connection terminal 31 and the second connection terminal 32 change, and different level signals are read through a single IO port, i.e., a reading port, to determine the states of three different control gears, thereby saving IO ports.

[0042] In summary, the toggle switch 21 is toggled to connect the first control circuit 22 and the third control circuit 24. At this time, the level signal of the first connection terminal 31 connected to the first control circuit 22 decreases, and the level signal of the second connection terminal 32 increases. The read port transmits the signal to the single-chip microcomputer 20 according to the change of the level signal, and the single-chip microcomputer 20 determines and recognizes it as the first control gear 11. When the toggle switch 21 is toggled to connect the second control circuit 23 and the third control circuit 24, at this time, the level signals of the first connection terminal 31 and the second connection terminal 32 are both increased. The read port transmits the signal to the single-chip microcomputer 20 according to the change of the level signal, and the single-chip microcomputer 20 determines and recognizes it as the second control gear 12. When the toggle switch 21 is toggled to connect the third control circuit 24 and the fourth control circuit 25, at this time, the level signal of the first connection terminal 31 increases, and the level signal of the second connection terminal 32 decreases. The read port transmits the signal to the single-chip microcomputer 20 according to the change of the level signal, and the single-chip microcomputer 20 determines and recognizes it as the third control gear 13. This will achieve the need to save IO ports.

[0043] In a specific embodiment, the single chip computer 20 also includes a first interface 1, a second interface 2, a third interface 3 and a fourth interface 4 from top to bottom, and the toggle switch 21 is connected to any two interfaces at intervals; toggle the toggle switch 21 to connect the first interface 1 with the third interface 3 to form the first control gear 11; toggle the toggle switch 21 to connect the second interface 2 with the third interface 3 to form the second control gear 12; toggle the toggle switch 21 to connect the third interface 3 with the fourth interface 4 to form the third control gear 13.

[0044] Specifically, when the toggle switch 21 connects the first interface 1 with the third interface 3, the circuit enters the first control gear 11. When the toggle switch 21 connects the second interface 2 with the third interface 3, the circuit switches to the second control gear 12. When the toggle switch 21 connects the third interface 3 with the fourth interface 4, the circuit switches to the third control gear 13. Through different interface connection combinations, the toggle switch 21 can form multiple control gears, each gear corresponding to a different circuit state or working mode

[0045] In a specific embodiment, the first control circuit 22 includes a resistor R1 and a first power module 221 . One end of the resistor R1 is connected to the first interface 1 , and the other end of the resistor R1 is connected to the first power module 221 .

[0046] Specifically, the resistor R1 is an upper resistor to ensure that the input pin remains in a high level state when there is no input signal. In the first control circuit 22, R1 is used as a pull-up resistor to pull the level of the first port up to a high level state.

[0047] In a specific embodiment, the fourth control circuit 25 includes a resistor R2 and a second power module 251 . One end of the resistor R2 is connected to the fourth interface 4 , and the other end of the resistor R2 is connected to the second power module 251 .

[0048] Specifically, the resistor R2 is an upper resistor to ensure that the input pin remains in a high level state when there is no input signal. In the fourth control circuit 25, R2 is used as a pull-up resistor to pull the level of the second port to a high level state.

[0049] In a specific embodiment, the third control circuit 24 is connected to ground.

[0050] Specifically, when the toggle switch 21 connects the first control circuit 22 and the third control circuit 24, the first interface 1 and the third interface 3 are turned on, so that the first control port KEY1 connected to the first control circuit 22 is connected to the ground, thereby pulling the level of the first control port KEY1 down to close to 0V. When the toggle switch 21 connects the second control circuit 23 and the third control circuit 24, the second interface 2 and the third interface 3 are turned on. At this time, the first control port KEY1 and the second control port KEY2 are affected by the resistor R1 and the resistor R2, resulting in the level of the first control port KEY1 and the second control port KEY2 being pulled up to close to the power supply voltage. When the toggle switch 21 is connected to the third control circuit 24 and the fourth control circuit 25, at this time, the second control port KEY2 is connected to the ground, so that the level of the second control port KEY2 is pulled down to 0V.

[0051] In a specific embodiment, the voltage of the first power module 221 is 4.2V; the voltage of the second power module 251 is 4.2V.

[0052] Specifically, the 4.2V power supply voltage is used to provide the voltage required by the pull-up resistors R1 and R2 to ensure that when the toggle switch 21 is in different positions, the read port of the single-chip microcomputer 20 can correctly read the high level or low level state. When the toggle switch 21 stays at the first control gear position 11, the second control gear position 12, and the third control gear position 13, different interfaces will be turned on, thereby changing the level state of the first port and the second port, and the single-chip microcomputer 20 determines the current switch position by identifying these level states.

[0053] In a specific embodiment, the single chip computer 20 also includes a fifth interface 5, a sixth interface 6, a seventh interface 7 and an eighth interface 8, and the fifth interface 5, the sixth interface 6, the seventh interface 7 and the eighth interface 8 correspond to the first interface 1, the second interface 2, the third interface 3 and the fourth interface 4 respectively.

[0054] Specifically, the fifth interface 5, the sixth interface 6, the seventh interface 7 and the eighth interface 8 are preset connection points on the single-chip microcomputer 20, which respectively correspond to the first interface 1, the second interface 2, the third interface 3 and the fourth interface 4. Providing more interfaces enables the single-chip microcomputer 20 to connect more external devices or circuit modules, thereby increasing the scalability and versatility of the system.

[0055] In a specific embodiment, the third interface 3 includes a first connection end 31 and a second connection end 32 , and the first connection end 31 is connected to the second connection end 32 .

[0056] Specifically, the third interface 3 has two connected connection ends. When the toggle switch 21 is in the first control gear position 11, one end of the toggle switch 21 is connected to the first interface 1, and the other end is connected to the first connection end 31. When the toggle switch 21 is in the second control gear position 12, one end of the toggle switch 21 is connected to the second interface 2, and the other end is connected to the second connection end 32. When the toggle switch 21 is in the third control gear position 13, one end of the toggle switch 21 is connected to the second connection end 32, and the other end is connected to the fourth interface 4. By toggling the toggle switches 21 connected at intervals, the connection mode of the circuit is flexibly configured to reduce the connections between circuits, thereby adapting to different circuit design requirements.

[0057] In a specific embodiment, a toggle switch 21 includes a housing, a circuit board and the electronic circuit 100 disposed in the housing.

[0058] Specifically, the housing is a housing that provides protection for the circuit board and the electronic circuit 100 , and the state of the switch is changed by toggling the external operation interface of the switch 21 (such as sliding or rotating).

[0059] Thus, four control circuits are connected through a toggle switch 21, and different gear states are detected and responded to through the single chip microcomputer 20 reading port. Using one IO port can realize the recognition and response of three control gears, thereby saving IO ports, thus reducing the wiring complexity on the circuit board and reducing the production cost.

[0060] The above is only an implementation method of the present application. It should be pointed out that a person skilled in the art can make improvements without departing from the inventive concept of the present application, but these improvements are within the scope of protection of the present application.

Claims

1. An electronic circuit of a toggle switch, characterized in that: include: A read port, a single chip microcomputer, a first control port and a second control port; One end of the single chip microcomputer is connected to the read port, and the other end is connected to the first control port and the second control port; Wherein, the single chip computer includes a toggle switch, a first control circuit, a second control circuit, a third control circuit and a fourth control circuit, the first control port is connected to the first control circuit, and the second control port is connected to the fourth control circuit; Toggle the toggle switch to connect the first control circuit with the third control circuit to form a first control gear, toggle the toggle switch to connect the second control circuit with the third control circuit to form a second control gear, and toggle the toggle switch to connect the third control circuit with the fourth control circuit to form a third control gear.

2. The electronic circuit of a toggle switch according to claim 1, characterized in that: The single chip computer further includes a first interface, a second interface, a third interface and a fourth interface from top to bottom, and the toggle switch is connected to any two interfaces at intervals; Toggle the toggle switch to connect the first interface with the third interface to form the first control gear position; Toggle the toggle switch to connect the second interface with the third interface to form the second control gear position; The toggle switch is toggled to connect the third interface with the fourth interface to form the third control gear.

3. The electronic circuit of a toggle switch according to claim 2, characterized in that: The first control circuit includes a resistor R1 and a first power module. One end of the resistor R1 is connected to the first interface, and the other end is connected to the first power module.

4. The electronic circuit of a toggle switch according to claim 2, characterized in that: The fourth control circuit includes a resistor R2 and a second power module. One end of the resistor R2 is connected to the fourth interface, and the other end is connected to the second power module.

5. The electronic circuit of a toggle switch according to claim 1, characterized in that: The third control circuit is connected to ground.

6. The electronic circuit of a toggle switch according to claim 3, characterized in that: The voltage of the first power module is 4.2V.

7. The electronic circuit of a toggle switch according to claim 4, characterized in that: The voltage of the second power supply module is 4.2V.

8. The electronic circuit of a toggle switch according to claim 2, characterized in that: The single chip computer also includes a fifth interface, a sixth interface, a seventh interface and an eighth interface, and the fifth interface, the sixth interface, the seventh interface and the eighth interface correspond to the first interface, the second interface, the third interface and the fourth interface respectively.

9. The electronic circuit of a toggle switch according to claim 8, characterized in that: The third interface includes a first connection end and a second connection end, and the first connection end is connected to the second connection end.

10. A toggle switch, characterized in that: It comprises a housing, a circuit board arranged in the housing, and the electronic circuit as claimed in any one of claims 1 to 9.