Wide voltage switching value acquisition circuit
Through the combination of voltage-regulating diode and voltage divider network, combined with the transistor conduction and cut-off characteristics, the stability and accuracy of the wide voltage switching acquisition circuit are achieved, and the microcontroller port is protected, which solves the problems of voltage application limitations and signal distortion in the prior art.
Patent Information
- Application Number
- CN202510702002.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-08-19
AI Technical Summary
The existing switching quantity acquisition circuit cannot adapt to the wide voltage range, easily damage the microcontroller port and inaccurate signal acquisition in complex electromagnetic environments.
The circuit consisting of a voltage-regulating diode, voltage divider network, transistor, pull-up resistor and current limiting resistor is adopted to realize a wide voltage stable input, and the switching signal is converted through the on-off characteristics of the transistor to limit the current flowing into the microcontroller port.
It realizes stable switching quantity acquisition over a wide voltage range, protects the microcontroller port, ensures signal accuracy and circuit reliability, and reduces development costs.
Smart Images

Figure CN120507562A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial automation control, and in particular to a wide-voltage switching value acquisition circuit. Background Art
[0002] In many fields such as industrial automation, smart home, and power systems, switch quantity acquisition is a key link in obtaining equipment status information.
[0003] However, existing switch-value acquisition circuits have numerous shortcomings. They typically operate within a narrow voltage range. When the input voltage exceeds its rated range, the circuit fails to function properly and can even damage components, severely limiting its application in diverse power supply environments. Furthermore, in complex electromagnetic environments, external interference can easily cause deviations in the acquired switch-value signals, leading to erroneous judgments and control decisions by the system.
[0004] In addition, the existing circuit's protection mechanism for the back-end microcontroller port is not perfect. Excessive current may break down the microcontroller port, increasing the system's maintenance cost and failure risk.
[0005] Therefore, there is an urgent need for a circuit that can adapt to a wide voltage input range, accurately collect switch signals, and effectively protect the microcontroller port. Summary of the Invention
[0006] In view of this, the present invention proposes a wide voltage switch quantity acquisition circuit, which can achieve wide voltage stable input, accurately acquire switch quantity signals and effectively protect microcontroller ports.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] A wide voltage switch quantity acquisition circuit includes a voltage stabilizing diode, a voltage divider network, a transistor, a pull-up resistor, a current limiting resistor, and a microcontroller port connected in series. The voltage divider network includes a first voltage divider resistor and a second voltage divider resistor.
[0009] The cathode of the voltage stabilizing diode is connected to the positive electrode of the external power supply, and the anode of the voltage stabilizing diode is connected to the first voltage dividing resistor, and is used to stabilize the input voltage of the external power supply to obtain a regulated voltage;
[0010] The voltage divider network is used to divide the regulated voltage to obtain a divided voltage;
[0011] The triode comprises a base, an emitter and a collector;
[0012] The base is connected to the connection point A of the first voltage-dividing resistor and the second voltage-dividing resistor, and is used to receive the divided voltage. The emitter is grounded. The collector is pulled up by the pull-up resistor and connected to the microcontroller port through the current-limiting resistor, so as to limit the current flowing into the microcontroller port to a safe range.
[0013] Controlling the transistor to be turned on or off according to the divided voltage, when the transistor is turned on, a path is formed between the collector and the emitter, and the microcontroller port receives a low-level signal; when the transistor is turned off, an open circuit is formed between the collector and the emitter, the collector is connected to the power supply through the pull-up resistor, and the microcontroller port receives a high-level signal;
[0014] The microcontroller port is used to collect a wide voltage switching value based on the low level signal or the high level signal.
[0015] On the basis of the above technical solution, the present invention can also be improved as follows:
[0016] Optionally, the input voltage is a wide voltage range of 8V-40V.
[0017] Optionally, the voltage stabilizing diode is further used for:
[0018] Determine whether the input voltage exceeds a preset regulated voltage value; if so, enter a reverse breakdown state to stabilize the input voltage at the preset regulated voltage value.
[0019] Optionally, the breakdown voltage of the voltage stabilizing diode is 8.2V±5%, so as to ensure that the divided voltage at the connection point A is stabilized at 4.1V±5%.
[0020] Optionally, the maximum power consumption of the voltage stabilizing diode is 500 mW.
[0021] Optionally, the voltage divider network is further configured to:
[0022] Calculate the divided voltage using formula (1);
[0023]
[0024] Where, is the divided voltage, is the regulated voltage, is the resistance value of the first divided resistor, and is the resistance value of the second divided resistor;
[0025] By adjusting the resistance ratio of , different divided voltages can be obtained.
[0026] Optionally, the first voltage-dividing resistor and the second voltage-dividing resistor are 1% precision resistors with a temperature coefficient of ≤50ppm / °C.
[0027] Optionally, the transistor is further used for:
[0028] When the divided voltage forms a preset bias voltage between the base and the emitter, the transistor is turned on, the emitter is grounded, and the collector is pulled up to a 3.3V power supply through a pull-up resistor.
[0029] Optionally, the transistor is further used for:
[0030] When the base input signal generates base current, the base input signal is amplified according to the transistor current amplification factor;
[0031] The collector current is calculated by formula (2);
[0032] I C =β×I B Formula (2);
[0033] Where, is the collector current, is the transistor current amplification factor, and is the base current.
[0034] Optionally, the safety range is 0mA-3.3mA.
[0035] The present invention has the following advantages:
[0036] The wide voltage switch quantity acquisition circuit of the present invention realizes stable voltage reduction and voltage division of wide voltage input of 8-40V by combining a voltage stabilizing diode and a voltage divider network, breaking through the voltage applicability limitations of traditional circuits and greatly broadening the application scenarios; utilizing the conduction and cutoff characteristics of the transistor, the switch state is accurately converted into high and low level signals, ensuring that the microcontroller can stably and accurately acquire the switch quantity and avoid signal distortion; the pull-up resistor and the current limiting resistor work together to limit the current flowing into the microcontroller port to a safe range, effectively preventing the port from being damaged by excessive current, and improving the circuit reliability and service life; at the same time, the wide voltage switch quantity acquisition circuit of the present invention adopts common electronic components and has a simple structure. While ensuring high performance, it reduces development costs and maintenance difficulty, and is convenient for large-scale promotion and application. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] For purposes of illustration and not limitation, the present invention will now be described with reference to embodiments thereof and the accompanying drawings, in which:
[0038] Figure 1 Schematic diagram of a wide voltage switch value acquisition circuit in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to enable those skilled in the art to better understand the solutions of the present invention, 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 only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should fall within the scope of protection of the present invention.
[0040] It should be noted that the terms "first," "second," and the like in the description of the present invention and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate for the embodiments of the present invention described herein. In addition, the terms "including," "having," and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatuses.
[0041] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features thereof can be combined with each other. The embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0042] Figure 1 Schematic diagram of the main components of the wide voltage switch value acquisition circuit in the embodiment of the present invention. Figure 1 As shown, the wide voltage switch quantity acquisition circuit 1 provided in an embodiment of the present invention includes a voltage stabilizing diode 10, a voltage divider network 20, a transistor 30, a pull-up resistor 40, a current limiting resistor 50 and a microcontroller port 60 connected in series, and the voltage divider network includes a first voltage divider resistor 201 and a second voltage divider resistor 202.
[0043] This wide-voltage switching signal acquisition circuit is designed to accurately acquire switching signals within a wide input voltage range of 8V-40V and convert them into high- and low-level signals that can be recognized by a microcontroller. The coordinated operation of the various components in the circuit ensures stable and reliable acquisition of switching signals under varying input voltage conditions.
[0044] The cathode of the Zener diode 10 is connected to the positive terminal of the external power supply, and the anode is connected to the first voltage-divider resistor 201. Its primary function is to stabilize the input voltage between 8V and 40V. When the input voltage exceeds the preset regulated value (8.2V ± 5%), it enters a reverse breakdown state, stabilizing the input voltage at the preset regulated value and ensuring that subsequent circuits operate in a stable voltage environment. The maximum power consumption of the Zener diode 10 is 500mW. This parameter limit ensures that the Zener diode 10 will not be damaged by excessive power during normal operation.
[0045] The voltage divider network 20 is composed of a first voltage divider resistor 201 and a second voltage divider resistor 202, which is used to divide the regulated voltage output by the voltage-stabilizing diode 10 to obtain a divided voltage. The divided voltage is calculated using formula (1);
[0046]
[0047] Where, U is the divided voltage, U total is the regulated voltage, R1 is the resistance value of the first voltage-dividing resistor 201, and R2 is the resistance value of the second voltage-dividing resistor 202;
[0048] The first and second voltage-divider resistors 201 and 202 are 1% precision resistors with a temperature coefficient of ≤50ppm / °C. This ensures the accuracy and stability of the divided voltage, minimizing the effects of temperature and other factors. Furthermore, by adjusting the resistance ratio of R1 and R2, different divided voltages can be achieved to meet different circuit requirements.
[0049] The base of transistor 30 is connected to the connection point A between the first and second voltage-dividing resistors 201 and 202, and receives the divided voltage. When the divided voltage creates a preset bias voltage between the base and emitter, transistor 30 turns on, a path is formed between the collector and emitter, and microcontroller port 60 receives a low-level signal. When the divided voltage is insufficient to form the preset bias voltage, transistor 30 turns off, an open circuit is formed between the collector and emitter, and the collector is connected to the 3.3V power supply via pull-up resistor 40, and microcontroller port 60 receives a high-level signal.
[0050] When the base input signal generates a base current, the base input signal is amplified according to the current amplification factor β of the transistor 30;
[0051] The collector current is calculated by formula (2);
[0052] I C =β×I B Formula (2);
[0053] Where, I C is the collector current, β is the transistor 30 current amplification factor, I Bis the base current.
[0054] Pull-up resistor 40: pulls up the collector of transistor 30 to 3.3V power supply, ensuring that the collector outputs a high-level signal when transistor 30 is turned off.
[0055] Current limiting resistor 50 : connected between the collector and the microcontroller port 60 , used to limit the current flowing into the microcontroller port 60 to a safe range of 0 mA-3.3 mA, to prevent excessive current from damaging the microcontroller port 60 .
[0056] Microcontroller port 60: Based on the received high and low level signals, it collects wide voltage switching quantities to provide a basis for subsequent control and processing.
[0057] The signal processing process of the wide voltage switch quantity acquisition circuit is as follows:
[0058] When an external wide voltage of 8V-40V is input into the circuit, it is first stabilized by the voltage stabilizing diode 10 to stabilize the voltage at 8.2V±5%.
[0059] The stabilized voltage enters the voltage divider network 20 and is divided by the first voltage divider resistor 201 and the second voltage divider resistor 202 to obtain a divided voltage.
[0060] The divided voltage is input to the base of the transistor 30 to control the on / off state of the transistor 30. When the transistor 30 is on, the microcontroller port 60 receives a low level signal; when the transistor 30 is off, the microcontroller port 60 receives a high level signal.
[0061] The microcontroller port 60 completes the acquisition of wide voltage switching quantities based on the received high and low level signals.
[0062] In summary, the wide voltage switch quantity acquisition circuit realizes accurate acquisition of switch quantities under wide voltage input conditions through the coordinated work of various components, while ensuring the stability and reliability of the circuit and protecting the microcontroller port 60 from damage.
[0063] One embodiment is:
[0064] When the input voltage is 24V, the Zener diode limits the 24V input voltage to 8.2V. After being divided by the voltage divider network composed of R1 and R2, a voltage of 4.1V is obtained. This voltage turns on the transistor, and the collector voltage is about 0.3V, showing a low level state, representing a switching state.
[0065] When the input is 40V: the voltage regulator diode still maintains the voltage at 8.2V, and after voltage division it is still 4.1V, ensuring that the output voltage is stable at a low level, which shows the stability of the circuit output under different high input voltages.
[0066] Table 1
[0067]
[0068] As shown in Table 1, the measured waveform at the microcontroller port shows that the rise time does not exceed 10ns, indicating a fast signal rise speed; the pulse width distortion rate is less than 2%, indicating low signal distortion during transmission, ensuring signal accuracy and reliability.
[0069] Performance under different input voltages: At 8V input, the output level is 3.12V, and the power consumption is 0.64mW; at 24V input, the output level is 0.28V, and the power consumption is 2.15mW; at 40V input, the output level is 0.27V, and the power consumption is 3.89mW. This shows the output level and power consumption of the circuit under different input voltages, indicating that the circuit can adapt to a wide input voltage range and maintain power consumption within a certain range.
[0070] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A wide voltage switch quantity acquisition circuit, characterized in that: It includes a voltage-stabilizing diode, a voltage-dividing network, a transistor, a pull-up resistor, a current-limiting resistor, and a microcontroller port connected in series, wherein the voltage-dividing network includes a first voltage-dividing resistor and a second voltage-dividing resistor: The cathode of the voltage stabilizing diode is connected to the positive electrode of the external power supply, and the anode of the voltage stabilizing diode is connected to the first voltage dividing resistor, and is used to stabilize the input voltage of the external power supply to obtain a regulated voltage; The voltage divider network is used to divide the regulated voltage to obtain a divided voltage; The triode comprises a base, an emitter and a collector; The base is connected to the connection point A of the first voltage-dividing resistor and the second voltage-dividing resistor, and is used to receive the divided voltage. The emitter is grounded. The collector is pulled up by the pull-up resistor and connected to the microcontroller port through the current-limiting resistor, so as to limit the current flowing into the microcontroller port to a safe range. Controlling the transistor to be turned on or off according to the divided voltage, when the transistor is turned on, a path is formed between the collector and the emitter, and the microcontroller port receives a low-level signal; when the transistor is turned off, an open circuit is formed between the collector and the emitter, the collector is connected to the power supply through the pull-up resistor, and the microcontroller port receives a high-level signal; The microcontroller port is used to collect a wide voltage switching value based on the low level signal or the high level signal.
2. The wide voltage switch value acquisition circuit according to claim 1, characterized in that: The input voltage is a wide voltage range of 8V-40V.
3. The wide voltage switch value acquisition circuit according to claim 1, characterized in that: The voltage stabilizing diode is also used for: Determine whether the input voltage exceeds a preset regulated voltage value; if so, enter a reverse breakdown state to stabilize the input voltage at the preset regulated voltage value.
4. The wide voltage switch value acquisition circuit according to claim 1, characterized in that: The breakdown voltage of the voltage stabilizing diode is 8.2V±5%, so as to ensure that the divided voltage at the connection point A is stable at 4.1V±5%.
5. The wide voltage switch value acquisition circuit according to claim 1, characterized in that: The maximum power consumption of the voltage stabilizing diode is 500 mW.
6. The wide voltage switch value acquisition circuit according to claim 1, characterized in that: The voltage divider network is also used to: Calculate the divided voltage using formula (1); Where, U is the divided voltage, U total is the regulated voltage, R1 is the resistance value of the first voltage-dividing resistor, and R2 is the resistance value of the second voltage-dividing resistor; By adjusting the resistance ratio of R1 and R2, different divided voltages can be obtained.
7. The wide voltage switch value acquisition circuit according to claim 1, characterized in that: The first voltage-dividing resistor and the second voltage-dividing resistor are 1% precision resistors with a temperature coefficient of ≤50ppm / °C.
8. The wide voltage switch value acquisition circuit according to claim 1, characterized in that: The triode is also used for: When the divided voltage forms a preset bias voltage between the base and the emitter, the transistor is turned on, the emitter is grounded, and the collector is pulled up to a 3.3V power supply through a pull-up resistor.
9. The wide voltage switch value acquisition circuit according to claim 1, characterized in that: The triode is also used for: When the base input signal generates base current, the base input signal is amplified according to the transistor current amplification factor β; The collector current is calculated by formula (2); I C =β×I B Formula (2); Where, I C is the collector current, β is the transistor current amplification factor, I B is the base current.
10. The wide voltage switch value acquisition circuit according to claim 1, characterized in that: The safety range is 0mA-3.3mA.