Service switch detection circuit and detection method
By designing a service switch detection circuit, using the combination of the switch sub-circuit and the detection sub-circuit, the accurate identification and abnormal detection of the service switch status are achieved, and the difficulty in identification in the prior art is solved, and the detection efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202510160310.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2025-04-22
AI Technical Summary
The prior art is difficult to identify the trigger status of the service switch in a timely and accurate manner, especially when there is an abnormality in the switching circuit, which may lead to false triggering or failure to provide services in a timely manner.
A service switch detection circuit is designed, including a switch sub-circuit and a detection sub-circuit. The switching voltage is output through the switch sub-circuit composed of a resistor device and a target switch. The detection sub-circuit is composed of a transistor device, a resistor device and a capacitor device, and outputs an analog voltage value and level status signal according to the switching voltage, and jointly indicates the switching state.
It realizes accurate status recognition of service switches, including triggered, untriggered, short-circuited and suspended states, improves detection efficiency and accuracy, can provide timely functional services bound by service switches, and has abnormal detection functions, which are conducive to checking or repairing circuit abnormalities.
Smart Images

Figure CN119861282A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of automotive electronic technology, and in particular to a service switch detection circuit and a detection method. Background Art
[0002] With the development of intelligent cars, cars can be equipped with more service switches. When these service switches are triggered, they can provide preset vehicle function services. For example, when the vehicle has an accident or the owner encounters an emergency, the owner can press the emergency call (SOS) switch in the car to trigger the vehicle's emergency call service.
[0003] However, in the prior art, the traditional switch status detection method may not be able to timely and accurately identify whether a service switch is triggered, and it is even more difficult to deal with the situation where the switch circuit of the service switch is abnormal. If the switch status detection method is not accurate enough, it may not only trigger the vehicle function service by mistake, thereby wasting resources, but also fail to provide the vehicle function service to the owner in time when the owner needs it. Summary of the invention
[0004] In view of this, one or more embodiments of the present disclosure provide a service switch detection circuit and detection method, which can accurately identify the current state of the service switch and provide the user with the vehicle function service corresponding to the service switch in a timely manner.
[0005] In a first aspect, the present disclosure provides a service switch detection circuit, the service switch detection circuit comprising a switch subcircuit and a detection subcircuit, the output end of the switch subcircuit being connected to the input end of the detection subcircuit; the switch subcircuit being composed of a resistor device and a target switch, the switch subcircuit being used to output a switch voltage according to a switch state of the target switch; the detection subcircuit being composed of a transistor device, a resistor device and a capacitor device, the detection subcircuit being used to output an analog voltage value and a level status signal according to the switch voltage; the analog voltage value and the level status signal are used to jointly indicate the switch state of the target switch, the switch state comprising at least one of a triggered state, an untriggered state, a short circuit state and a suspended state.
[0006] The switch subcircuit is composed only of resistor devices and target switches, and the circuit structure is relatively simple, which can reduce hardware costs. The combination of analog voltage values and level status signals can accurately indicate the specific switch state of the target switch, which not only has high detection efficiency, but also does not require the introduction of complex software algorithms. The switch state includes not only normal working states of the switch such as the triggered state and the untriggered state, but also abnormal working states of the switch such as the short circuit state and the suspended state. In this way, not only can the triggering of the service switch be accurately detected, thereby providing the functional services bound to the service switch in a timely manner, but also the abnormal detection function of the service switch can be provided, which is conducive to troubleshooting or repairing circuit abnormalities of the service switch.
[0007] Optionally, the switch subcircuit is composed of a fourth resistor, a seventh resistor and the target switch; the fourth resistor is connected in parallel with the target switch to form a switch branch, the first end of the switch branch is the output end of the switch subcircuit, and the second end of the switch branch is grounded through the seventh resistor.
[0008] Based on the design of the fourth resistor and the target switch being connected in parallel, the output end of the switch subcircuit can output different switch voltages according to the on and off of the target switch. The switch branch is grounded through the seventh resistor, which can effectively reduce the interference signal in the switch subcircuit, reduce voltage fluctuations, and improve the stability of the switch voltage.
[0009] Optionally, the detection subcircuit includes a voltage branch and a level branch; the input end of the voltage branch and the input end of the level branch are commonly connected to the input end of the detection subcircuit; the voltage branch is used to output the analog voltage value according to the switching voltage; the level branch is used to output the level status signal according to the switching voltage.
[0010] Through the voltage branch and the level branch, two different types of output signals, analog voltage value and level state signal, can be obtained for the same switching voltage. This enables the detection subcircuit to meet the needs of accurate measurement of signal amplitude and the need to judge the logical state of the signal. The voltage detection and level detection functions are integrated in one detection subcircuit, reducing the complexity of the circuit and the number of components. Compared with designing two independent detection circuits separately, this integration method can reduce the size and cost of the circuit. Since the voltage branch and the level branch share the input terminal, their response to the input signal is synchronized, avoiding the problem of inconsistent output caused by signal transmission delay or noise interference, and improving the reliability and stability of the detection subcircuit.
[0011] Optionally, the voltage branch includes a first resistor, a fifth resistor, an eighth resistor, a ninth resistor and a Zener diode; the first resistor, the fifth resistor, the eighth resistor and the ninth resistor are connected in series, the first resistor is connected to a first power supply voltage terminal, and the ninth resistor is grounded; the middle node between the first resistor and the fifth resistor is the input terminal of the voltage branch, which is used to receive the switching voltage; the middle node between the fifth resistor and the eighth resistor is connected to the negative electrode of the Zener diode, and the positive electrode of the Zener diode is grounded; the middle node between the eighth resistor and the ninth resistor is the output terminal of the voltage branch, which is used to output the analog voltage value.
[0012] After the input end of the voltage branch receives the switch voltage, it can output an analog voltage value that matches the switch voltage. Since the switch voltage corresponds to the switch state of the target switch, the analog voltage value can indirectly indicate the switch state of the target switch. The main function of the Zener diode is to stabilize the voltage of the intermediate node, thereby providing a stable voltage environment for the input and output ends of the voltage branch. The voltage stabilizing characteristics of the Zener diode ensure that the voltage branch can still work normally when the switch voltage fluctuates.
[0013] Optionally, the level branch includes a second resistor, a third resistor, a sixth resistor, a switching diode and a PNP transistor; the emitter of the PNP transistor is connected to the second power supply voltage end, the collector of the PNP transistor is grounded through the sixth resistor, and the base of the PNP transistor is connected to the positive electrode of the switching diode through the third resistor; the cathode of the switching diode is the input end of the level branch, for receiving the switching voltage; one end of the second resistor is connected to the emitter of the PNP transistor, and the other end of the second resistor is connected to the base of the PNP transistor; the collector of the PNP transistor is the output end of the level branch, for outputting the level status signal.
[0014] After the input end of the level branch receives the switching voltage, it can output a level state signal that matches the switching voltage. Since the switching voltage corresponds to the switching state of the target switch, the level state signal can indirectly indicate the switching state of the target switch. The cathode of the switching diode is the input end of the level branch. According to the input switching voltage, it can be determined whether to provide a suitable bias current to the base of the PNP transistor. The PNP transistor mainly plays the role of level conversion, and can realize the conversion of the output level according to the state change of the switching voltage at the input end.
[0015] Optionally, the detection subcircuit includes a port capacitor, one end of the port capacitor is connected to the input end of the detection subcircuit, and the other end of the port capacitor is grounded.
[0016] Adding port capacitance at the input end of the detection subcircuit can play a role in noise filtering, signal coupling and isolation, circuit protection, and input signal stabilization, which is crucial to improving the performance and reliability of the detection subcircuit.
[0017] Optionally, the switch state for jointly indicating the target switch includes at least one of the following: when the level state signal is high and the analog voltage value is in a first numerical interval, it indicates that the target switch is in a state of short circuit to ground; when the level state signal is high and the analog voltage value is in a second numerical interval, it indicates that the target switch is in a switch triggered state; when the level state signal is low and the analog voltage value is in a third numerical interval, it indicates that the target switch is in a switch untriggered state; when the level state signal is low and the analog voltage value is in a fourth numerical interval, it indicates that the target switch is in a signal suspended state; when the level state signal is low and the analog voltage value is in a fifth numerical interval, it indicates that the target switch is in a state of short circuit to the switch supply voltage terminal.
[0018] Considering that the switch state includes not only normal working states of the switch such as the triggered state and the untriggered state, but also abnormal working states of the switch such as the short circuit state and the suspended state, the different working states of the target switch can be distinguished more accurately through the joint judgment of the level state signal and the analog voltage value. This joint judgment reduces the possibility of misjudgment and improves the accuracy of state judgment.
[0019] In a second aspect, the present disclosure provides a service switch detection method, the method comprising: obtaining an analog voltage value and a level status signal output by a service switch detection circuit; jointly determining a switch state of a target switch according to the current state of the level status signal and the analog voltage value, the switch state comprising at least one of a triggered state, an untriggered state, a short circuit state, and a suspended state; wherein the service switch detection circuit comprises a switch subcircuit and a detection subcircuit, the output end of the switch subcircuit being connected to the input end of the detection subcircuit; the switch subcircuit is composed of a resistor device and the target switch, the switch subcircuit being used to output a switch voltage according to the switch state of the target switch; the detection subcircuit is composed of a transistor device, a resistor device, and a capacitor device, the detection subcircuit being used to output the analog voltage value and the level status signal according to the switch voltage.
[0020] Through the joint judgment of the level state signal and the analog voltage value, the different working states of the target switch can be accurately distinguished. This joint judgment reduces the possibility of misjudgment and improves the accuracy of state judgment. On this basis, not only can the triggering of the service switch be accurately detected, so as to provide the functional service bound to the service switch in a timely manner, but also the abnormality detection function of the service switch can be provided, which is conducive to troubleshooting or repairing the circuit abnormality of the service switch.
[0021] Optionally, the joint determination of the switch state of the target switch includes at least one of the following: when the level state signal is a high level and the analog voltage value is in a first numerical interval, the target switch is determined to be in a state of short circuit to ground; when the level state signal is a high level and the analog voltage value is in a second numerical interval, the target switch is determined to be in a switch triggered state; when the level state signal is a low level and the analog voltage value is in a third numerical interval, the target switch is determined to be in a switch untriggered state; when the level state signal is a low level and the analog voltage value is in a fourth numerical interval, the target switch is determined to be in a signal hanging state; when the level state signal is a low level and the analog voltage value is in a fifth numerical interval, the target switch is determined to be in a state of short circuit to the switch supply voltage terminal.
[0022] In a third aspect, the present disclosure provides a car, comprising a service switch detection circuit provided by any optional implementation of the first aspect.
[0023] The technical solution provided by one or more embodiments of the present disclosure can detect a level state signal and an analog voltage value according to different states of the service switch. Through the combined analysis of the level state signal and the analog voltage value, the current switch state of the service switch can be accurately identified, including the normal working state and the abnormal working state. On the one hand, the triggering of the service switch can be accurately detected, so as to provide the functional service bound to the service switch in a timely manner. On the other hand, the abnormal working state of the service switch can also be effectively detected, which is convenient for troubleshooting or repairing the circuit abnormality of the service switch.
[0024] The technical solution provided by one or more embodiments of the present disclosure has the advantages of simple circuit structure, low hardware cost, and small software resource requirement. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The features and advantages of the embodiments of the present disclosure will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present disclosure in any way. In the accompanying drawings:
[0026] Figure 1 A schematic diagram showing the composition structure of a service switch detection circuit in one embodiment of the present disclosure is shown;
[0027] Figure 2 A circuit structure diagram of a service switch detection circuit in one embodiment of the present disclosure is shown;
[0028] Figure 3 A schematic diagram of the method steps of a service switch detection method in one embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0030] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information.
[0031] The service switch detection circuit provided in one embodiment of the present disclosure can be applied to various electronic devices with data processing capabilities, including but not limited to personal computers, automotive electronic components, robots, factory automation equipment, and smart home devices.
[0032] See also Figure 1 A service switch detection circuit provided in one embodiment of the present disclosure may include a switch subcircuit and a detection subcircuit, wherein the output end of the switch subcircuit is connected to the input end of the detection subcircuit.
[0033] In this embodiment, the switch subcircuit is composed of a resistor device and a target switch, and the switch subcircuit is used to output a switch voltage according to the switch state of the target switch. The detection subcircuit is composed of a transistor device, a resistor device and a capacitor device, and the detection subcircuit is used to output an analog voltage value and a level state signal according to the switch voltage. The analog voltage value and the level state signal are used to jointly indicate the switch state of the target switch, and the switch state includes at least one of a triggered state, an untriggered state, a short circuit state, and a suspended state.
[0034] In this embodiment, the switch subcircuit is only composed of a resistor device and a target switch, and the circuit structure is relatively simple, which can reduce hardware costs. The switch subcircuit only needs to output a switch voltage to provide state information of the target switch.
[0035] In this embodiment, the detection subcircuit can form two outputs according to the switch voltage, namely, the analog voltage value and the level state signal. The combination of the analog voltage value and the level state signal can accurately indicate the specific switch state of the target switch, which not only has high detection efficiency, but also does not require the introduction of complex software algorithms. The switch state includes not only normal working states of the switch such as the triggered state and the untriggered state, but also abnormal working states of the switch such as the short circuit state and the suspended state.
[0036] In this embodiment, the service switch detection circuit can not only accurately detect the triggering of the service switch, thereby timely providing functional services bound to the service switch, but also has the function of detecting abnormalities of the service switch, which is conducive to troubleshooting or repairing circuit abnormalities of the service switch.
[0037] In some embodiments, the switch subcircuit is composed of a fourth resistor, a seventh resistor and the target switch. The fourth resistor is connected in parallel with the target switch to form a switch branch. The first end of the switch branch is the output end of the switch subcircuit, and the second end of the switch branch is grounded through the seventh resistor.
[0038] Based on the design of the fourth resistor and the target switch being connected in parallel, the output end of the switch subcircuit can output different switch voltages according to the on and off of the target switch. The switch branch is grounded through the seventh resistor, which can effectively reduce the interference signal in the switch subcircuit, reduce voltage fluctuations, and improve the stability of the switch voltage.
[0039] In some embodiments, the detection subcircuit includes a voltage branch and a level branch; the input end of the voltage branch and the input end of the level branch are commonly connected to the input end of the detection subcircuit; the voltage branch is used to output the analog voltage value according to the switching voltage; the level branch is used to output the level status signal according to the switching voltage.
[0040] Specifically, through the voltage branch and the level branch, two different types of output signals, namely, analog voltage value and level state signal, can be obtained for the same switch voltage. This enables the detection subcircuit to meet the needs of accurate measurement of signal amplitude and judgment of signal logic state.
[0041] The voltage detection and level detection functions are integrated into one detection subcircuit, reducing the complexity of the circuit and the number of components. Compared with designing two independent detection circuits, this integration can reduce the size and cost of the circuit.
[0042] Since the voltage branch and the level branch share an input terminal, their responses to the input signal are synchronous, thus avoiding the output inconsistency problem caused by signal transmission delay or noise interference, and improving the reliability and stability of the detection subcircuit.
[0043] In some embodiments, the voltage branch includes a first resistor, a fifth resistor, an eighth resistor, a ninth resistor and a Zener diode; the first resistor, the fifth resistor, the eighth resistor and the ninth resistor are connected in series, the first resistor is connected to a first power supply voltage terminal, and the ninth resistor is grounded; the middle node between the first resistor and the fifth resistor is the input terminal of the voltage branch, which is used to receive the switching voltage; the middle node between the fifth resistor and the eighth resistor is connected to the negative electrode of the Zener diode, and the positive electrode of the Zener diode is grounded; the middle node between the eighth resistor and the ninth resistor is the output terminal of the voltage branch, which is used to output the analog voltage value.
[0044] Specifically, after receiving the switch voltage, the input end of the voltage branch can output an analog voltage value matching the switch voltage. Since the switch voltage corresponds to the switch state of the target switch, the analog voltage value can indirectly indicate the switch state of the target switch.
[0045] The main function of the voltage stabilizing diode is to stabilize the voltage of the intermediate node, thereby providing a stable voltage environment for the input and output ends of the voltage branch. The voltage stabilizing characteristics of the voltage stabilizing diode ensure that the voltage branch can still work normally when the switching voltage fluctuates.
[0046] In some embodiments, the level branch includes a second resistor, a third resistor, a sixth resistor, a switching diode and a PNP transistor; the emitter of the PNP transistor is connected to the second power supply voltage terminal, the collector of the PNP transistor is grounded through the sixth resistor, and the base of the PNP transistor is connected to the positive electrode of the switching diode through the third resistor; the cathode of the switching diode is the input end of the level branch, for receiving the switching voltage; one end of the second resistor is connected to the emitter of the PNP transistor, and the other end of the second resistor is connected to the base of the PNP transistor; the collector of the PNP transistor is the output end of the level branch, for outputting the level status signal.
[0047] Specifically, after receiving the switch voltage, the input end of the level branch can output a level state signal matching the switch voltage. Since the switch voltage corresponds to the switch state of the target switch, the level state signal can indirectly indicate the switch state of the target switch.
[0048] The cathode of the switching diode is the input terminal of the level branch. According to the input switching voltage, it can be determined whether to provide a suitable bias current to the base of the PNP transistor. The PNP transistor mainly plays the role of level conversion, and can realize the conversion of the output level according to the state change of the switching voltage at the input terminal. If the transistor is affected by the switching voltage, it remains cut off, the collector of the transistor is close to the ground level, and the output of the level branch can be a low level; if the transistor is affected by the switching voltage, it remains turned on, the collector level of the transistor will be pulled up, close to the level of the second power supply voltage terminal, and the output of the level branch can be a high level.
[0049] In some implementations, the detection subcircuit includes a port capacitor, one end of the port capacitor is connected to an input end of the detection subcircuit, and the other end of the port capacitor is grounded.
[0050] Adding port capacitance at the input end of the detection subcircuit can play a role in noise filtering, signal coupling and isolation, circuit protection, and input signal stabilization, which is crucial to improving the performance and reliability of the detection subcircuit.
[0051] In some practical application examples, the port capacitor can filter out high-frequency noise and interference signals in the input signal, making the signal input to the detection subcircuit smoother and more stable. This is very important for improving detection accuracy and reliability, especially in scenarios where low-frequency signals are processed or high-precision measurements are required.
[0052] In some practical application examples, the port capacitor can be used as a coupling capacitor to block the DC signal and only allow the AC signal or pulse signal to pass through. This design can prevent the DC bias voltage from affecting the detection subcircuit while allowing the AC signal to be transmitted normally, thereby achieving signal isolation and transmission.
[0053] In some practical application examples, the port capacitor can absorb external transient voltage and surge current, protecting the detection subcircuit from damage caused by sudden situations such as electrostatic discharge, electromagnetic interference, lightning, etc. This protection mechanism is crucial to improving the reliability and anti-interference ability of the circuit.
[0054] In some practical application examples, the port capacitor can stabilize the amplitude and phase of the input signal and reduce the fluctuation of the signal during transmission. This is very important for signals that need to be accurately measured and processed, and can improve the performance and stability of the detection subcircuit.
[0055] In some embodiments, the switch state for jointly indicating the target switch includes at least one of the following: when the level state signal is high and the analog voltage value is in a first numerical interval, it indicates that the target switch is in a state of short circuit to ground; when the level state signal is high and the analog voltage value is in a second numerical interval, it indicates that the target switch is in a switch triggered state; when the level state signal is low and the analog voltage value is in a third numerical interval, it indicates that the target switch is in a switch untriggered state; when the level state signal is low and the analog voltage value is in a fourth numerical interval, it indicates that the target switch is in a signal suspended state; when the level state signal is low and the analog voltage value is in a fifth numerical interval, it indicates that the target switch is in a state of short circuit to the switch power supply voltage terminal.
[0056] Considering that the switch state includes not only normal working states of the switch such as the triggered state and the untriggered state, but also abnormal working states of the switch such as the short circuit state and the suspended state, the different working states of the target switch can be distinguished more accurately through the joint judgment of the level state signal and the analog voltage value. This joint judgment reduces the possibility of misjudgment and improves the accuracy of state judgment.
[0057] In some practical application examples, it is crucial to quickly and accurately locate the fault status of the service switch. For example, in electronic equipment, if the switch shorts to the ground, it may cause the device to malfunction or even be damaged. Through joint judgment, maintenance personnel can quickly determine the type of fault, so as to take targeted maintenance measures and reduce equipment downtime and maintenance costs.
[0058] In some practical application examples, joint judgment can better cope with various abnormal situations and enhance the fault tolerance of the detection circuit. Even in some cases, the level state signal or the analog voltage value is disturbed, the combination of the two can still accurately judge the switch state, thereby ensuring the stability of the detection result.
[0059] In some practical application examples, the design logic of the circuit system can be simplified through joint judgment. For example, when designing a detection subcircuit, there is no need to design a complex independent detection circuit for each switch state. Instead, a unified logic module can be used to judge multiple states, thereby reducing design complexity and cost.
[0060] In some practical application examples, the switch may be in a complex electromagnetic environment or affected by other interference factors. Through joint judgment, these interferences can be better resisted. For example, even if the analog voltage value is subject to certain interference, the switch state can still be judged more accurately by combining the level state signal.
[0061] See also Figure 2 The service switch detection circuit provided in one embodiment of the present disclosure is composed of two parts: a key circuit (equivalent to a switch sub-circuit) and a detection circuit (equivalent to a detection sub-circuit), which are connected by a cable.
[0062] In this embodiment, the key circuit is composed of resistors R4, R7 and a switch, and the switch is connected in parallel with R4 to form a switch branch. When the switch is pressed and released, the overall resistance value of the switch branch will change, and the switch voltage output by the key circuit will also change. It should be noted that if the key circuit is in an abnormal state such as short circuit or hanging, the switch voltage at its output end will also change.
[0063] In this embodiment, the detection circuit is composed of a PNP transistor Q1, a switch diode D1, a voltage regulator diode V1, and components such as resistors and capacitors. By detecting the level state signal output by the SOS_KEY_SW port and the analog voltage value output by the SOS_KEY_ADC port, it can be combined to determine whether the key switch is currently in the state of key pressing, key releasing, key short circuit to power positive, key short circuit to power ground, or key floating (disconnected).
[0064] In a practical application example, D1 is a switching diode with a forward conduction voltage V F About 0.2V. V1 is a voltage stabilizing diode, and its voltage stabilizing value is V Z About 4.3V. The resistance of the first resistor R1 is 2kΩ, the resistance of the second resistor R2 is 10kΩ, the resistance of the third resistor R3 is 20kΩ, the resistance of the fourth resistor R4 is 6.8kΩ, the resistance of the fifth resistor R5 is 1kΩ, the resistance of the sixth resistor R6 is 10kΩ, the resistance of the seventh resistor R7 is 550Ω, the resistance of the eighth resistor R8 is 10kΩ, and the resistance of the ninth resistor R9 is 20kΩ. The capacitance value of the port capacitor C1 is 100nF.
[0065] Assume that the switch voltage output by the SOS_KEY port is U K , the analog voltage value output by the SOS_KEY_ADC port is U ADC , the level status signal output by the SOS_KEY_SW port is U SW .
[0066] For the connection port SOS_KEY between the key circuit and the detection circuit, the following situations may exist.
[0067] Case 1: The key circuit and the detection circuit are connected normally through SOS_KEY, and the key in the key circuit is released.
[0068] Assuming that transistor Q1 is not conducting, the node current of SOS_KEY has the following relationship according to Kirchhoff's current law:
[0069]
[0070] Calculate U K =2.5V.
[0071] The voltage U between the emitter and base of transistor Q1 EB is equal to the voltage difference across the resistor R2.
[0072]
[0073] Calculate U EB =0.2V. This voltage is less than U when the transistor is turned on. EB Voltage (about 0.7V), so Q1 is not conducting, so the assumption condition is met. At this time, the voltage of the SOS_KEY_SW port is pulled down to ground through R6, that is, U SW =0V, SOS_KEY_SW is logic low.
[0074] Also because Calculate U ADC =1.61V.
[0075] Case 2: The key circuit and the detection circuit are connected normally through SOS_KEY, and the key in the key circuit is pressed.
[0076] Assuming that transistor Q1 is turned on, the voltage across R2 is equal to U when the transistor is turned on. EB Voltage (about 0.7V), for the node current of SOS_KEY, according to Kirchhoff's current law, there is the following relationship:
[0077]
[0078] Calculate U K =0.74V.
[0079] For the base current I of transistor Q1 EB According to Kirchhoff's current law: Find I EB =0.013mA. Therefore, Q1 is turned on, so the assumption condition is met. At this time, the voltage of the SOS_KEY_SW port is connected to the 3.3V power supply through the transistor, and U SW =3.3V, SOS_KEY_SW is logic high.
[0080] Also by Calculate U ADC =0.47V.
[0081] Case 3: SOS_KEY is shorted to the positive 12V power supply.
[0082] When SOS_KEY inputs 12V power supply, the SOS_KEY signal voltage U K =12V. Since the D1 switch diode is in the reverse cut-off state, the transistor Q1 is in the cut-off state, so the SOS_KEY_SW port voltage is pulled down to the ground through R6, that is, U SW =0V, SOS_KEY_SW is logic low.
[0083] Assuming that the voltage-stabilizing diode V1 is in the voltage-stabilizing conduction state, the current I flowing through V1 is V1 > 0, then according to Kirchhoff's current law: Calculate I V1 =6.73mA>0mA, so the assumption is established. Calculate U ADC =2.87V.
[0084] Case 4: SOS_KEY is shorted to GND.
[0085] When SOS_KEY is shorted to GND, the SOS_KEY signal voltage U K =0V, transistor Q1 is turned on. At this time, the voltage of SOS_KEY_SW port is connected to 3.3V power supply through transistor, that is, U SW =3.3V, SOS_KEY_SW is logic high, U ADC =0V.
[0086] Case 5: SOS_KEY is not connected to any electrical signal and is in a floating state.
[0087] At this time, the maximum voltage across V1 does not exceed 3.3V, so V1 is not conducting. Assuming that transistor Q1 is not conducting, for the SOS_KEY signal node current, according to Kirchhoff's current law, there is the following relationship:
[0088]
[0089] Calculate U K =3.1V.
[0090] The voltage U between the emitter and base of transistor Q1 EB is equal to the voltage difference across the resistor R2.
[0091]
[0092] Calculate U EB =0V. This voltage is less than U when the transistor is turned on.EB Voltage (about 0.7V), so Q1 is not conducting, so the assumption condition is met. At this time, the SOS_KEY_SW signal voltage is pulled down to ground through R6, that is, U SW =0V, SOS_KEY_SW is logic low.
[0093] Calculate U ADC =2V.
[0094] In practical applications, considering the accuracy of components and temperature drift, the analog voltage value U output by the SOS_KEY_ADC port is ADC It is necessary to introduce an error δ, for example, δ = ±0.1V. The judgment summary of the above situations can be as follows:
[0095]
[0096]
[0097] See also Figure 3 The present disclosure also provides a service switch detection method, which includes the following steps.
[0098] Step S1: Acquire the analog voltage value and level status signal output by the service switch detection circuit.
[0099] Step S2: jointly determining a switch state of a target switch according to the level state signal and the current state of the analog voltage value, wherein the switch state includes at least one of a triggered state, an untriggered state, a short circuit state, and a suspended state.
[0100] In this embodiment, the service switch detection circuit includes a switch subcircuit and a detection subcircuit, the output end of the switch subcircuit is connected to the input end of the detection subcircuit; the switch subcircuit is composed of a resistor device and the target switch, and the switch subcircuit is used to output a switch voltage according to the switch state of the target switch; the detection subcircuit is composed of a transistor device, a resistor device and a capacitor device, and the detection subcircuit is used to output the analog voltage value and the level status signal according to the switch voltage.
[0101] In some embodiments, the jointly determining the switch state of the target switch includes at least one of the following: when the level state signal is a high level and the analog voltage value is in a first numerical interval, the target switch is determined to be in a state of short circuit to ground; when the level state signal is a high level and the analog voltage value is in a second numerical interval, the target switch is determined to be in a switch triggered state; when the level state signal is a low level and the analog voltage value is in a third numerical interval, the target switch is determined to be in a switch untriggered state; when the level state signal is a low level and the analog voltage value is in a fourth numerical interval, the target switch is determined to be in a signal suspended state; when the level state signal is a low level and the analog voltage value is in a fifth numerical interval, the target switch is determined to be in a state of short circuit to the switch power supply voltage terminal.
[0102] Through the joint judgment of the level state signal and the analog voltage value, the different working states of the target switch can be accurately distinguished. This joint judgment reduces the possibility of misjudgment and improves the accuracy of state judgment. On this basis, not only can the triggering of the service switch be accurately detected, so as to provide the functional service bound to the service switch in a timely manner, but also the abnormality detection function of the service switch can be provided, which is conducive to troubleshooting or repairing the circuit abnormality of the service switch. For the specific explanation of the service switch detection circuit, please refer to the relevant instructions above and will not be repeated here.
[0103] The present disclosure also provides a car, which includes the service switch detection circuit described above. By using the service switch detection circuit, the car can detect the current state of the vehicle service switch and execute the corresponding vehicle function service in time.
[0104] The technical solution provided by one or more embodiments of the present disclosure can detect a level state signal and an analog voltage value according to different states of the service switch. Through the combined analysis of the level state signal and the analog voltage value, the current switch state of the service switch can be accurately identified, including the normal working state and the abnormal working state. On the one hand, the triggering of the service switch can be accurately detected, so as to provide the functional service bound to the service switch in a timely manner. On the other hand, the abnormal working state of the service switch can also be effectively detected, which is convenient for troubleshooting or repairing the circuit abnormality of the service switch.
[0105] The technical solution provided by one or more embodiments of the present disclosure has the advantages of simple circuit structure, low hardware cost, and small software resource requirement.
[0106] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0107] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
[0108] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A service switch detection circuit, characterized in that: The service switch detection circuit comprises a switch subcircuit and a detection subcircuit, wherein the output end of the switch subcircuit is connected to the input end of the detection subcircuit; The switch subcircuit is composed of a resistor device and a target switch, and the switch subcircuit is used to output a switch voltage according to a switch state of the target switch; The detection subcircuit is composed of a transistor device, a resistor device and a capacitor device, and the detection subcircuit is used to output an analog voltage value and a level state signal according to the switch voltage; The analog voltage value and the level state signal are used to jointly indicate the switch state of the target switch, and the switch state includes at least one of a triggered state, an untriggered state, a short-circuit state, and a suspended state.
2. The service switch detection circuit according to claim 1, characterized in that: The switch subcircuit is composed of a fourth resistor, a seventh resistor and the target switch; The fourth resistor is connected in parallel with the target switch to form a switch branch, a first end of the switch branch is an output end of the switch sub-circuit, and a second end of the switch branch is grounded through the seventh resistor.
3. The service switch detection circuit according to claim 1, characterized in that: The detection subcircuit includes a voltage branch and a level branch; The input end of the voltage branch and the input end of the level branch are commonly connected to the input end of the detection subcircuit; The voltage branch is used to output the analog voltage value according to the switch voltage; The level branch is used to output the level state signal according to the switch voltage.
4. The service switch detection circuit according to claim 3, characterized in that: The voltage branch includes a first resistor, a fifth resistor, an eighth resistor, a ninth resistor and a voltage stabilizing diode; The first resistor, the fifth resistor, the eighth resistor and the ninth resistor are connected in series, the first resistor is connected to the first power supply voltage terminal, and the ninth resistor is grounded; The middle node between the first resistor and the fifth resistor is the input end of the voltage branch, and is used to receive the switch voltage; An intermediate node between the fifth resistor and the eighth resistor is connected to the cathode of the voltage zener diode, and the anode of the voltage zener diode is grounded; The middle node between the eighth resistor and the ninth resistor is the output end of the voltage branch, which is used to output the analog voltage value.
5. The service switch detection circuit according to claim 3, characterized in that: The level branch includes a second resistor, a third resistor, a sixth resistor, a switch diode and a PNP transistor; The emitter of the PNP transistor is connected to the second power supply voltage terminal, the collector of the PNP transistor is grounded through the sixth resistor, and the base of the PNP transistor is connected to the positive electrode of the switch diode through the third resistor; The cathode of the switch diode is the input end of the level branch, and is used to receive the switch voltage; One end of the second resistor is connected to the emitter of the PNP transistor, and the other end of the second resistor is connected to the base of the PNP transistor; The collector of the PNP transistor is the output end of the level branch, and is used to output the level state signal.
6. The service switch detection circuit according to claim 3, characterized in that: The detection subcircuit comprises a port capacitor, one end of the port capacitor is connected to the input end of the detection subcircuit, and the other end of the port capacitor is grounded.
7. The service switch detection circuit according to claim 1, characterized in that: The switch state for jointly indicating the target switch includes at least one of the following: When the level state signal is at a high level and the analog voltage value is within a first numerical interval, it indicates that the target switch is in a state of being short-circuited to the ground terminal; When the level state signal is at a high level and the analog voltage value is within a second numerical interval, it indicates that the target switch is in a switch-triggered state; When the level state signal is at a low level and the analog voltage value is within a third numerical interval, it indicates that the target switch is in a switch-untriggered state; When the level state signal is at a low level and the analog voltage value is in a fourth numerical interval, it indicates that the target switch is in a signal hanging state; When the level state signal is at a low level and the analog voltage value is in the fifth numerical interval, it indicates that the target switch is in a state of being short-circuited to the switch supply voltage terminal.
8. A service switch detection method, characterized in that: The method comprises: Obtaining the analog voltage value and level status signal output by the service switch detection circuit; Determine the switch state of the target switch jointly according to the current state of the level state signal and the analog voltage value, wherein the switch state includes at least one of a triggered state, an untriggered state, a short circuit state, and a suspended state; Among them, the service switch detection circuit includes a switch subcircuit and a detection subcircuit, the output end of the switch subcircuit is connected to the input end of the detection subcircuit; the switch subcircuit is composed of a resistor device and the target switch, and the switch subcircuit is used to output a switch voltage according to the switch state of the target switch; the detection subcircuit is composed of a transistor device, a resistor device and a capacitor device, and the detection subcircuit is used to output the analog voltage value and the level state signal according to the switch voltage.
9. The service switch detection method according to claim 8, characterized in that: The jointly determining the switch state of the target switch includes at least one of the following: When the level state signal is at a high level and the analog voltage value is within a first numerical interval, determining that the target switch is in a state of being short-circuited to the ground terminal; When the level state signal is at a high level and the analog voltage value is within a second numerical interval, determining that the target switch is in a switch-triggered state; When the level state signal is at a low level and the analog voltage value is within a third numerical interval, determining that the target switch is in a switch-untriggered state; When the level state signal is at a low level and the analog voltage value is within a fourth numerical interval, determining that the target switch is in a signal-suspended state; When the level state signal is at a low level and the analog voltage value is within a fifth numerical interval, it is determined that the target switch is in a state of being short-circuited to the switch supply voltage terminal.
10. An automobile, characterized in that: The automobile comprises a service switch detection circuit as claimed in any one of claims 1 to 7.