Detection circuit and method

The detection circuit, composed of MOS transistors and voltage divider units, simplifies the 2-pin battery in-situ detection process, solves the problems of cumbersome steps and high cost in the existing technology, and achieves high-efficiency detection with low current consumption.

CN115166547BActive Publication Date: 2026-02-24QUECLINK WIRELESS SOLUTIONS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210814701.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-12
Publication Date
2026-02-24
Estimated Expiration
2042-07-12

AI Technical Summary

Technical Problem

Existing technologies for 2-pin battery testing involve cumbersome steps, high costs, and significant current consumption.

Method used

The detection circuit is composed of MOS transistors, voltage divider units and pull-up resistors. It determines whether the 2-pin battery is connected to the target device by outputting a signal. Combining the switching characteristics of MOS transistors and the current limiting effect of pull-up resistors, the detection process is simplified and the cost is reduced.

Benefits of technology

It enables convenient detection of whether a 2-pin battery is in place, avoiding the cumbersome steps and high current consumption of continuously reading the battery ADC voltage by software. The structure is simple and the cost is low.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115166547B_ABST
    Figure CN115166547B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a detection circuit and method, the detection circuit comprises: a first MOS transistor, a voltage division unit and a pull-up resistor; the first end of the voltage division unit is connected with the positive pole of a 2PIN battery, the second end of the voltage division unit is connected with the gate of the first MOS transistor, the third end of the voltage division unit is connected with the source of the first MOS transistor, and the third end of the voltage division unit is grounded; the drain of the first MOS transistor is connected with a power supply through the pull-up resistor; the first MOS transistor is used for outputting an indication signal; wherein the indication signal is a signal used for indicating whether the 2PIN battery is connected with a target device; when the 2PIN battery is connected with the target device, the 2PIN battery is used for supplying power for the target device. The detection circuit provided by the embodiment can overcome the problems of the existing detection technology, such as complicated steps, high cost and high current consumption.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of detection, and in particular, to a detection circuit and method. BACKGROUND

[0002] In a battery detection project taking a 2PIN battery (i.e., a battery having only one positive electrode and one negative electrode) as an example, since such a battery has only 2PINs, i.e., a positive electrode and a negative electrode, and has no other PINs to indicate that the battery is in place (the battery in place is used to represent that the battery is connected to a device), the software detection mode is generally used to detect whether the battery is in place.

[0003] At present, the software detection mode generally detects by constantly reading the voltage of the battery analog-to-digital converter (ADC) through software, which is complicated, and has high cost and high current consumption.

[0004] Therefore, the detection mode of the prior art is complicated, and has high cost and high current consumption. SUMMARY

[0005] Embodiments of the present application provide a detection circuit and method to overcome the problem that the prior art detection technology is complicated, and has high cost and high current consumption.

[0006] In a first aspect, embodiments of the present application provide a detection circuit for detecting whether a 2PIN battery is connected to a target device; the detection circuit comprises a first MOS transistor, a voltage dividing unit and a pull-up resistor;

[0007] The first end of the voltage dividing unit is connected to the positive electrode of the 2PIN battery, the second end of the voltage dividing unit is connected to the gate of the first MOS transistor, the third end of the voltage dividing unit is connected to the source of the first MOS transistor, and the third end of the voltage dividing unit is grounded; the drain of the first MOS transistor is connected to the power supply through the pull-up resistor;

[0008] The first MOS transistor is used to output an indication signal; wherein the indication signal is a signal used to indicate whether the 2PIN battery is connected to the target device; when the 2PIN battery is connected to the target device, it is used to power the target device.

[0009] In a possible design, the drain of the first MOS transistor is an output end of the detection circuit, used to output the indication signal;

[0010] When the indication signal output by the output end of the detection circuit is a low-level signal, it is determined that the 2PIN battery is in a connected state, and the connected state is used to represent that the 2PIN battery is connected to the target device;

[0011] When the output signal of the detection circuit is a high-level signal, it is determined that the 2-pin battery is in a disconnected state, which indicates that the 2-pin battery is not connected to the target device.

[0012] In one possible design, the positive terminal of the 2-pin battery is connected to a charging chip, which is used to charge the 2-pin battery; the detection circuit also includes an inductor and a second MOS transistor.

[0013] The first terminal of the voltage divider unit is connected to the positive terminal of the 2-pin battery through the inductor. The first terminal of the voltage divider unit is connected to the source of the second MOS transistor. The drain of the second MOS transistor is connected to the third terminal of the voltage divider unit. The gate of the second MOS transistor is connected to the positive terminal of the 2-pin battery. The inductor is used for charging or discharging.

[0014] When the charging chip outputs a square wave, if the indicator signal output by the output terminal of the detection circuit is a high-level signal, it is determined that the 2-pin battery is in a disconnected state. The disconnected state is used to indicate that the 2-pin battery is not connected to the target device.

[0015] In one possible design, the drain of the first MOS transistor is connected to a control unit in the target device, the control unit being used to determine a control signal based on the detected indication signal;

[0016] The control signal is used to control the target device to perform an operation that matches the indication signal.

[0017] In one possible design, the drain of the first MOS transistor is connected to the indicator light;

