Fault detection circuit and fault detection method for gas sensor
By designing a fault detection circuit and method for gas sensors, and utilizing the control of discharge and charging circuits combined with microcontroller self-testing, automated fault detection of gas sensors was achieved, solving the problem of low efficiency in existing technologies and improving detection efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 珠海科创储能科技有限公司
- Filing Date
- 2023-11-09
- Publication Date
- 2026-07-21
AI Technical Summary
Existing gas sensor fault detection technology has low efficiency, requiring manual opening of the circuit for detection, which is inefficient.
A fault detection circuit for a gas sensor was designed, including a discharge circuit and a charging circuit. The charging and discharging processes are controlled by a control circuit, and the periodic self-test of the microcontroller is combined with the capacitive characteristics of the gas sensor for automated fault detection.
It enables rapid and automated gas sensor fault detection, improving detection efficiency and reducing the need for manual intervention.
Smart Images

Figure CN117470923B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fault detection for gas sensors, and more specifically, to a fault detection circuit and a fault detection method for gas sensors. Background Technology
[0002] Currently, if a gas sensor malfunctions, or if the circuit containing the gas sensor malfunctions, the gas monitoring function will fail. To detect the fault in the gas sensor, the circuit containing the gas sensor needs to be manually opened, which is inefficient.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This invention provides a fault detection circuit and a fault detection method for a gas sensor, thereby addressing at least the technical problem of low fault detection efficiency of gas sensors in related technologies.
[0005] According to one aspect of the present invention, a fault detection circuit for a gas sensor is provided, comprising: a discharge circuit, a first end of which is connected to a first pin of the gas sensor, a second end of which is connected to a second pin of the gas sensor and a sampling terminal of a controller, the discharge circuit being used to discharge the gas sensor; a charging circuit, a first end of which is connected to the first pin of the gas sensor and the first end of the discharge circuit, the second end of which is connected to the second pin of the gas sensor and the second end of the discharge circuit, the charging circuit being used to charge the gas sensor; and a control circuit, a first end of which is connected to a control terminal of the controller, a second end of which is connected to the first end of the discharge circuit, a third end of which is connected to the first pin of the gas sensor, and a fourth end of which is grounded, the control circuit being used to control the second end of the control circuit and the third end of the control circuit to conduct based on a fault detection signal output by the controller, so as to discharge the gas sensor through the discharge circuit, or to control the third end of the control circuit and the fourth end of the control circuit to conduct so as to charge the gas sensor through the charging circuit.
[0006] Optionally, the discharge circuit includes: a first operational amplifier, the negative input terminal of which is connected to a first end of the discharge circuit; a second operational amplifier, the positive input terminal of which is connected to the output terminal of the first operational amplifier; and a first resistor, the first end of which is connected to the negative input terminal of the second operational amplifier, and the second end of which is connected to a second end of the discharge circuit.
[0007] Optionally, the charging circuit includes: a first field-effect transistor, the drain of the first field-effect transistor being connected to a first terminal of the charging circuit, the source of the first field-effect transistor being connected to a second terminal of the charging circuit, and the gate of the first field-effect transistor being grounded.
[0008] Optionally, the control circuit includes: a second resistor, the first end of which is connected to the first end of the control circuit; a transistor, the base of which is connected to the second end of the second resistor, and the emitter of which is connected to the fourth end of the control circuit; a third resistor, the first end of which is connected to the collector of the transistor, and the second end of which is connected to the second end of the control circuit; and a second field-effect transistor, the source of which is connected to the third end of the control circuit, and the gate of which is connected to the collector of the transistor.
[0009] According to one aspect of the present invention, a fault detection method for a gas sensor is provided, comprising: in response to receiving a fault detection signal for fault detection of the gas sensor, charging the gas sensor based on a charging circuit in a fault detection circuit, and acquiring the charging duration of the gas sensor, wherein the fault detection circuit is a fault detection circuit for a gas sensor according to any one of the above embodiments; in response to the charging duration of the gas sensor being longer than a preset duration, discharging the gas sensor based on a discharging circuit in the fault detection circuit, and acquiring the output voltage of the gas sensor; and performing fault detection on the gas sensor based on the output voltage to obtain a fault detection result.
[0010] Optionally, the charging circuit in the fault detection circuit is controlled to charge the gas sensor, including: controlling the transistor in the control circuit of the fault detection circuit to conduct in order to charge the gas sensor.
[0011] Optionally, the gas sensor is discharged based on the discharge circuit in the fault detection circuit, including: controlling the transistor of the control circuit in the fault detection circuit to disconnect, so as to discharge the gas sensor.
[0012] Optionally, fault detection of the gas sensor is performed based on the output voltage to obtain a fault detection result, including: determining whether the output voltage is greater than a preset voltage; in response to the output voltage being greater than the preset voltage, determining that the fault detection result is that the gas sensor is normal; in response to the output voltage being less than or equal to the preset voltage, determining that the fault detection result is that the gas sensor is abnormal.
[0013] Optionally, the method further includes: generating a fault detection signal in response to receiving a start command or reset command from the microcontroller corresponding to the fault detection circuit.
[0014] According to one aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the execution of a fault detection method for a gas sensor according to any of the above embodiments in the processor of the device.
[0015] According to one aspect of the present invention, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs; wherein when the one or more programs are executed by the one or more processors, the one or more processors perform a fault detection method for a gas sensor according to any one of the above embodiments.
[0016] In this embodiment of the invention, in response to receiving a fault detection signal for fault detection of a gas sensor, the gas sensor is charged using the charging circuit in the fault detection circuit, and the charging time of the gas sensor is collected; in response to the charging time of the gas sensor exceeding a preset time, the gas sensor is discharged using the discharging circuit in the fault detection circuit, and the output voltage of the gas sensor is collected; fault detection of the gas sensor is performed based on the output voltage to obtain the fault detection result, thus achieving the purpose of rapid fault detection of the gas sensor. It is readily apparent that by controlling the influence of the charging and discharging circuits in the fault detection circuit on the voltage of the gas sensor, a fault in the gas sensor or the circuit containing the gas sensor can be detected, thereby improving the efficiency of fault detection of the gas sensor and solving the technical problem of low fault detection efficiency of gas sensors in related technologies. Attached Figure Description
[0017] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0018] Figure 1 This is a schematic diagram of a fault detection circuit for a gas sensor according to an embodiment of this application;
[0019] Figure 2 This is a flowchart of a gas sensor fault detection method according to an embodiment of the present invention;
[0020] Figure 3 This is a schematic diagram of a fault detection circuit according to an embodiment of this application;
[0021] Figure 4 This is a schematic diagram of a fault detection device for a gas sensor according to an embodiment of this application. Detailed Implementation
[0022] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0024] Example 1
[0025] According to an embodiment of the present invention, a fault detection circuit for a gas sensor is provided. Figure 1 This is a schematic diagram of a fault detection circuit for a gas sensor according to an embodiment of this application, as shown below. Figure 1 As shown, the fault detection circuit includes: a discharge circuit 101, a gas sensor 102, a controller 103, a charging circuit 104, a control circuit 105, and a grounding circuit 106.
[0026] The system comprises: a discharge circuit, the first end of which is connected to the first pin of the gas sensor, and the second end of which is connected to the second pin of the gas sensor and the sampling terminal of the controller; a charging circuit, the first end of which is connected to the first pin of the gas sensor and the first end of the discharge circuit, and the second end of which is connected to the second pin of the gas sensor and the second end of the discharge circuit; and a control circuit, the first end of which is connected to the control terminal of the controller, the second end of which is connected to the first end of the discharge circuit, the third end of which is connected to the first pin of the gas sensor, and the fourth end of which is grounded; and a control circuit, which controls the second end of the control circuit to conduct and the third end of the control circuit to conduct and discharge the gas sensor through the discharge circuit, or controls the third end of the control circuit to conduct and the fourth end of the control circuit to charge the gas sensor through the charging circuit, based on the fault detection signal output by the controller.
[0027] The gas sensor mentioned above can be used to monitor the concentration of gas, and can trigger alarms or prompts by monitoring the gas concentration in the current environment.
[0028] The gas sensor can be a carbon monoxide gas sensor (CO sensor), but it is not limited to this and can be any gas monitoring sensor.
[0029] The charging circuit described above can be used to charge the gas sensor, thereby increasing the capacitance value of the gas sensor.
[0030] The aforementioned discharge circuit can be used to discharge the gas sensor, thereby reducing the capacitance value of the gas sensor.
[0031] In one optional embodiment, the functionality of a gas sensor or its circuitry can be detected based on the sensor's capacitance characteristics, thereby improving fault detection efficiency. Specifically, the capacitance characteristic of a gas sensor refers to the change in capacitance value in response to changes in CO gas concentration. CO sensors typically employ electrochemical principles, where the capacitance on the working electrode changes with CO gas concentration. When CO gas concentration increases, CO molecules undergo oxidation on the electrode surface, leading to an increase in capacitance; conversely, when CO concentration decreases, capacitance decreases. This capacitance characteristic can be used to measure and monitor changes in CO gas concentration in the environment. This application uses CO gas as an example, but the solution described in this application can also be used for other gas sensors with similar capacitance characteristics, and is not specifically limited here.
[0032] The aforementioned control circuit is used to control the charging circuit based on the received fault detection signal. Optionally, the charging circuit and discharging circuit can be switched by controlling the connection relationship between relevant devices and other devices in the charging circuit. The aforementioned controller can be an external controller, wherein the controller can be the start button or reset button of the microcontroller where the fault detection circuit is located. Clicking the start button or reset button can generate a fault detection command.
[0033] The controller mentioned above can be any controller; no restrictions are placed on the controller here.
[0034] The aforementioned control circuit can also be connected to the charging circuit and the discharging circuit respectively. When the gas sensor needs to be charged, the charging circuit can be controlled to charge the gas sensor through the charging signal; when the gas sensor needs to be discharged, the discharging circuit can be controlled to discharge the gas sensor through the discharging signal.
[0035] The first and second operational amplifiers mentioned above are mainly used to process the received signals, such as amplification, filtering and other processing, which are not limited here.
[0036] The first pin of the gas sensor described above can be a C pin, and the second pin can be a W pin.
[0037] The aforementioned C-pin (Calibration pin) is used for sensor calibration. When the gas sensor requires calibration, a calibration signal can be provided through the C-pin. Calibration is typically performed by providing a gas of known concentration to calibrate the sensor's sensitivity and accuracy.
[0038] The aforementioned W pin (Warning pin) is used for the sensor's alarm function. When the gas concentration exceeds a set threshold, the W pin outputs an alarm signal to trigger the corresponding alarm device, such as an audible alarm or warning light. This helps in the timely detection and response to gas leaks or abnormal concentrations.
[0039] The first operational amplifier described above can be connected to the C pin to send a calibration signal through the C pin when the gas sensor needs to be calibrated, and the second operational amplifier processes and outputs the calibration signal.
[0040] The aforementioned second operational amplifier can be connected to the W pin to send an alarm signal through the W pin when the concentration monitored by the gas sensor exceeds the threshold, and the alarm signal is processed and output by the first operational amplifier.
[0041] The aforementioned transistor is used to control the connection and conduction between the charging circuit and the gas sensor. If the transistor is connected to the gas sensor, the gas sensor can be charged through the charging circuit.
[0042] The aforementioned transistor can be a Q3NPN transistor. The function of the Q3NPN transistor is to amplify and control current flow. The Q3NPN transistor consists of three control terminals: base, emitter, and collector. By controlling the base current, the current between the collector and emitter can be controlled, thereby achieving signal amplification and switching control functions. Transistors are widely used in amplifier circuits, switching circuits, and logic gate circuits.
[0043] The field-effect transistor described above can be a junction field-effect transistor (JFET), but is not limited to this; this application is merely illustrative. The function of a JFET is to control the flow of current. A JFET consists of three terminals: a source, a drain, and a gate. When a voltage is applied to the gate, the current between the source and drain can be controlled. JFETs have low noise, high input impedance, and stable operating characteristics, and are commonly used in applications such as amplifier circuits, regulation circuits, and switching circuits.
[0044] It should be noted that the first resistor, the second resistor, and the third resistor mentioned above are respectively placed in different positions in the circuit, and their functions may include, but are not limited to, controlling current, voltage division, protecting components, and resistor matching.
[0045] Resistors can limit the flow of current; by changing the resistance, the current in a circuit can be adjusted. Resistors can act as voltage dividers; when multiple resistors are in a circuit, the voltage can be distributed and regulated according to their relative values. Resistors can also be used as protective components; when the voltage in a circuit is too high, a resistor can limit the current, protecting other components from damage. Furthermore, resistors can be used to match the impedance of signal sources and loads to achieve optimal signal transmission.
[0046] This application utilizes the capacitance characteristics of the CO sensor and the periodic self-test of the microcontroller to control the CO sensor to reverse charge and then discharge. The acquisition circuit detects the expected output pulsation, thus verifying the normal operation of the sensor and the detection circuit.
[0047] Example 2
[0048] According to an embodiment of the present invention, an embodiment of a fault detection method for a gas sensor is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0049] Figure 2 This is a flowchart of a fault detection method for a gas sensor according to an embodiment of the present invention, such as... Figure 2 As shown, the method includes the following steps:
[0050] Step S202: In response to receiving a fault detection signal for fault detection of the gas sensor, the gas sensor is charged based on the charging circuit in the fault detection circuit, and the charging time of the gas sensor is collected.
[0051] The fault detection circuit is the fault detection circuit of the gas sensor in any of the above embodiments.
[0052] The aforementioned fault detection signal can be generated by the user through the microcontroller controlling the gas sensor.
[0053] The aforementioned fault detection signals can also be signals generated during the microcontroller's periodic self-test. Periodic self-testing refers to the microcontroller executing a series of self-test procedures after each startup or reset to check if its hardware is functioning correctly. These self-test procedures typically include checking peripheral devices related to the microcontroller, verifying memory availability, confirming communication interface functionality, and checking power supply stability, among other things. Periodic self-testing ensures the microcontroller system operates normally after startup or reset and allows for the timely detection and handling of potential hardware faults or anomalies.
[0054] In one alternative embodiment, a fault detection signal can be generated during the periodic self-test of the microcontroller, and the sensor in the charging circuit can be controlled to charge based on the fault detection signal.
[0055] The preset duration mentioned above can be 100ms, and the preset duration can be set by the user according to their needs.
[0056] Step S204: In response to the gas sensor charging time being longer than a preset time, the gas sensor is discharged based on the discharge circuit in the fault detection circuit, and the output voltage of the gas sensor is collected.
[0057] In one optional embodiment, fault detection of the gas sensor can be performed based on the output voltage. If the sampled output voltage changes abruptly, it indicates that the gas sensor is normal; if the output voltage does not change, it indicates that the gas sensor is abnormal. Fault detection of the gas sensor can be performed by collecting the output voltage. The entire process is simple, low-cost, and widely applicable.
[0058] Step S206: Perform fault detection on the gas sensor based on the output voltage to obtain the fault detection result.
[0059] The charging process involves adding a certain concentration of CO gas to the sensor and observing whether the sensor can accurately detect changes in CO concentration. The discharging process involves removing CO gas from the sensor and observing whether the sensor can quickly return to normal. If the sensor cannot quickly return to normal during the discharging process, it may indicate a sensor malfunction. The charging and discharging process can be used to test the sensitivity and response speed of the CO sensor. If the sensor's sensitivity decreases or its response speed slows down, it may indicate a sensor malfunction or aging.
[0060] Through the above steps, in response to receiving a fault detection signal for gas sensor fault detection, the gas sensor is charged using the charging circuit in the fault detection circuit, and the charging time of the gas sensor is collected; in response to the gas sensor charging time exceeding a preset time, the gas sensor is discharged using the discharging circuit in the fault detection circuit, and the output voltage of the gas sensor is collected; based on the output voltage, fault detection of the gas sensor is performed to obtain the fault detection result, thus achieving the purpose of rapid fault detection of the gas sensor. It is noteworthy that by controlling the influence of the charging and discharging circuits in the fault detection circuit on the gas sensor voltage, a fault in the gas sensor or the circuit containing the gas sensor can be detected, thereby improving the efficiency of gas sensor fault detection and solving the technical problem of low fault detection efficiency of gas sensors in related technologies.
[0061] Optionally, the charging circuit in the fault detection circuit is controlled to charge the gas sensor, including: controlling the transistor in the control circuit of the fault detection circuit to conduct in order to charge the gas sensor.
[0062] In an alternative embodiment, after the transistor in the control circuit is turned on, the connection between the gas sensor and the reference voltage can be disconnected to charge the gas sensor.
[0063] Optionally, the gas sensor is discharged based on the discharge circuit in the fault detection circuit, including: controlling the transistor of the control circuit in the fault detection circuit to disconnect, so as to discharge the gas sensor.
[0064] In an alternative embodiment, after disconnecting the transistor in the control circuit, the connection between the gas sensor and the reference voltage can be turned on, thereby discharging the gas sensor.
[0065] Optionally, fault detection of the gas sensor is performed based on the output voltage to obtain a fault detection result, including: determining whether the output voltage is greater than a preset voltage; in response to the output voltage being greater than the preset voltage, determining that the fault detection result is that the gas sensor is normal; in response to the output voltage being less than or equal to the preset voltage, determining that the fault detection result is that the gas sensor is abnormal.
[0066] The preset voltage can be set by the user according to their needs. The preset voltage can be 300mV, but is not limited to that.
[0067] In one optional embodiment, if the output voltage is greater than a preset voltage, it indicates that the gas sensor is active and has high sensitivity to detect gas, and the fault detection result is determined to be that the gas sensor is normal. If the output voltage is less than or equal to the preset voltage, it indicates that the gas sensor has low activity, and the fault detection result is determined to be that the gas sensor is abnormal.
[0068] Optionally, the method further includes: generating a fault detection signal in response to receiving a start command or reset command from the microcontroller corresponding to the fault detection circuit.
[0069] The aforementioned startup instruction can be used to indicate the start of the microcontroller. The reset instruction can be used to indicate the reset of the microcontroller.
[0070] In an optional embodiment, the aforementioned start command or reset command can be generated based on the microcontroller's periodic self-test function, avoiding manual operation by the user and enabling periodic testing of the gas sensor to detect faults in the gas sensor.
[0071] Figure 3 This is a schematic diagram of a fault detection circuit according to an embodiment of this application, such as... Figure 3 As shown, the fault detection circuit includes a first operational amplifier (U3B), capacitors C12, C22, and C20 connected to the first operational amplifier, resistors R15 and R17 connected to the first operational amplifier, a second operational amplifier (U3A), capacitors C7, C16, C17, C23, and C24 connected to the second operational amplifier, resistors R16 and R19 connected to the second operational amplifier, diode D7, and component FB1; the C pin of the CO sensor is connected to the drain of the first field-effect transistor (Q2), the W pin of the CO sensor is connected to the source of the first field-effect transistor (Q2), the W pin of the CO sensor is also connected to the first resistor (R18), the C pin of the CO sensor is also connected to the source of the second field-effect transistor (Q1), the second resistor (R20) is placed between the C pin of the CO sensor and the collector of the transistor (Q3NPN), the third resistor (R21) is placed between the base of the transistor and the control circuit, and the emitter of the transistor is grounded. By turning on Q3, the CO sensor can be charged; by turning off Q3, the CO sensor can be discharged, thus reflecting the sensor's activity.
[0072] Through the Figure 3 The circuit utilizes a combination of a Q3 NPN transistor and a Q1 field-effect transistor to disconnect the CO sensor's pin C from the reference voltage during self-testing, while simultaneously charging the sensor. At the instant the charging ends and the circuit is disconnected (within 1 second, not limited), the sudden change in the CO sampling value is sampled to reflect the capacitance characteristics of the CO sensor, thereby verifying the sensor's normal operation. The circuit described in this application is simple, low-cost, and can be widely used.
[0073] This application utilizes the capacitance characteristics of the CO sensor and the periodic self-test of the microcontroller to control the CO sensor to reverse charge and then discharge. The acquisition circuit detects the expected output pulsation, thus verifying the normal operation of the sensor and the detection circuit.
[0074] Example 3
[0075] According to an embodiment of this application, an embodiment of a fault detection device for a gas sensor is provided. Figure 4 This is a schematic diagram of a fault detection device for a gas sensor according to an embodiment of this application, as shown below. Figure 4 As shown, the device includes: a charging module 402, a discharging module 404, and a detection module 406.
[0076] The charging module is used to charge the gas sensor based on the charging circuit in the fault detection circuit in response to receiving a fault detection signal for the gas sensor, and to collect the charging time of the gas sensor. The fault detection circuit is the fault detection circuit of the gas sensor in any of the above embodiments. The discharging module is used to discharge the gas sensor based on the discharging circuit in the fault detection circuit in response to the charging time of the gas sensor being longer than a preset time, and to collect the output voltage of the gas sensor. The detection module is used to perform fault detection on the gas sensor based on the output voltage and to obtain the fault detection result.
[0077] Optionally, the charging module is also used to control the conduction of the transistor in the control circuit of the fault detection circuit to charge the gas sensor.
[0078] Optionally, the discharge module is also used to control the transistor in the control circuit of the fault detection circuit to disconnect, so as to discharge the gas sensor.
[0079] Optionally, the detection module is also used to determine whether the output voltage is greater than a preset voltage; in response to the output voltage being greater than the preset voltage, the fault detection result is determined to be that the gas sensor is normal; in response to the output voltage being less than or equal to the preset voltage, the fault detection result is determined to be that the gas sensor is abnormal.
[0080] Optionally, the device may also include a generation module.
[0081] The generation module is also used to generate a fault detection signal in response to the start command or reset command received from the microcontroller corresponding to the fault detection circuit.
[0082] Example 4
[0083] According to one aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the execution of a fault detection method for a gas sensor according to any of the above embodiments in the processor of the device.
[0084] Example 5
[0085] According to one aspect of the present invention, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs; wherein when the one or more programs are executed by the one or more processors, the one or more processors perform a fault detection method for a gas sensor according to any one of the above embodiments.
[0086] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0087] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0088] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0089] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0090] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0091] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0092] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A fault detection circuit for a gas sensor, characterized in that, include: A discharge circuit is provided, wherein the first end of the discharge circuit is connected to the first pin of the gas sensor, and the second end of the discharge circuit is connected to the second pin of the gas sensor and the sampling terminal of the controller. The discharge circuit is used to discharge the gas sensor. A charging circuit, wherein a first end of the charging circuit is connected to a first pin of the gas sensor and a first end of the discharge circuit, and a second end of the charging circuit is connected to a second pin of the gas sensor and a second end of the discharge circuit, and the charging circuit is used to charge the gas sensor; The control circuit has a first terminal connected to the control terminal of the controller, a second terminal connected to the first terminal of the discharge circuit, a third terminal connected to the first pin of the gas sensor, and a fourth terminal grounded. The control circuit is used to control the second terminal and the third terminal of the control circuit to conduct based on the fault detection signal output by the controller, so as to discharge the gas sensor through the discharge circuit, or to control the third terminal and the fourth terminal of the control circuit to conduct so as to charge the gas sensor through the charging circuit. The gas sensor has a first pin (C pin) and a second pin (W pin). The C pin is used for the calibration of the gas sensor, and the W pin is used to trigger the alarm function of the gas sensor when the gas concentration exceeds a preset threshold. The discharge circuit includes: A first operational amplifier, wherein the negative input terminal of the first operational amplifier is connected to the first terminal of the discharge circuit; A second operational amplifier, wherein the positive input terminal of the second operational amplifier is connected to the output terminal of the first operational amplifier; A first resistor, the first end of which is connected to the negative input terminal of the second operational amplifier, and the second end of which is connected to the second terminal of the discharge circuit; The control circuit includes: The second resistor, the first end of which is connected to the first end of the control circuit; The transistor has its base connected to the second terminal of the second resistor and its emitter connected to the fourth terminal of the control circuit. The third resistor has its first end connected to the collector of the transistor and its second end connected to the second end of the control circuit. The second field-effect transistor has its source connected to the third terminal of the control circuit, and its gate connected to the collector of the transistor.
2. The fault detection circuit for the gas sensor according to claim 1, characterized in that, The charging circuit includes: The first field-effect transistor has its drain connected to the first terminal of the charging circuit, its source connected to the second terminal of the charging circuit, and its gate grounded.
3. A fault detection method for a gas sensor, characterized in that, include: In response to receiving a fault detection signal for fault detection of a gas sensor, the gas sensor is charged based on the charging circuit in the fault detection circuit, and the charging time of the gas sensor is collected, wherein the fault detection circuit is the fault detection circuit of the gas sensor as described in claim 1 or 2. In response to the gas sensor's charging time exceeding a preset time, the gas sensor is discharged based on the discharge circuit in the fault detection circuit, and the output voltage of the gas sensor is collected. The gas sensor is fault detected based on the output voltage, and the fault detection result is obtained.
4. The fault detection method for a gas sensor according to claim 3, characterized in that, The charging circuit in the fault detection circuit charges the gas sensor, including: The transistor in the control circuit of the fault detection circuit is turned on to charge the gas sensor.
5. The fault detection method for a gas sensor according to claim 3, characterized in that, Discharging the gas sensor based on the discharge circuit in the fault detection circuit includes: The transistor in the control circuit of the fault detection circuit is disconnected to discharge the gas sensor.
6. The fault detection method for a gas sensor according to claim 3, characterized in that, Based on the output voltage, fault detection is performed on the gas sensor to obtain fault detection results, including: Determine whether the output voltage is greater than a preset voltage; In response to the output voltage being greater than a preset voltage, the fault detection result is determined to be that the gas sensor is normal. In response to the output voltage being less than or equal to the preset voltage, the fault detection result is determined to be an abnormality of the gas sensor.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the execution of the fault detection method of the gas sensor according to any one of claims 3 to 6 in the processor of the device.
8. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors perform the fault detection method for the gas sensor according to any one of claims 3 to 6.