Dial switch circuit
By combining a DC-DC voltage regulator module and a microcontroller, the problems of battery compatibility and low battery warning in the DIP switch circuit are solved, achieving compatibility and stability with different batteries, and ensuring system reliability and data security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- YANTAI QICHUANG INTELLIGENT SOFTWARE TECHNOLOGY CO LTD
- Filing Date
- 2025-07-01
- Publication Date
- 2026-05-15
AI Technical Summary
Existing DIP switch circuits have voltage compatibility issues when powered by battery, making them incompatible with batteries from different manufacturers and models. Furthermore, they fail to provide warning signals when the battery is low, leading to abnormal system shutdown.
The system combines a DC-DC voltage regulator module and a microcontroller. The DC-DC voltage regulator module is adapted to different voltage levels, and the ADC terminal of the microcontroller monitors the voltage in real time, providing a low-power shutdown signal. The data is stored in the ARM module to ensure stable shutdown.
It achieves compatibility with different batteries, improves the system's operational stability and reliability, avoids data loss due to battery depletion, and extends the device's standby time.
Smart Images

Figure CN224248053U_ABST
Abstract
Description
Technical Field
[0001] This solution relates to the field of switching circuits, specifically a DIP switch circuit. Background Technology
[0002] Compared to directly set switches (such as traditional mechanical switches and touch switches), switches that control electrical appliances based on DIP switches have the following significant advantages in specific scenarios, especially suitable for scenarios that require multi-state configuration, prevention of accidental operation, or fixed parameter settings: for example, adjusting the working mode of electrical appliances (such as the fan speed setting or the energy-saving mode of an air conditioner), setting device addresses (such as the independent coding of multiple sensors in a smart home to avoid signal conflicts), and configuring complex parameters (such as the communication protocol and frequency segmentation of industrial equipment).
[0003] Most current DIP switch circuits are battery powered and are designed using a MOS + comparator scheme. Since the voltage of a single battery and multiple batteries connected in series are different, different MOS and comparators need to be selected.
[0004] In addition, current DIP switches often directly power off the device when switched to the power off position, which may cause malfunctions if the device is running a specific function.
[0005] In addition, the existing DIP switch circuit uses a resistor voltage divider method to set the battery's power-on threshold. Since the open-circuit voltage of batteries from different manufacturers and models is different, the power-on threshold is difficult to set and cannot be applied to all batteries.
[0006] Furthermore, the current design lacks the ability to provide a warning signal to the backend system when the battery is low and the system automatically shuts down, which may cause the system to shut down forcibly and potentially lead to system malfunctions. Summary of the Invention
[0007] The technical problem to be solved by this utility model is to provide a new DIP switch circuit.
[0008] The specific technical solution of this utility model to solve the above-mentioned technical problems is as follows:
[0009] A DIP switch circuit includes a power supply, a first DC-DC regulator module, a second DC-DC regulator module, a microcontroller, a DIP switch, and an ARM module. The power supply provides power to the entire system. The first DC-DC regulator module provides constant power to the microcontroller. The DIP switch is electrically connected to the KEY input terminal of the microcontroller. The microcontroller determines whether to enable the second DC-DC regulator module based on the position of the DIP switch. The second DC-DC regulator module provides stable power to the ARM module. The ARM module is used to execute a set program. The DIP switch is also electrically connected to the IO1 input terminal of the ARM module. After receiving a signal indicating that the DIP switch is open, the ARM module saves relevant information and shuts down. After receiving the signal indicating that the DIP switch is open, the microcontroller shuts down after a delay of T.
[0010] Compared to commonly used technologies in the market, the significant advantage of this solution lies in its ability to flexibly adapt to voltage levels ranging from 1.2V to 12V and even higher through the efficient conversion process between the first and second DC-DC regulator modules. This feature allows the solution to not only meet the needs of single-cell battery use but also easily handle complex application scenarios involving multiple battery combinations. More importantly, this solution significantly relaxes the requirements for the battery's open-circuit voltage, no longer limiting it to strict voltage constraints. This fundamentally improves the operational stability and reliability of the entire system, providing a solid guarantee for the continuous and stable power supply of various electronic devices.
[0011] Furthermore, the ADC terminal of the microcontroller is also electrically connected to the power supply via a voltage divider circuit to detect the voltage of the power supply. If the power supply voltage is lower than a set threshold, the microcontroller sends a low power shutdown signal to the IO2 input terminal of the ARM via the nkill output terminal. After receiving the low power shutdown signal, the ARM saves the relevant information and shuts down.
[0012] The microcontroller's ADC terminal is connected to the power supply via a voltage divider circuit to monitor the power supply voltage status in real time. Once the power supply voltage drops below a preset safety threshold, the microcontroller responds quickly by sending an emergency low-battery shutdown signal to the ARM's IO2 input via its nkill output. Upon receiving this critical signal, the ARM module immediately initiates a data saving program to ensure all important data is properly stored, and then performs a shutdown operation, effectively avoiding the risk of data loss due to forced shutdown caused by depleted power.
[0013] Furthermore, the microcontroller is selected as a low-power microcontroller, that is, a microcontroller with a static current of less than 100μA.
[0014] Furthermore, the KEY input terminal is internally connected to a high potential via a pull-up resistor.
[0015] Furthermore, the nkill output terminal of the microcontroller outputs a high level by default, and when the voltage detected by the ADC terminal is lower than a set threshold, the nkill output terminal outputs a low level.
[0016] Furthermore, the first DC-DC regulator module is a low-power module, that is, a DC-DC regulator module with a current of less than 100μA when in no-load standby mode.
[0017] Furthermore, the ADC terminal of the ARM is electrically connected to the power supply via a voltage divider circuit to detect the voltage of the power supply. If the power supply voltage is lower than a set threshold, the ARM saves the relevant information and shuts down.
[0018] Since the first DC-DC regulator module and the microcontroller module are continuously operating after the circuit is powered on, the selection of a low-power microcontroller and a low-power first DC-DC regulator module reduces the overall system's energy consumption, extends the standby time of electronic devices, and improves the user experience. The KEY input terminal is internally connected to a high potential via a pull-up resistor; this design enhances signal stability and ensures the accuracy of the DIP switch operation. The microcontroller's nkill output terminal outputs a high level by default, only switching to a low level when the voltage detected by the ADC terminal falls below a preset safety threshold. This mechanism effectively achieves real-time monitoring and response to power supply status. Attached Figure Description
[0019] Figure 1 This is a circuit diagram of the DIP switch in Embodiment 1 of this utility model.
[0020] Figure 2 This is a circuit diagram of the DIP switch in Embodiment 2 of this utility model. Detailed Implementation
[0021] The principles and features of this utility model are described below with reference to the accompanying drawings. The examples given are only for explaining this utility model and are not intended to limit the scope of this utility model.
[0022] Example 1:
[0023] like Figure 1 As shown, battery BAT1 supplies power to microcontroller U2 through the first DC-DC voltage regulator module U1.
[0024] The KEY input terminal of microcontroller U2 is electrically connected to DIP switch KEY1, and the state of DIP switch KEY1 is monitored in real time. The KEY pin of microcontroller U2 is internally pulled up to a high potential via a pull-up resistor. When DIP switch KEY1 is open, the KEY pin of microcontroller U2 detects a high level, and then the EN OUT pin of microcontroller U2 outputs a low level. The second DC-DC regulator module U3 does not work, and the entire system has no power. When DIP switch KEY1 is on, the KEY pin of microcontroller U2 is pulled low, the EN OUT pin of microcontroller U2 outputs a high level, and the second DC-DC regulator module U3 outputs a stable system power supply, providing power to the ARM module U4, and the ARM module U4 begins to work.
[0025] The nkill pin of microcontroller U2 outputs a high level by default. The ADC terminal of microcontroller U2 monitors the voltage of battery BAT1 in real time through voltage divider resistors R1 and R2. During normal system operation, if the voltage of battery BAT1 is lower than a certain set threshold, it means that the battery power is too low. At this time, microcontroller U2 sets the nkill pin to a low level based on its internal logic. This signal is input to ARM module U4 through the IO2 port, which is equivalent to informing ARM module U4 that the voltage of battery BAT1 is too low and that it will shut down in T seconds. At this time, ARM module U4 immediately executes the internal logic to save relevant information and then shuts down to avoid sudden power failure of the system.
[0026] During normal system operation, the DIP switch KEY1 changes from on to off. At this time, IO1 of the ARM module U4 and the KEY pin of the microcontroller U2 detect this information. The ARM module U4 immediately saves the relevant information. After T seconds, the EN OUT pin of the microcontroller U2 outputs a low value, the second DC-DC regulator module U3 stops outputting system power, and the ARM module U4 loses its power supply. The setting of "T" here must be based on the actual time taken for the ARM module U4 to store the necessary information and safely shut down, ensuring that the ARM module U4 can complete the storage of the necessary information and safely shut down after receiving the shutdown signal.
[0027] Since the first DC-DC voltage regulator module U1 and the microcontroller U2 are always working after the battery BAT1 is inserted, we need to find a low-power, low-quiescent-current chip, that is, a chip with a quiescent current of less than 100μA.
[0028] Example 2:
[0029] The difference between this embodiment and Comparative Document 1 is that the ARM chip's ADC directly acquires the analog voltage signal from the voltage divider circuit. If the ARM chip determines that the battery voltage is lower than a set threshold, it immediately stores the necessary data and executes the shutdown procedure. Additionally, the ARM chip sends a signal to the nkill pin of the microcontroller U2 via IO2. When the microcontroller U2 detects a low level at the nkill pin, it shuts down the second DC-DC regulator module U3 after a set delay, thus powering off the entire system.
[0030] In this example, the first DC-DC voltage regulator module U1 is the SGM62118 from Saint-Gobain Microelectronics, and the microcontroller U2 is the LS8E10118T-D from Anhui Lingsi Intelligent Technology Co., Ltd.
[0031] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A DIP switch circuit, characterized in that, The system includes a power supply, a first DC-DC regulator module, a second DC-DC regulator module, a microcontroller, a DIP switch, and an ARM module. The power supply provides power to the entire system. The first DC-DC regulator module provides constant power to the microcontroller. The DIP switch is electrically connected to the KEY input terminal of the microcontroller. The microcontroller determines whether to enable the second DC-DC regulator module based on the position of the DIP switch. The second DC-DC regulator module provides stable power to the ARM module. The ARM module is used to execute a set program. The DIP switch is also electrically connected to the IO1 input terminal of the ARM module. After receiving a signal that the DIP switch is open, the ARM module saves relevant information and shuts down. After receiving the signal that the DIP switch is open, the microcontroller shuts down after a delay of T.
2. The DIP switch circuit according to claim 1, characterized in that, The ADC terminal of the microcontroller is also electrically connected to the power supply via a voltage divider circuit to detect the voltage of the power supply. If the power supply voltage is lower than a set threshold, the microcontroller sends a low power shutdown signal to the IO2 input terminal of the ARM via the nkill output terminal. After receiving the low power shutdown signal, the ARM saves the relevant information and shuts down.
3. The DIP switch circuit according to claim 2, characterized in that, The microcontroller selected is a low-power microcontroller.
4. The DIP switch circuit according to any one of claims 1-3, characterized in that, The KEY input terminal is internally connected to a high potential via a pull-up resistor.
5. The DIP switch circuit according to any one of claims 1-3, characterized in that, The microcontroller's nkill output terminal outputs a high level by default. When the voltage detected by the microcontroller's ADC terminal is lower than a set threshold, the nkill output terminal outputs a low level.
6. The DIP switch circuit according to claim 5, characterized in that, The first DC-DC voltage regulator module is a low-power module.
7. The DIP switch circuit according to claim 1, characterized in that, The ADC terminal of the ARM is electrically connected to the power supply via a voltage divider circuit to detect the voltage of the power supply. If the power supply voltage is lower than a set threshold, the ARM saves the relevant information and shuts down.