[0018] If the indicator light is on, it indicates that the drain of the first MOS transistor is outputting a high level, which is used to determine that the 2-pin battery is in the off state;

[0019] If the indicator light is off, it is determined that the drain of the first MOS transistor is outputting a low level, which is used to determine that the 2-pin battery is in the connected state.

[0020] In one possible design, the voltage divider unit includes a first resistor and a second resistor, one end of the first resistor is the first end of the voltage divider unit, the other end of the first resistor is connected to one end of the second resistor, the other end of the first resistor or one end of the second resistor is the second end of the voltage divider unit, and the other end of the second resistor is the third end of the voltage divider unit.

[0021] Secondly, embodiments of this application provide a detection system for detecting whether a 2-pin battery is connected to a target device; the system includes a detection circuit and a charging chip as described in any of the first aspects; the charging chip is connected to the positive terminal of the 2-pin battery.

[0022] Thirdly, embodiments of this application provide a detection method applied to a detection circuit as described in any of the first aspects, wherein the detection circuit is connected to the positive terminal of the 2-pin battery; the method includes:

[0023] If the indicator signal output by the output terminal of the detection circuit is a low-level signal, it is determined that the 2-pin battery is in the access state, which indicates that the 2-pin battery is connected to the target device.

[0024] If the output signal of the detection circuit is a high-level signal, it is determined that the 2-pin battery is in a disconnected state, which indicates that the 2-pin battery is not connected to the target device.

[0025] In one possible design, the positive terminal of the 2-pin battery is connected to a charging chip; the method further includes:

[0026] When the charging chip outputs a square wave, if the indicator signal output by the output terminal of the detection circuit is a high-level signal, then it is determined that the 2-pin battery is in an open state.

[0027] In one possible design, the drain of the first MOS transistor is connected to a control unit in the target device; the method further includes:

[0028] The indicator signal output from the drain of the first MOS transistor is transmitted to the control unit, so that the control unit determines a control signal based on the detected indicator signal; wherein the control signal is used to control the target device to perform an operation that matches the indicator signal.

[0029] The detection circuit and method provided in this application embodiment are used to detect whether a 2-pin battery is connected to a target device. A first MOS transistor, a voltage divider unit, and a pull-up resistor are configured. The first terminal of the voltage divider unit is connected to the positive terminal of the 2-pin battery, the second terminal of the voltage divider unit is connected to the gate of the first MOS transistor, and the third terminal of the voltage divider unit is connected to the source of the first MOS transistor. The third terminal of the voltage divider unit is grounded. The drain of the first MOS transistor is connected to a power supply through the pull-up resistor. The first MOS transistor outputs an indication signal, which indicates whether the 2-pin battery is connected to the target device. When the 2-pin battery is connected to the target device, it supplies power to the target device. Therefore, based on the switching characteristics of the MOSFET, the pull-up resistor maintaining a high output level and limiting current, and combined with the voltage divider function of the voltage divider unit, a detection circuit is constructed. The structure is simple and can conveniently detect whether the 2-pin battery is in place (i.e., whether the 2-pin battery is connected to the target device) while protecting the 2-pin battery and the target device. There is no need to continuously read the voltage of the battery ADC through software for detection. The steps are simple and the cost is reduced. At the same time, the output signal (i.e., the indication signal) of the detection circuit can determine whether the 2-pin battery is connected to the target device. There is no need to continuously read the signal, and therefore no need to continuously generate signal flow, resulting in minimal current consumption. Attached Figure Description

[0030] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0031] Figure 1 A schematic diagram of the detection circuit provided in an embodiment of this application;

[0032] Figure 2 A schematic diagram of a detection circuit provided in another embodiment of this application;

[0033] Figure 3 A schematic diagram of a detection circuit provided in another embodiment of this application;

[0034] Figure 4 A schematic diagram of a detection circuit provided in another embodiment of this application;

[0035] Figure 5 A schematic diagram of a detection circuit provided in another embodiment of this application;

[0036] Figure 6A schematic diagram of a detection circuit provided in yet another embodiment of this application;

[0037] Figure 7 This is a schematic flowchart of the detection method provided in the embodiments of this application. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0039] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, 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.

[0040] Currently, software-based detection methods typically involve continuously reading the voltage from the battery's analog-to-digital converter (ADC) using software. This process is cumbersome, costly, and consumes a significant amount of current. Therefore, existing detection methods are cumbersome, costly, and consume a large amount of current.

[0041] To address the aforementioned issues, the technical concept of this application is to establish a hardware detection circuit, which consists of a MOSFET, a voltage divider unit, and a pull-up resistor. The input terminal of this detection circuit is connected to the positive terminal of the 2-pin battery, and the output terminal of the detection circuit outputs a signal indicating whether the 2-pin battery is connected to the target device. The hardware structure is simple and low-cost. At the same time, it enables convenient detection of whether the 2-pin battery is present (i.e., whether the 2-pin battery is connected to the target device) while protecting the 2-pin battery and the target device. This eliminates the need for continuous reading of the battery ADC voltage through software, simplifying the process and reducing costs. Furthermore, the output signal (i.e., the indication signal) of the detection circuit is sufficient to determine whether the 2-pin battery is connected to the target device, eliminating the need for continuous signal reading and thus avoiding excessive current consumption.

[0042] The technical solutions of this application will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0043] Figure 1 A schematic diagram of the detection circuit provided in the embodiments of this application is shown below. Figure 1 As shown, the detection circuit is used to detect whether a 2-pin battery is connected to a target device. The 2-pin battery includes a 2-pin battery interface, which indicates the positive terminal of the 2-pin battery. The detection circuit may include: a first MOS transistor, a voltage divider unit, and a pull-up resistor.

[0044] The first terminal of the voltage divider unit is connected to the positive terminal of the 2-pin battery, the second terminal of the voltage divider unit is connected to the gate of the first MOS transistor, the third terminal of the voltage divider unit is connected to the source of the first MOS transistor, and the third terminal of the voltage divider unit is grounded; the drain of the first MOS transistor is connected to the power supply through a pull-up resistor.

[0045] The first MOS transistor is used to output an indication signal; wherein, the indication signal is a signal indicating whether the 2-pin battery is connected to the target device; when the 2-pin battery is connected to the target device, it is used to supply power to the target device.

[0046] Here, the pull-up resistor is used to support the output high level and also for current limiting; the voltage divider unit is used for voltage division.

[0047] In this embodiment, as Figure 1As shown, the first MOS transistor M1 can be an NMOS transistor. This NMOS transistor can be packaged with a diode, which serves as a freewheeling diode for protection; or it can be without a diode, in which case the detection circuit has a voltage divider unit and a pull-up resistor for protection. Here, we do not make a specific limitation on whether the NMOS transistor is packaged with a body diode.

[0048] In this configuration, the positive terminal (BAT+) of the 2-pin battery is connected to the first terminal of the voltage divider unit, the second terminal of the voltage divider unit is connected to the gate of the NMOS transistor, the third terminal of the voltage divider unit is connected to the source of the NMOS transistor, and the drain of the NMOS transistor is connected to the power supply VDD through a pull-up resistor. If the third terminal of the voltage divider unit is grounded, then the source of the NMOS transistor is also grounded.

[0049] The pull-up resistor here is connected to VDD to output a high-level state and also serves as a current limiter. The high-level output is used to determine the battery's presence based on the NMOS transistor's drain output signal (i.e., an indicator signal or battery presence indicator signal, which can be either high or low). Furthermore, if VDD were directly connected to the NMOS transistor's drain, VDD would be short-circuited to ground the instant the NMOS transistor turns on. Therefore, the pull-up resistor supports the high-level output and also limits current. The target device here is any device that can connect a 2-pin battery; no specific limitation is made.

[0050] This application embodiment is used to detect whether a 2-pin battery is connected to a target device. It employs a first MOS transistor, a voltage divider unit, and a pull-up resistor. The first terminal of the voltage divider unit is connected to the positive terminal of the 2-pin battery, the second terminal is connected to the gate of the first MOS transistor, and the third terminal is connected to the source of the first MOS transistor. The third terminal of the voltage divider unit is grounded. The drain of the first MOS transistor is connected to a power supply via the pull-up resistor. The first MOS transistor outputs an indication signal indicating whether the 2-pin battery is connected to the target device. When the 2-pin battery is connected to the target device, it supplies power to the target device. Therefore, based on the switching characteristics of the MOSFET, the pull-up resistor maintaining a high output level and limiting current, and combined with the voltage divider function of the voltage divider unit, a detection circuit is constructed. The structure is simple and can conveniently detect whether the 2-pin battery is in place (i.e., whether the 2-pin battery is connected to the target device) while protecting the 2-pin battery and the target device. There is no need to continuously read the voltage of the battery ADC through software for detection. The steps are simple and the cost is reduced. At the same time, the output signal (i.e., the indication signal) of the detection circuit can determine whether the 2-pin battery is connected to the target device. There is no need to continuously read the signal, and therefore no need to continuously generate signal flow, resulting in minimal current consumption.

[0051] In one possible design, the voltage divider unit includes a first resistor and a second resistor, one end of the first resistor is the first end of the voltage divider unit, the other end of the first resistor is connected to one end of the second resistor, the other end of the first resistor or one end of the second resistor is the second end of the voltage divider unit, and the other end of the second resistor is the third end of the voltage divider unit.

[0052] In this embodiment, as Figure 2 As shown, Figure 2 This is a schematic diagram of a detection circuit provided in another embodiment of this application. The positive terminal of the 2-pin battery is connected to one end of the first resistor R1, the other end of the first resistor R1 is connected to the gate of the first MOS transistor M1, the other end of the first resistor R1 is connected to one end of the second resistor R2, the other end of the second resistor R2 is connected to the source of the first MOS transistor M1, and the other end of the second resistor R2 and the source of the first MOS transistor M1 are both grounded; the drain of the first MOS transistor is connected to the power supply through a pull-up resistor.

[0053] In one possible design, the drain of the first MOS transistor is the output terminal of the detection circuit, used to output the indication signal.

[0054] Specifically, when the indicator signal output by the output terminal of the detection circuit is a low-level signal, it is determined that the 2-pin battery is in the access state, which indicates that the 2-pin battery is connected to the target device.

[0055] When the output signal of the detection circuit is a high-level signal, it is determined that the 2-pin battery is in a disconnected state, which indicates that the 2-pin battery is not connected to the target device.

[0056] This embodiment can be applied to scenarios where the charging chip is not connected to the 2-pin battery or is in a non-operating state (i.e., scenario 1). In scenario 1, the charging chip will not output a square wave to generate interference signals. The output signal of the drain of the NMOS transistor in the detection circuit can be directly used as an indication signal to indicate whether the 2-pin battery is present, i.e., whether the 2-pin battery is connected to the target device. Here, the indication signal is a high-level signal or a low-level signal.

[0057] Specifically, when the battery is in place, the detection circuit works as follows: There is always voltage on BAT+, the gate voltage of the NMOS transistor rises, the NMOS transistor turns on, and the drain of the NMOS transistor outputs a low level. Furthermore, due to the current-limiting effect of the pull-up resistor, there will be no short circuit to VDD ground. Therefore, based on the working principle of the battery in place in scenario 1 above, if the drain of the NMOS transistor outputs a low level, it indicates that the battery is in place.

[0058] If the battery is disconnected, i.e., not in place, there is no voltage on BAT+, the gate voltage of the NMOS transistor decreases, the NMOS transistor turns off, and the drain of the NMOS transistor outputs a high level. Therefore, based on the working principle of the battery not being in place in scenario 1 above, if the drain of the NMOS transistor outputs a high level, it indicates that the battery is not in place.

[0059] Therefore, if the charging chip is not working, the detection result will not be affected by the square wave output by the charging chip. If the output terminal (i.e., the drain of the NMOS transistor) outputs a high level, it means that the 2-pin battery is not in place, that is, the 2-pin battery is not connected to the target device; if it outputs a low level, it means that the 2-pin battery is in place, that is, the 2-pin battery is connected to the target device.

[0060] In one possible design, the positive terminal of the 2-pin battery is connected to a charging chip for charging the 2-pin battery; the detection circuit further includes an inductor and a second MOS transistor; the first terminal of the voltage divider unit is connected to the positive terminal of the 2-pin battery through the inductor, the first terminal of the voltage divider unit is connected to the source of the second MOS transistor, the drain of the second MOS transistor is connected to the third terminal of the voltage divider unit, and the gate of the second MOS transistor is connected to the positive terminal of the 2-pin battery; the inductor is used for charging or discharging.

[0061] When the charging chip outputs a square wave, if the indicator signal output by the output terminal of the detection circuit is a high-level signal, it is determined that the 2-pin battery is in a disconnected state. The disconnected state is used to indicate that the 2-pin battery is not connected to the target device.

[0062] This embodiment can be applied to scenarios where the charging chip is connected to a 2-pin battery or the charging chip is in a working state (i.e., scenario 2). In this scenario 2, the charging chip is always connected to the 2-pin battery unless the 2-pin battery is removed from the target device. As long as the 2-pin battery's power decreases, the charging chip continuously charges the 2-pin battery. However, when the 2-pin battery is not present, the charging chip outputs a square wave to probe whether the 2-pin battery is present and whether charging can continue. If it can continue to output current, the charging chip will continue charging; if the battery is not present, the charging chip cannot perform the charging operation and will continuously output a square wave to probe the battery.

[0063] In scenario 2, the existing technology uses software to continuously read the battery ADC voltage to detect whether the battery is in place. However, this is interfered with by the square wave, causing the battery to be detected as in place intermittently. Therefore, the charging chip continuously outputs square waves to generate interference signals, resulting in low detection accuracy or even failure to detect whether the battery is in place. Furthermore, if the system is in sleep mode or the 2-pin battery is removed, the software will not be aware of this, making it impossible to accurately detect whether the battery is in place.

[0064] To solve the above problem, namely, to accurately detect whether the battery is in place, combined with Figure 3 As shown, Figure 3 This is a schematic diagram of a detection circuit provided in another embodiment of this application. The detection circuit may further include an inductor and a second MOS transistor. Here, the second MOS transistor M2 can be a PMOS transistor. The positive terminal of the 2-pin battery is connected to one end of the first resistor R1 through the inductor L, the positive terminal of the 2-pin battery is connected to the gate of the PMOS transistor, one end of the first resistor R1 is connected to the source of the PMOS transistor, and the drain of the PMOS transistor is connected to the other end of the second resistor R2.

[0065] in, Figure 3 M2 has a diode D packaged in it, while M1 does not have a diode packaged in it. It should be noted that both M1 and M2 can have a diode packaged in them (i.e., the MOSFET may contain a body diode), or they may not have a body diode packaged in them. Figure 3 This is merely an example and is not intended to be specific. Furthermore, the following embodiments involve the case where M2 is packaged with a diode D. Figure 3 Similar statements are made without limitation, and will not be elaborated further here.

[0066] Specifically, in Figure 3 In the circuit diagram shown, for the case where the positive terminal of the 2-pin battery is connected to the charging chip, but the charging chip does not output a square wave: If the 2-pin battery is present, the detection circuit works as follows: There is always voltage on BAT+, the inductor L charges slowly, the gate voltage of the NMOS transistor increases, the NMOS transistor turns on, and the battery presence signal (i.e., indicator signal) outputs a low level. Therefore, in this case, the battery presence signal (i.e., indicator signal) outputs a low level, indicating that the battery is present. If the 2-pin battery is not present, the detection circuit works as follows: There is no voltage on BAT+, the inductor L discharges slowly, the gate voltage of the NMOS transistor decreases, the NMOS transistor turns off, and the battery presence signal (i.e., indicator signal) outputs a high level. Therefore, in this case, the battery presence signal (i.e., indicator signal) outputs a high level, indicating that the battery is not present.

[0067] exist Figure 3The circuit diagram shown illustrates the case where the positive terminal of a 2-pin battery is connected to the charging chip, and the charging chip does not output a square wave:

[0068] Specifically, the battery is disconnected and not in place; simultaneously, the charging chip outputs a square wave, and the detection circuit works as follows:

[0069] If the voltage of BAT+ decreases from high to low, when the charging chip outputs a low level, the current in inductor L cannot change abruptly, thus preventing current from being generated. At this instant, the source (S) of M1 is still at the voltage of BAT+, but the gate (G) of M1 is already at a low level. The voltage Vgs (gate-to-source voltage) of M1 is less than 0V, so M1 conducts, and the energy in inductor L is released instantaneously. The gate (G) of transistor M2 immediately becomes low, M2 turns off, and the battery presence signal outputs a high level.

[0070] If the voltage of BAT+ increases from low to high, when the charging chip outputs a high level, the current of inductor L cannot change abruptly. At the same time, with the impedance of R1 and R2, the current rises slowly, so the voltage between R1 and R2 also rises slowly. Before reaching the voltage required to turn on M2, the low level of the square wave arrives. At this time, although the gate voltage of M2 increases, the PMOS transistor is not turned on, and the 2-pin battery in-position signal outputs a high level.

[0071] Therefore, based on Figure 3 The circuit diagram shown indicates that if the 2-pin battery is present, the signal output is high, meaning the battery is disconnected, i.e., not in place. It is unaffected by the square wave output of the charging chip, and can accurately detect whether the 2-pin battery is present regardless of whether it is removed or in software sleep mode. It is applicable to multiple scenarios and can comprehensively detect whether the 2-pin battery is present.

[0072] In one possible design, see Figure 4 As shown, Figure 4 This is a schematic diagram of a detection circuit provided in another embodiment of this application. The drain of the first MOS transistor is connected to a control unit in the target device, and the control unit is used to determine a control signal based on the detected indication signal.

[0073] The control signal is used to control the target device to perform an operation that matches the indication signal.

[0074] In this embodiment, the output terminal of the detection circuit (i.e., the drain of the first MOS transistor M1) is connected to the control unit. The control unit determines whether to instruct the powered target device to perform an operation or to instruct the relevant unit whether to detect or repair the 2PIN battery if the 2PIN battery is not connected to the target device, based on the indication signal of whether the 2PIN battery is connected to the target device.

[0075] For example, if the indication signal is a high-level signal, indicating that the 2-pin battery is not connected to the target device, the control unit can generate a control signal to indicate the execution of a fault indication operation when it detects the high-level signal, thereby controlling the battery fault indicator light configured in the target device to display, achieving the effect of battery fault indication.

[0076] If the indicator signal is low, it means that the 2-pin battery is connected to the target device. When the control unit detects this low-level signal, it means that the 2-pin battery is normal. It can generate a control signal to indicate that normal prompt operation is being performed, which is used to control the battery normal indicator light in the target device to achieve the effect of indicating that the battery is normal and the target device can be used normally.

[0077] In one possible design, combining Figure 5 or Figure 6 As shown, the drain of the first MOS transistor is connected to the indicator light; if the indicator light is on, it is determined that the drain of the first MOS transistor outputs a high level, which is used to determine that the 2-pin battery is in the disconnected state; if the indicator light is off, it is determined that the drain of the first MOS transistor outputs a low level, which is used to determine that the 2-pin battery is in the connected state.

[0078] In this embodiment, the output terminal of the detection circuit is connected to an indicator light, wherein the indicator light's on-state voltage is high. Specifically, when the output terminal outputs a high level, the indicator light illuminates. Therefore, if the indicator light illuminates, it indicates that the drain of the first MOS transistor is outputting a high level, signifying that the 2-pin battery is disconnected. When the output terminal outputs a low level, the indicator light does not illuminate. Therefore, if the indicator light does not illuminate, it indicates that the drain of the first MOS transistor is outputting a low level, signifying that the 2-pin battery is connected. Thus, using an indicator light allows for a direct and intuitive detection of whether the 2-pin battery is connected to the target device.

[0079] In this embodiment, the characteristic of an inductor preventing sudden changes in current, and the forward conduction and reverse non-conductivity of a diode, are utilized to distinguish between the square wave output by the charging chip and the stable voltage level indicating the presence of the 2-pin battery, thus generating high and low voltage levels. When the battery is not present or the charging chip simultaneously outputs a square wave, the detection circuit outputs a high level. When the battery is present, the detection circuit outputs a low level. This allows for hardware-level differentiation between the square wave output by the charging chip and the consistently high voltage level of the battery (wherein, when the battery is not present, the charging chip outputs a square wave to probe; when the battery is present, the positive terminal of the 2-pin battery always has voltage, representing a continuous voltage state), thereby identifying whether the battery is present.

[0080] Combination Figures 3-6As shown in the figure, this application provides a detection system for detecting whether a 2-pin battery is connected to a target device; the system includes a detection circuit and a charging chip as described in the above embodiment; the charging chip is connected to the positive terminal of the 2-pin battery.

[0081] In this embodiment, based on the switching characteristics of the MOSFET, the pull-up resistor maintaining a high output level and limiting current, and combined with the voltage divider function of the voltage divider unit, a detection circuit is constructed. The structure is simple and enables convenient detection of whether the 2-pin battery is in place (i.e., whether the 2-pin battery is connected to the target device) while protecting the 2-pin battery and the target device. There is no need to continuously read the voltage of the battery ADC through software for detection. The steps are simple and the cost is reduced. At the same time, the output signal (i.e., the indication signal) of the detection circuit can determine whether the 2-pin battery is connected to the target device. There is no need to continuously read the signal, and therefore no need to continuously generate signal flow, resulting in minimal current consumption.

[0082] By utilizing the characteristic that an inductor prevents sudden changes in current and the principle that a diode conducts in the forward direction but not in the reverse direction, the square wave output by the charging chip and the stable voltage level indicating that the 2-pin battery is present can be distinguished, resulting in high and low voltage levels. When the battery is not present or the charging chip simultaneously outputs a square wave, the detection circuit outputs a high voltage level. When the battery is present, the detection circuit outputs a low voltage level. This allows for hardware-level differentiation between the square wave output by the charging chip and the consistently high voltage level of the battery, thus identifying whether the battery is present.

[0083] See Figure 7 , Figure 7 This is a schematic flowchart of a detection method provided in an embodiment of this application; the method is applied to the detection circuit described in the above embodiment. The method includes:

[0084] S701. If the indicator signal output by the output terminal of the detection circuit is a low-level signal, then it is determined that the 2PIN battery is in the access state, and the access state is used to indicate that the 2PIN battery is connected to the target device.

[0085] S702. If the indicator signal output by the output terminal of the detection circuit is a high-level signal, then it is determined that the 2-pin battery is in a disconnected state. The disconnected state is used to indicate that the 2-pin battery is not connected to the target device.

[0086] This embodiment can be applied to scenarios where the charging chip is not connected to the 2-pin battery or is in a non-operating state (i.e., scenario 1). In scenario 1, the charging chip will not output a square wave to generate interference signals. The output signal of the drain of the NMOS transistor in the detection circuit can be directly used as an indication signal to indicate whether the 2-pin battery is present, i.e., whether the 2-pin battery is connected to the target device. Here, the indication signal is a high-level signal or a low-level signal.

[0087] Specifically, when the battery is in place, the detection circuit works as follows: There is always voltage on BAT+, the gate voltage of the NMOS transistor rises, the NMOS transistor turns on, and the drain of the NMOS transistor outputs a low level. Furthermore, due to the current-limiting effect of the pull-up resistor, there will be no short circuit to VDD ground. Therefore, based on the working principle of the battery in place in scenario 1 above, if the drain of the NMOS transistor outputs a low level, it indicates that the battery is in place.

[0088] If the battery is disconnected, i.e., not in place, the detection circuit works as follows: there is no voltage on BAT+, the gate voltage of the NMOS transistor decreases, the NMOS transistor turns off, and the drain of the NMOS transistor outputs a high level. Therefore, based on the working principle of the battery not being in place in scenario 1 above, if the drain of the NMOS transistor outputs a high level, it indicates that the battery is not in place.

[0089] Therefore, if the charging chip is not working, the detection result will not be affected by the square wave output by the charging chip. If the output terminal (i.e., the drain of the NMOS transistor) outputs a high level, it means that the 2-pin battery is not in place, that is, the 2-pin battery is not connected to the target device; if it outputs a low level, it means that the 2-pin battery is in place, that is, the 2-pin battery is connected to the target device.

[0090] The detection method provided in this embodiment is based on the switching characteristics of the MOSFET, the pull-up resistor maintaining a high output level and limiting current, combined with the voltage division function of the voltage divider unit to form a detection circuit. The structure is simple and can conveniently detect whether the 2-pin battery is in place (i.e., whether the 2-pin battery is connected to the target device) while protecting the 2-pin battery and the target device. It does not require continuous reading of the battery ADC voltage through software for detection. The steps are simple and the cost is reduced. At the same time, the output signal (i.e., the indication signal) of the detection circuit can determine whether the 2-pin battery is connected to the target device. There is no need to continuously read the signal, and therefore no need to continuously generate signal flow, resulting in minimal current consumption.

[0091] In one possible design, the positive terminal of the 2-pin battery is connected to a charging chip; the method further includes:

[0092] When the charging chip outputs a square wave, if the indicator signal output by the output terminal of the detection circuit is a high-level signal, then it is determined that the 2-pin battery is in an open state.

[0093] This can be applied to scenarios where the charging chip is connected to a 2-pin battery or the charging chip is in an active state (i.e., Scenario 2). In Scenario 2, the charging chip remains connected to the 2-pin battery unless the 2-pin battery is removed from the target device. As long as the 2-pin battery's charge level decreases, the charging chip continuously charges it. However, when the 2-pin battery is not present, the charging chip outputs a square wave to probe whether the 2-pin battery is present and whether charging can continue. If it can continue outputting current, the charging chip continues charging; if the battery is not present, the charging chip cannot perform the charging operation and continuously outputs a square wave to probe the battery.

[0094] In scenario 2, the existing technology uses software to continuously read the battery ADC voltage to detect whether the battery is in place. However, this is interfered with by the square wave, causing the battery to be detected as in place intermittently. Therefore, the charging chip continuously outputs square waves to generate interference signals, resulting in low detection accuracy or even failure to detect whether the battery is in place. Furthermore, if the system is in sleep mode or the 2-pin battery is removed, the software will not be aware of this, making it impossible to accurately detect whether the battery is in place.

[0095] To solve the above problem, namely, to accurately detect whether the battery is in place, combined with Figure 3 As shown. The detection circuit may also include an inductor and a second MOS transistor. Here, the second MOS transistor M2 can be a PMOS transistor. The positive terminal of the 2-pin battery is connected to one end of the first resistor R1 through the inductor L, the positive terminal of the 2-pin battery is connected to the gate of the PMOS transistor, one end of the first resistor R1 is connected to the source of the PMOS transistor, and the drain of the PMOS transistor is connected to the other end of the second resistor R2.

[0096] Specifically, in Figure 3In the circuit diagram shown, for the case where the interface of the 2-pin battery is connected to the charging chip, but the charging chip does not output a square wave: If the 2-pin battery is present, the detection circuit works as follows: There is always voltage on BAT+, the inductor L charges slowly, the gate voltage of the NMOS transistor increases, the NMOS transistor turns on, and the battery presence signal (i.e., indicator signal) outputs a low level. Therefore, in this case, the battery presence signal (i.e., indicator signal) outputs a low level, indicating that the battery is present. If the 2-pin battery is not present, the detection circuit works as follows: There is no voltage on BAT+, the inductor L discharges slowly, the gate voltage of the NMOS transistor decreases, the NMOS transistor turns off, and the battery presence signal (i.e., indicator signal) outputs a high level. Therefore, in this case, the battery presence signal (i.e., indicator signal) outputs a high level, indicating that the battery is not present.

[0097] exist Figure 3 The circuit diagram shown illustrates the case where the positive terminal of a 2-pin battery is connected to the charging chip, and the charging chip does not output a square wave:

[0098] Specifically, the battery is disconnected and not in place; simultaneously, the charging chip outputs a square wave, and the detection circuit works as follows:

[0099] If the voltage of BAT+ decreases from high to low, when the charging chip outputs a low level, the current in inductor L cannot change abruptly, thus preventing current from being generated. At this instant, the source (S) of M1 is still at the voltage of BAT+, but the gate (G) of M1 is already at a low level. The voltage Vgs (gate-to-source voltage) of M1 is less than 0V, so M1 conducts, and the energy in inductor L is released instantaneously. The gate (G) of transistor M2 immediately becomes low, M2 turns off, and the battery presence signal outputs a high level.

[0100] If the voltage of BAT+ increases from low to high, when the charging chip outputs a high level, the current of inductor L cannot change abruptly. At the same time, with the impedance of R1 and R2, the current rises slowly, so the voltage between R1 and R2 also rises slowly. Before reaching the voltage required to turn on M2, the low level of the square wave arrives. At this time, although the gate voltage of M2 increases, the PMOS transistor is not turned on, and the 2-pin battery in-position signal outputs a high level.

[0101] Therefore, based on Figure 3 The circuit diagram shown indicates that if the 2-pin battery is present, the signal output is high, meaning the battery is disconnected, i.e., not in place. It is unaffected by the square wave output of the charging chip, and can accurately detect whether the 2-pin battery is present regardless of whether it is removed or in software sleep mode. It is applicable to multiple scenarios and can comprehensively detect whether the 2-pin battery is present.

[0102] In one possible design, the drain of the first MOS transistor is connected to a control unit in the target device; the method further includes:

[0103] The indicator signal output from the drain of the first MOS transistor is transmitted to the control unit, so that the control unit determines a control signal based on the detected indicator signal; wherein the control signal is used to control the target device to perform an operation that matches the indicator signal.

[0104] In this embodiment, the output terminal of the detection circuit (i.e., the drain of the first MOS transistor M1) is connected to the control unit. The control unit determines whether to instruct the powered target device to perform an operation or to instruct the relevant unit whether to detect or repair the 2PIN battery if the 2PIN battery is not connected to the target device, based on the indication signal of whether the 2PIN battery is connected to the target device.

[0105] Therefore, by utilizing the characteristic that an inductor prevents sudden changes in current and the principle that a diode conducts in the forward direction but not in the reverse direction, the square wave output by the charging chip and the stable voltage level indicating that the 2-pin battery is present can be distinguished, resulting in high and low voltage levels. When the battery is not present or the charging chip simultaneously outputs a square wave, the detection circuit outputs a high voltage level. When the battery is present, the detection circuit outputs a low voltage level. This allows for hardware-level differentiation between the square wave output by the charging chip and the consistently high voltage level of the battery, thus identifying whether the battery is present.

[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A detection circuit, characterized in that, Used to detect whether a 2-pin battery is connected to the target device; The detection circuit includes: a first MOS transistor, a voltage divider unit, and a pull-up resistor; The first terminal of the voltage divider unit is connected to the positive terminal of the 2-pin battery, the second terminal of the voltage divider unit is connected to the gate of the first MOS transistor, the third terminal of the voltage divider unit is connected to the source of the first MOS transistor, and the third terminal of the voltage divider unit is grounded; the drain of the first MOS transistor is connected to the power supply through a pull-up resistor. The first MOS transistor is used to output an indication signal; wherein, the indication signal is a signal indicating whether the 2-pin battery is connected to the target device; when the 2-pin battery is connected to the target device, it is used to supply power to the target device, and the indication signal is a high-level signal or a low-level signal; The positive terminal of the 2-pin battery is connected to the charging chip, which is used to charge the 2-pin battery; the detection circuit also includes an inductor and a second MOS transistor. The first terminal of the voltage divider unit is connected to the positive terminal of the 2-pin battery through the inductor. The first terminal of the voltage divider unit is connected to the source of the second MOS transistor. The drain of the second MOS transistor is connected to the third terminal of the voltage divider unit. The gate of the second MOS transistor is connected to the positive terminal of the 2-pin battery. The inductor is used for charging or discharging. When the charging chip outputs a square wave, if the indicator signal output by the output terminal of the detection circuit is a high-level signal, it is determined that the 2-pin battery is in a disconnected state. The disconnected state is used to indicate that the 2-pin battery is not connected to the target device.

2. The detection circuit according to claim 1, characterized in that, The drain of the first MOS transistor is the output terminal of the detection circuit, used to output the indication signal; When the indicator signal output by the output terminal of the detection circuit is a low-level signal, it is determined that the 2-pin battery is in the access state, which indicates that the 2-pin battery is connected to the target device. When the output signal of the detection circuit is a high-level signal, it is determined that the 2-pin battery is in a disconnected state, which indicates that the 2-pin battery is not connected to the target device.

3. The detection circuit according to claim 1, characterized in that, The drain of the first MOS transistor is connected to a control unit in the target device, and the control unit is used to determine a control signal based on the detected indication signal; The control signal is used to control the target device to perform an operation that matches the indication signal.

4. The detection circuit according to claim 1, characterized in that, The drain of the first MOS transistor is connected to the indicator light; If the indicator light is on, it indicates that the drain of the first MOS transistor is outputting a high level, which is used to determine that the 2-pin battery is in the off state; If the indicator light is off, it is determined that the drain of the first MOS transistor is outputting a low level, which is used to determine that the 2-pin battery is in the connected state.

5. The detection circuit according to claim 1 or 2, characterized in that, The voltage divider unit includes a first resistor and a second resistor. One end of the first resistor is the first end of the voltage divider unit, and the other end of the first resistor is connected to one end of the second resistor. The other end of the first resistor or one end of the second resistor is the second end of the voltage divider unit, and the other end of the second resistor is the third end of the voltage divider unit.

6. A detection system, characterized in that, The system is used to detect whether a 2-pin battery is connected to a target device; the system includes a detection circuit and a charging chip as described in any one of claims 1-5; the charging chip is connected to the positive terminal of the 2-pin battery.

7. A detection method, characterized in that, The method is applied to the detection circuit according to any one of claims 1-5, wherein the detection circuit is connected to the positive terminal of the 2-pin battery; the method includes: If the indicator signal output by the output terminal of the detection circuit is a low-level signal, it is determined that the 2-pin battery is in the access state, which indicates that the 2-pin battery is connected to the target device. If the output signal of the detection circuit is a high-level signal, it is determined that the 2-pin battery is in a disconnected state, which indicates that the 2-pin battery is not connected to the target device.

8. The detection method according to claim 7, characterized in that, The positive terminal of the 2-pin battery is connected to the charging chip; the method further includes: When the charging chip outputs a square wave, if the indicator signal output by the output terminal of the detection circuit is a high-level signal, then it is determined that the 2-pin battery is in an open state.

9. The detection method according to claim 8, characterized in that, The drain of the first MOS transistor is connected to a control unit in the target device; the method further includes: The indicator signal output from the drain of the first MOS transistor is transmitted to the control unit, so that the control unit determines a control signal based on the detected indicator signal; wherein the control signal is used to control the target device to perform an operation that matches the indicator signal.

Citation Information

Patent Citations

  • Battery state detection system and method

    CN110850308A

  • Switch signal cable breakage detector

    CN114236426A