CN114501285B - Plug detection circuit and plug detection method - Google Patents

Plug detection circuit and plug detection method Download PDF

Info

Publication number
CN114501285B
CN114501285B CN202011269049.9A CN202011269049A CN114501285B CN 114501285 B CN114501285 B CN 114501285B CN 202011269049 A CN202011269049 A CN 202011269049A CN 114501285 B CN114501285 B CN 114501285B
Authority
CN
China
Prior art keywords
signal
charging
voltage
module
resistor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011269049.9A
Other languages
Chinese (zh)
Other versions
CN114501285A (en
Inventor
张洵
刘明
王晓凡
陈立煌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202011269049.9A priority Critical patent/CN114501285B/en
Publication of CN114501285A publication Critical patent/CN114501285A/en
Application granted granted Critical
Publication of CN114501285B publication Critical patent/CN114501285B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R29/00Monitoring arrangements; Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • H04R1/1025Accumulators or arrangements for charging
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2201/00Details of transducers, loudspeakers or microphones covered by H04R1/00 but not provided for in any of its subgroups
    • H04R2201/10Details of earpieces, attachments therefor, earphones or monophonic headphones covered by H04R1/10 but not provided for in any of its subgroups

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Otolaryngology (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

The application provides a plug detection circuit, which is applied to electronic equipment, wherein the electronic equipment comprises a charging box and a portable device, the charging box comprises a first plug detection circuit and a first logic processing module, and the first plug detection circuit comprises a first voltage excitation module, a first voltage detection module and a current detection module; the first voltage excitation module is used for generating a first signal when detecting that the portable device is contacted with the charging box to generate electric contact; the first voltage detection module is used for converting the first signal into a second signal when detecting the first signal; the current detection module is used for detecting the current of a charging signal of the charging box to the portable device; the first logic processing module is used for determining that the portable device is inserted into the charging box when the voltage of the second signal is larger than or equal to a first threshold value or when the voltage of the second signal is smaller than or equal to a second threshold value, and determining that the portable device is pulled out of the charging box when the current is smaller than or equal to a third threshold value.

Description

Plug detection circuit and plug detection method
Technical Field
The present disclosure relates to the field of electronic devices, and in particular, to a plug detection circuit and a plug detection method.
Background
As users' demand for portability increases, wireless headsets are becoming increasingly popular with multiple users. A wireless headset may be understood as a wireless headset configured with a wireless headset battery and capable of transmitting signals by wireless communication, such as a true wireless stereo (true wireless stereo, TWS) bluetooth headset. Typically, a wireless headset is used in conjunction with a charging cartridge. The charging box can accommodate the wireless earphone and charge the wireless earphone.
In order to realize detection of the insertion or extraction of the wireless earphone, whether the wireless earphone is inserted or extracted in the wireless charging box can be judged by a sensor such as a Hall sensor, an infrared sensor and the like. However, the accuracy of the insertion or extraction detection of the wireless earphone is low through the hall sensor and the magnetic block in the wireless earphone, and the infrared transceiver of the infrared sensor.
Disclosure of Invention
The application provides a plug detection circuit and a plug detection method, which can improve the accuracy of detecting the insertion or the extraction of a wireless earphone.
In a first aspect, the present application provides a plug detection circuit that may be applied to an electronic device, where the electronic device includes a charging cartridge and a portable apparatus, the charging cartridge may include a first plug detection circuit and a first logic processing module, and the first plug detection circuit may include a first voltage excitation module, a first voltage detection module, and a current detection module; wherein: a first voltage excitation module for generating a first signal when it is detected that the portable device is in contact with the charging cartridge to generate an electrical contact; the first voltage detection module is used for converting the first signal into a second signal when detecting the first signal; the current detection module is used for detecting the current of a charging signal of the portable device by the charging box; and the first logic processing module is used for determining that the portable device is inserted into the charging box when the voltage of the second signal is larger than or equal to a first threshold value or when the voltage of the second signal is smaller than or equal to a second threshold value and determining that the portable device is pulled out of the charging box when the current is smaller than or equal to a third threshold value.
In the scheme provided by the application, in order to realize the detection of the insertion or extraction of the wireless charging box to the portable device, the insertion or extraction of the portable device at different stages can be judged by combining the current and the voltage. For example, it is possible to determine that the portable device is inserted into the charging cartridge based on the voltage when the charging cartridge is not charging the portable device, and to determine that the portable device is pulled out of the charging cartridge based on the current when the charging cartridge is charging the portable device. By the embodiment of the application, the accuracy of detecting the insertion or extraction of the wireless earphone can be improved.
In one possible implementation manner, the charging box further comprises a box cover opening and closing detection module, and the box cover opening and closing detection module is used for detecting that the charging box is opened or closed; the first logic processing module is further configured to control the first plug detection circuit to be powered on when the lid opening/closing detection module detects that the charging box is opened.
In one possible implementation, the current detection module includes a first resistor and a first analog-to-digital converter (ADC); the first ADC is used for converting the charging signal flowing through the first resistor into a third signal and sending the third signal to the first logic processing module.
In one possible implementation, the current detection module further comprises a first programmable gain amplifier (pmgrammable gain amplifier, PGA); the first end of the first resistor is coupled with the first input end of the first PGA, the second end of the first resistor is coupled with the second input end of the first PGA, the output end of the first PGA is coupled with the first end of the first ADC, the first end of the first resistor is the input end of the current detection module, and the second end of the first ADC is the output end of the current detection module; the first PGA is used for amplifying the voltage of the charging signal flowing through the first resistor to obtain a third signal; the first ADC, configured to convert the charging signal flowing through the first resistor into a third signal, and send the third signal to the first logic processing module includes: the first ADC is configured to convert the third signal into a fourth signal, and send the fourth signal to the first logic processing module.
In one possible implementation, the current detection module includes a first metal oxide semiconductor (metal oxide semiconductor, MOS) tube, a first resistor, and a first ADC; the grid of the first MOS tube is a first input end of the current detection module, the drain electrode of the first MOS tube is a second input end of the current detection module, the first resistor is respectively coupled with the source electrode of the first MOS tube and the first end of the first ADC, and the second end of the first ADC is an output end of the current detection module; the first MOS tube is used for proportionally converting the current of the charging signal into a third signal; the first resistor is used for enabling the voltage of the third signal to be converted into a fourth signal in proportion to the voltage of the third signal; the first ADC is configured to convert the fourth signal into a fifth signal, and send the fifth signal to the first logic processing module.
In one possible implementation, the first voltage excitation module includes a first switch and a second resistor; the first end of the first switch is an input end of the first voltage excitation module, the second end of the first switch is coupled with the first end of the second resistor, and the second end of the second resistor is an output end of the first voltage excitation module.
In one possible implementation, the first voltage excitation module includes a first switch, a second resistor, and a third resistor; the first end of the first switch is the input end of the first voltage excitation module, the second resistor is respectively coupled with the second end of the first switch and the first end of the third resistor, the first end of the second switch is coupled with the second end of the third resistor, and the second end of the second switch is the output end of the first voltage excitation module.
In one possible implementation, the first voltage detection module includes a second ADC for converting the first signal into a second signal.
In one possible implementation, the first voltage detection module further includes a second PGA; the first end of the second PGA is the input end of the first voltage detection module, the second end of the second PGA is coupled with the first end of the second ADC, and the second end of the second ADC is the output end of the first voltage detection module; the second PGA is configured to amplify the first signal; the second ADC for converting the first signal to a second signal comprises: the second ADC is used for converting the amplified first signal into a second signal.
In a second aspect, the present application provides a plug detection method, which may be applied to a plug detection circuit, where the plug detection circuit is applied to an electronic device, where the electronic device includes a charging box and a portable device, where the charging box includes a first plug detection circuit and a first logic processing module, where the first plug detection circuit includes a first voltage excitation module, a first voltage detection module, and a current detection module, and includes: generating a first signal when the first voltage excitation module detects that the portable device is in contact with the charging box to generate electric contact; when the first signal is detected by the first voltage detection module, the first signal is converted into a second signal; detecting a current of a charging signal of the charging box to the portable device through a current detection module; determining, by the first logic processing module, that the portable device is inserted into the charging cartridge when the voltage of the second signal is greater than or equal to a first threshold value, or when the voltage of the second signal is less than or equal to a second threshold value, and determining, by the first logic processing module, that the portable device is pulled out of the charging cartridge when the current is less than or equal to a third threshold value.
In one possible implementation manner, the charging box further includes a box cover opening and closing detection module, and the method further includes: detecting that the charging box is opened or closed through the box cover opening and closing detection module; when the box cover opening and closing detection module detects that the charging box is opened, the first plug detection circuit is controlled to be electrified through the first logic processing module.
Drawings
Fig. 1 is a schematic diagram of interaction between a headset and a charging box according to an embodiment of the present application;
FIG. 2 is a schematic diagram of another earphone and charging cartridge interaction provided by an embodiment of the present application;
FIG. 3 is a schematic diagram of still another earphone and charging cartridge interaction provided by an embodiment of the present application;
FIG. 4 is a schematic diagram of yet another earphone and charging cartridge interaction provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of still another earphone and charging cartridge interaction provided by an embodiment of the present application;
FIG. 6 is a schematic diagram of a Hall sensor with a reverse output voltage according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram of an application scenario provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of a plug detection circuit according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a current detection module according to an embodiment of the present application;
Fig. 10 is a schematic structural diagram of a voltage excitation module according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a voltage detection module according to an embodiment of the present application;
fig. 12-14 are schematic structural diagrams of a detection circuit according to an embodiment of the present application;
fig. 15 is a schematic structural diagram of another plug detection circuit according to an embodiment of the present disclosure;
fig. 16 is a schematic diagram of a charging communication circuit according to an embodiment of the present application;
fig. 17 is a schematic diagram of another charging communication circuit according to an embodiment of the present application;
fig. 18 is a schematic diagram of another charging communication circuit according to an embodiment of the present disclosure;
fig. 19 is a schematic structural diagram of a charging communication detection chip according to an embodiment of the present application;
FIG. 20 is a schematic diagram of a modulation signal according to an embodiment of the present application;
fig. 21 is a flow chart of a plug detection method provided in an embodiment of the present application;
FIG. 22 is a flowchart illustrating another method for detecting a plug according to an embodiment of the present disclosure;
FIG. 23 is a schematic diagram of a portable device status determination according to an embodiment of the present application;
fig. 24 is a schematic diagram of another embodiment of determining a state of a portable device.
Detailed Description
The embodiment of the application provides a plug detection circuit and a plug detection method, which can improve the accuracy of detecting the insertion or the extraction of a wireless earphone. The technical solutions in the embodiments of the present application will be clearly and thoroughly described below with reference to the accompanying drawings. Wherein, in the description of the embodiments of the present application, "/" means or is meant unless otherwise indicated, for example, a/B may represent a or B; the text "and/or" is merely an association relation describing the association object, and indicates that three relations may exist, for example, a and/or B may indicate: the three cases where a exists alone, a and B exist together, and B exists alone, and in addition, in the description of the embodiments of the present application, "plural" means two or more than two.
The terms "first," "second," and the like, are used below for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. It should be understood that the embodiments described below are only some, but not all, of the embodiments of the present application.
In order to facilitate understanding of the present application, first, related technical knowledge related to the embodiments of the present application will be described herein.
A wireless headset may be understood as a wireless headset configured with a wireless headset battery and capable of transmitting signals by wireless communication, such as a TWS bluetooth headset. TWS earphone product form and function have realized innovating by a wide margin with regard to bluetooth earphone in the past, have both got rid of traditional lightweight bluetooth earphone and have had only single ear, can't enjoy the defect of stereophonic music, have got rid of traditional neck string formula or headphone again, have a connecting wire, lead to the motion scene inconvenient to and accomodate the difficulty.
For the wearing comfort and the aesthetic demands of users, TWS wireless headsets are generally small and light, so that the battery capacity is smaller than that of the traditional Bluetooth headsets, and the duration of scenes such as music, conversation and the like commonly used by users is much shorter than that of neck-mounted headsets. Therefore, a charging box is generally allocated to improve the endurance time of the earphone, that is, when the user does not use the TWS earphone, the earphone can be put into the charging box to be charged, the earphone is guaranteed to be in a full-charge state when the user takes out the earphone for use each time, and the purpose of long endurance is achieved through a large battery of the charging box. The charging box also plays a role in accommodating the earphone, and prevents users from carelessly losing the small things due to improper accommodating.
Because there is a charging box, the charging box will necessarily need some basic charging management modules, including wired charging and wireless charging for the earphone, when charging, the charging state and electric quantity of the earphone and the charging box are displayed through light emitting diode (light emitting diode, LED) lamps and the like, the charging box integrated keys are used for binaural pairing or restoring factory settings, and the electric quantity of the charging box of the earphone is notified for reporting to the mobile phone, and the charging management modules are displayed in Application (APP), negative screen or status bar of the mobile phone. Based on the above functions, a logic processing module (e.g., a microcontroller (micro controller unit, MCU)) is required to control the charging box, and the MCU of the charging box needs to be upgraded. These demands can result in a significant amount of information interaction between the headset and the charging cartridge in addition to charging.
In existing TWS wireless headset designs, there are two schemes for this charging and information interaction. Referring to fig. 1, fig. 1 is a schematic diagram illustrating interaction between a headset and a charging box according to an embodiment of the present application. As shown in fig. 1, when the earphone and the charging box interact, information interaction can be realized through bluetooth or other wireless communication modes, the interaction is without any physical contact, and two or more physical contacts, such as a spring PIN (POGO PIN) or a spring sheet, are added to realize a charging function. If the wireless scheme such as Bluetooth is adopted for communication, because the charging box is additionally provided with an additional Bluetooth chip, the volume of the charging box can be increased, the power consumption is increased to influence the endurance, the cost is increased, and the complexity of software is increased. Wireless communication is also susceptible to environmental interference, and a large number of Wi-Fi signals and bluetooth signals exist in places such as airports, railway stations, malls, exhibitions and the like, so that the scheme is not reliable and safe in wired communication.
Referring to fig. 2, fig. 2 is a schematic diagram illustrating interaction between an earphone and a charging box according to another embodiment of the present application. As shown in fig. 2, when the earphone and the charging box interact, information interaction can be realized in a wired communication mode, and the interaction is physical contact, or through a POGO PIN or a shrapnel, and two or more physical contacts are added at the same time, so that a charging function is realized. The wired communication module can be a special chip or integrated into the MCU. Because of the limited volume above the headset, it is difficult to place multiple contact points, requiring multiplexing of the charging and communication contacts. This multiplexing has two implementations, and referring to fig. 3, fig. 3 is a schematic diagram of interaction between a headset and a charging box according to an embodiment of the present application. As shown in fig. 3, when the earphone and the charging box interact, the communication signal is loaded on the charging signal through the modulation chip, which is similar to the principle of a power cat, namely, the communication is realized while charging, and the communication and charging functions are realized through the carrier signal to the modulated communication signal. Referring to fig. 4, fig. 4 is a schematic diagram illustrating interaction between a headset and a charging box according to an embodiment of the present application. As shown in fig. 4, when the earphone and the charging box are in interaction, charging or communication can be realized through a switch, the switch is swung to a charging path during charging, and the switch is swung to a communication path during communication. The switch may be a real switching device, or may be a MOS transistor or a transistor.
As mentioned above, the solution of wired communication is that the earphone has a limited size, so that it is difficult to place a plurality of contact points, and it is also related to the form of the earphone, and usually, 2-3 contact pins are placed at most. In view of this, it is generally necessary to multiplex the charging contacts and the communication contacts. However, the two schemes of multiplexing adopt a scheme of switching charging and communication by a switch, and communication cannot be carried out when charging is finished, and the charging and communication channels can be switched only by polling, that is, every fixed negotiated time, so that the charging is often interrupted, the charging speed is influenced, and the service life of the battery is also influenced by repeated switching. The frequency of such polling must not be very high, which in turn further affects the real-time nature of the communication.
Although the modulation chip solves the concurrent problem of charging and communication, the earphone also needs to add a plug detection circuit, please refer to fig. 5, fig. 5 is a schematic diagram of interaction between the earphone and the charging box according to another embodiment of the present application. As shown in fig. 5, conventional plug detection is currently implemented mainly by using a sensor scheme, such as a hall sensor or a proximity sensor. For example, hall sensors or infrared sensors may be used to detect relevant locations in the charging cartridge to determine whether the headset is being loaded into or unloaded from the charging cartridge. If the Hall sensor is adopted, a piece of small magnetic material can be respectively placed in the left earphone and the right earphone, the Hall sensor is placed at the relevant position of the charging box, and the Hall sensor can output variable information when the earphone is inserted or pulled out; if the infrared sensor is adopted, the infrared sensor can be placed at the relevant position in the charging box, and the infrared sensor can output variable information when the earphone is inserted or pulled out. Referring to fig. 6, fig. 6 is a schematic diagram illustrating output voltage flipping of a hall sensor according to an embodiment of the present application. As shown in fig. 6, for the hall sensor scheme, a plurality of magnets can be arranged in the charging box, the hall sensor is arranged in the earphone, when the earphone is in the box, the magnetic field state sensed by the hall sensor is different from the magnetic field state sensed by the earphone when the earphone is out of the box, the output voltage of the hall sensor can be overturned, and after the overturned output voltage is transmitted to the MCU through a general purpose input output port (general purpose input/output, GPIO), the MCU can learn whether the earphone is in or out of the charging box, and make corresponding actions of connecting with the bluetooth of the mobile phone, etc. Of course, the hall sensor can be arranged in the charging box, the magnet can be arranged in the earphone, or the recognition function can be realized through the magnet of the loudspeaker in the earphone, and the hall sensor and the magnet can be arranged on both sides. The implementation of the proximity light sensor is similar, i.e. the earphone, after being inserted into the charging box, blocks the light path, which is felt by the charging box. However, the hall sensor and the earphone have fast magnetism, the infrared emitting device and the infrared receiving device which are needed to be adopted by the infrared sensor have higher cost and larger occupied space, and only whether the earphone is positioned at a relevant position or not can be detected, and whether the electric connection contact of the earphone is reliably connected with the electric connection contact corresponding to the charging box or not can not be detected.
Based on the above problems, the application provides a plug detection circuit and a plug detection method, which can improve the accuracy of detecting the insertion or the extraction of a wireless earphone.
In this embodiment of the present application, the plug detection circuit may be applied to an electronic device, where the electronic device includes a charging box and a portable device, the charging box may include a first plug detection circuit and a first logic processing module, and the first plug detection circuit may include a first voltage excitation module, a first voltage detection module, and a current detection module; wherein: a first voltage excitation module for generating a first signal when it is detected that the portable device is in contact with the charging cartridge to generate an electrical contact; the first voltage detection module is used for converting the first signal into a second signal when detecting the first signal; the current detection module is used for detecting the current of a charging signal of the portable device by the charging box; the first logic processing module is used for determining that the portable device is inserted into the charging box when the voltage of the second signal is larger than or equal to a first threshold value or when the voltage of the second signal is smaller than or equal to a second threshold value and determining that the portable device is pulled out of the charging box when the current is smaller than or equal to a third threshold value. To detect the insertion or extraction of the wireless charging cartridge into or from the portable device, the insertion or extraction of the portable device at different stages may be judged in combination with the current and the voltage. For example, it is possible to determine that the portable device is inserted into the charging cartridge based on the voltage when the charging cartridge is not charging the portable device, and to determine that the portable device is pulled out of the charging cartridge based on the current when the charging cartridge is charging the portable device. Therefore, by the embodiment of the application, the accuracy of detecting the insertion or extraction of the wireless earphone can be improved.
In order to better understand the plug detection circuit and the plug detection method provided in the embodiments of the present application, an application scenario of the embodiments of the present application is described below. The application may be applicable to a split or closed scenario between headphones and a wearable device. There is the relation of plug separation and reunion between wearing equipment and the earphone, or multiplexed the contact that charges the physical contact of communication. The wearable device may include one or more of an earphone, a watch, a bracelet, glasses, and the like. The earphone may include a neck-hanging earphone hung on the head and neck, a headphone, an in-ear/half-open/single-ear bluetooth earphone or a TWS bluetooth earphone, a bluetooth/wired dual-purpose earphone with a wire, and the like. The glasses may include augmented reality (augmented reality, AR), virtual Reality (VR), mixed Reality (MR), and the like. The watch wristband may include a time-only, sports and health detection enabled wristband, a lightweight smart watch, or a luxury high-end watch, among others. For example: referring to fig. 7, fig. 7 is a schematic diagram of an application scenario provided in an embodiment of the present application. As shown in fig. 7, the application scenario may include a charging box 701 and a wireless headset 702. Wherein, the charging box 701 can house and charge the wireless earphone 702. In the embodiment of the present application, the wireless headset 702 may be a true wireless stereo (true wireless stereo, TWS) headset, including two headsets (also referred to as earpieces) that are worn on the left and right ears of the user, respectively. Wherein the two headphones can be placed in the charging box 701 for charging. The charging box 701 can communicate with the wireless earphone 702, so as to realize operations such as forced pairing, startup and shutdown. The charging interface and the communication interface of the charging box 701 and the wireless headset 702 may exist independently or may be combined together. The wireless headset 702 may also communicate with the terminal via bluetooth technology, including Basic Rate (BR)/enhanced rate (enhanced data rate, EDR) bluetooth and bluetooth low energy (bluetooth low energy, BLE). The terminal may be a smart phone, media player (e.g., MP3, MP4, etc.), tablet, personal digital assistant (personal digital assistant, PDA), television or smart watch, etc.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a plug detection circuit according to an embodiment of the present application. As shown in fig. 8, the plug detection circuit may be applied to an electronic apparatus including a charging cartridge and a portable device. The charging box may include a first plug detection circuit, a first logic processing module, a first charging chip (charge), and a power supply. The first plug detection circuit may include a first voltage excitation module, a first voltage detection module, and a current detection module. Wherein:
a first voltage excitation module for generating a first signal when it is detected that the portable device is in contact with the charging cartridge to generate an electrical contact;
the first voltage detection module is used for converting the first signal into a second signal when detecting the first signal;
the current detection module is used for detecting the current of a charging signal of the portable device by the charging box;
and the first logic processing module is used for determining that the portable device is inserted into the charging box when the voltage of the second signal is larger than or equal to a first threshold value or when the voltage of the second signal is smaller than or equal to a second threshold value and determining that the portable device is pulled out of the charging box when the current is smaller than or equal to a third threshold value.
Optionally, the charging box may further include a box cover opening and closing detection module. The box cover opening and closing detection module is used for detecting that the charging box is opened or closed; the first logic processing module is further used for controlling the first plug detection circuit to be electrified when the box cover opening and closing detection module detects that the charging box is opened.
Optionally, when the current is greater than the third threshold, that is, the charging box is charging the portable device, the first logic module may control the first voltage detection module to power off, the first voltage detection module may not power off, and continue to operate, and the first logic processing module may not determine that the portable device pulls out the charging box through the voltage value detected by the first voltage detection module.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a current detection module according to an embodiment of the present application. The current detection module can detect the charging current of the portable device by converting the resistor into the voltage. As shown in fig. 9 (a), the current detection module may include a first resistor and a first ADC. Optionally, the current detection module may further include a first PGA. Wherein:
the first end of the first resistor is coupled with the first input end of the first PGA, the second end of the first resistor is coupled with the second input end of the first PGA, the output end of the first PGA is coupled with the first end of the first ADC, the first end of the first resistor is the input end of the current detection module, and the second end of the first ADC is the output end of the current detection module.
Optionally, the input end of the current detection module may be a voltage stabilizing circuit formed by MOS transistors M0 and M1.
A first PGA for amplifying a voltage flowing through the first resistor charge signal to obtain a third signal;
and the first ADC is used for converting the third signal into a fourth signal and transmitting the fourth signal to the first logic processing module.
As shown in fig. 9 (b), the current detection module may include a first MOS transistor, a first resistor, and a first ADC. Wherein:
the grid electrode of the first MOS tube is a first input end of the current detection module, the drain electrode of the first MOS tube is a second input end of the current detection module, the source electrode of the first MOS tube is respectively coupled with the first ADC and the first end of the first resistor, and the second end of the first resistor is an output end of the current detection module.
Alternatively, the input end of the current detection module may be a regulated power supply circuit formed by M0 and M1. M1 may be a power MOS transistor in the charging box for providing a charging current to the portable device in the first charging chip, and the source of M2 and the source of M1 are coupled through another proportional MOS transistor M2, i.e. the gate of M2 and the gate of M1 are coupled, so that the current flowing through M2 is proportional to M1.
The first MOS tube is used for proportionally converting the current of the charging signal into a third signal;
The first resistor is used for enabling the voltage of the third signal to be converted into a fourth signal in proportion to the voltage of the third signal;
and the first ADC is used for converting the fourth signal into a fifth signal and transmitting the fifth signal to the first logic processing module.
In this embodiment, as shown in fig. 9 (a), a resistor for detecting a current is added to a charging path from the charging box to the portable device, so that a voltage drop occurs when the charging current flows through the first resistor, and a corresponding current change can be obtained by detecting a voltage across the first resistor. In the charging process, the abrupt change of the output current of the first charging chip caused by the abrupt pull-out of the portable device can be perceived by the first logic processing module, that is, the first logic processing module determines that the portable device pulls out the charging box as shown in fig. 9 (b), the proportional charging current can be obtained through mirroring the MOS tube of the charging path, the proportional charging current can be converted into the proportional voltage through coupling the first resistor under M2, and the proportional charging current is sent to the first logic processing module after analog-digital conversion by the first ADC, so that the current abrupt change caused by the pulling-out of the charging box of the portable device can be detected, and the first logic processing module can determine that the portable device pulls out the charging box.
Referring to fig. 10, fig. 10 is a schematic structural diagram of a voltage excitation module according to an embodiment of the present application. As shown in fig. 10 (a), the voltage excitation module may include a first switch and a second resistor. The first resistor may be a pull-up resistor. Wherein:
the first end of the first switch is an input end of the first voltage excitation module, the second end of the first switch is coupled with the first end of the second resistor, and the second end of the second resistor is an output end of the first voltage excitation module.
As shown in fig. 10 (b), the voltage excitation module may include a first switch and a second resistor. The first resistor may be a pull-down resistor. Wherein:
the first end of the first switch is an input end of the first voltage excitation module, the second end of the first switch is coupled with the first end of the second resistor, and the second end of the second resistor is an output end of the first voltage excitation module.
As shown in fig. 10 (c), the voltage excitation module may include a first switch, a second resistor, and a third resistor. Wherein:
the first end of the first switch is an input end of the first voltage excitation module, the second resistor is respectively coupled with the second end of the first switch and the first end of the third resistor, the first end of the second switch is coupled with the second end of the third resistor, and the second end of the second switch is an output end of the first voltage excitation module.
Referring to fig. 11, fig. 11 is a schematic structural diagram of a voltage detection module according to an embodiment of the present application. As shown in fig. 11 (a), the voltage detection module may include a second ADC. Wherein:
and a second ADC for converting the first signal into a second signal.
As shown in fig. 11 (b), the voltage detection module may further include a second PGA, i.e., the voltage detection module may include a second ADC and a second PGA. Wherein:
the first end of the second PGA is the input end of the first voltage detection module, the second end of the second PGA is coupled with the first end of the second ADC, and the second end of the second ADC is the output end of the first voltage detection module.
A second PGA for amplifying the first signal;
the second ADC for converting the first signal to a second signal includes:
and the second ADC is used for converting the amplified first signal into a second signal.
The portable device as shown in fig. 8 may include a second plug detection circuit, a second logic processing module, a second charging chip, and a power supply. The second plug detection circuit comprises a second voltage excitation module and a second voltage detection module. The second voltage excitation module may be the same as the first voltage excitation module, and the second voltage detection module may be the same as the first voltage detection module, which is not described herein. It should be understood that the electronic device in fig. 8 includes various modules only as an example, and the connection manner of the various modules is not limited in this application.
In one embodiment, the logic processing module may be an MCU. For example, the first logic processing module may be a first MCU and the second logic processing module may be a second MCU.
Optionally, the first plug detection circuit and the second plug detection circuit may have identical circuit structures, i.e. may be made into identical chips, and different functions may be implemented by configuring different registers.
In one possible implementation, the first voltage excitation module may be coupled to the first voltage detection module and the second voltage excitation module may be coupled to the second voltage detection module. Specific:
referring to fig. 12-14, fig. 12-14 are schematic structural diagrams of a detection circuit according to an embodiment of the present application. As shown in fig. 12, the first voltage detection module may be coupled to the first voltage excitation module and the first logic processing module, respectively, and the second voltage detection module may be coupled to the second voltage excitation module and the second logic processing module, respectively, and the first voltage excitation module is coupled to the second voltage excitation module. The first voltage excitation module may include a first switch and a second resistor, the second resistor may be a pull-down resistor, and the first voltage detection module may include a second ADC. The second voltage excitation module can comprise a second switch and a third resistor, the third resistor can be a pull-up resistor, and the resistance values of the second resistor and the third resistor can be equal or unequal. The second voltage detection module may include a third ADC. When the charging box side is a pull-down resistor and the portable device side is a pull-up resistor, the first logic processing module may determine that the portable device is inserted into the charging box when the voltage value detected by the first voltage detection module is changed from small to large and is greater than or equal to a first threshold value. The second logic processing module may determine that the portable device is inserted into the charging cartridge when the voltage value detected by the second voltage detection module is changed from large to small, and is less than or equal to a certain threshold.
As shown in fig. 13, the first voltage detection module may be coupled to the first voltage excitation module and the first logic processing module, respectively, and the second voltage detection module may be coupled to the second voltage excitation module and the second logic processing module, respectively, and the first voltage excitation module is coupled to the second voltage excitation module. The first voltage excitation module may include a first switch and a second resistor, the second resistor may be a pull-up resistor, and the first voltage detection module may include a second ADC. The second voltage excitation module can comprise a second switch and a third resistor, the third resistor can be a pull-down resistor, and the resistance values of the second resistor and the third resistor can be equal or unequal. The second voltage detection module may include a third ADC. When the charging cartridge side is a pull-up resistor and the portable device side is a pull-down resistor, the first logic processing module may determine that the portable device is inserted into the charging cartridge when the voltage value detected by the first voltage detection module is changed from large to small and is less than or equal to the second threshold. The second logic processing module may determine that the portable device is inserted into the charging cartridge when the voltage value detected by the second voltage detection module is changed from small to large and is greater than or equal to a certain threshold.
As shown in fig. 14, the first voltage detection module may be coupled to the first voltage excitation module and the first logic processing module, respectively, and the second voltage detection module may be coupled to the second voltage excitation module and the second logic processing module, respectively, and the first voltage excitation module is coupled to the second voltage excitation module. The first voltage excitation module can comprise a first switch, a second resistor and a third resistor, wherein the second resistor can be a pull-up resistor, the third resistor can be a pull-down resistor, and the resistance values of the second resistor and the third resistor can be equal or unequal. The first voltage detection module may include a second ADC and a second PGA. The second voltage excitation module may include a third switch, a fourth resistor and a fifth resistor, where the fourth resistor may be a pull-up resistor, the fifth resistor may be a pull-down resistor, and the resistance values of the fourth resistor and the fifth resistor may be equal or unequal. The second voltage detection module may include a third ADC and a third PGA.
In one possible implementation, referring to fig. 15, fig. 15 is a schematic structural diagram of another plug detection circuit according to an embodiment of the present application. The circuit shown in fig. 15 may further include a current detection module on the basis of fig. 14. The input end of the current detection module is coupled with the first charging chip, and the output end of the current detection module is coupled with the first logic processing module. The connection manner of the specific current module may be described with reference to fig. 9, and will not be described herein.
Optionally, the first PGA and the first ADC in the current detection module at the charging box side may be implemented by using a time division multiplexing method with the second PGA and the second ADC in the first voltage detection module.
In one possible implementation, referring to fig. 16, fig. 16 is a schematic diagram of a charging communication circuit according to an embodiment of the present application. As shown in fig. 16, an implementation based on carrier communication may be concurrent with charging for communication. The circuit may include a first inductor L1, a first charging chip, a first plug detection module, a first communication module, a first logic processing module, a first capacitor C1, a first power supply, a second inductor L2, a second charging chip, a second plug detection module, a second communication module, a second logic processing module, and a second capacitor C2. The first charging chip is coupled with the first power supply, L1 is respectively coupled with the first charging chip, the first plug detection module and C1, the first plug detection module is coupled with the first logic processing module, and the first communication module is respectively coupled with the C1 and the first logic processing module. The second charging chip is coupled with a second power supply, L2 is respectively coupled with the second charging chip, the second plug detection module and C2, the second plug detection module is coupled with the second logic processing module, and the second communication module is respectively coupled with the C2 and the second logic processing module.
The method can be divided into a charging communication scene and a non-charging communication scene.
For a charging communication scenario: the first communication module can obtain signals from a digital interface (such as SPI/I2C/I3C/UART) of the first logic processing module, encode the signals through a protocol, and then send the encoded signals to the bus through the transmitting module and the driving module. Because of the isolation between L1 and C1, the charging can be carried out by low-frequency signals, the communication can be carried out by high-frequency signals, the communication and the charging can be concurrent and do not interfere with each other, and after the opposite end receives the signals, the useful communication signals are demodulated and then transmitted to the logic processing module through the digital interface.
For non-charging communication scenarios: the charging box end can pull up the power supply at any time to inform the portable device side of communication, and the portable device side can determine the communication requirement through whether the input voltage on the contact pin changes. Alternatively, the portable device side can pull up the voltage of the contact pin, and the implementation method is similar to the plug detection circuit, and the intention of communication of the other party can be notified and perceived through the change of the voltage or the current.
Referring to fig. 17, fig. 17 is a schematic diagram of another charging communication circuit according to an embodiment of the present application. As shown in fig. 17, the circuit may include a first inductor L1, a first charging chip, a first plug detection module, a first communication module, a first logic processing module, a first capacitor C1, a first power supply, a second inductor L2, a second charging chip, a second plug detection module, a second communication module, a second logic processing module, and a second capacitor C2. The first charging chip is respectively coupled with the first power supply, the L1 and the first plug detection module, the L1 is respectively coupled with the first plug detection module and the C1, the first plug detection module is coupled with the first logic processing module, and the first communication module is respectively coupled with the C1 and the first logic processing module. The second charging chip is respectively coupled with a second power supply, L2 and a second plug detection module, the L2 is respectively coupled with the second charging chip, the second plug detection module and C2, the second plug detection module is coupled with a second logic processing module, and the second communication module is respectively coupled with the C2 and the second logic processing module.
Referring to fig. 18, fig. 18 is a schematic diagram of another charging communication circuit according to an embodiment of the present application. For charging and communication, the scene can be switched through switch switching, and the plug detection module can be connected to the contact pin between the portable device side and the charging box, so that the plug detection method is realized. As shown in fig. 18, the circuit may include a first charging chip, a first switch, a first communication module, a first plug detection module, a first logic processing module, a first power supply, a second charging chip, a second switch, a second communication module, a second plug detection module, a second logic processing module, and a second power supply. The first charging chip is respectively coupled with the first power supply and the first switch, the first switch is respectively coupled with the first communication module and the first plug detection module, the first communication module is coupled with the first logic processing module, and the first plug detection module is coupled with the first logic processing module. The first switch is used for switching the first charging chip to work or the first communication module to work. The second charging chip is respectively coupled with a second power supply and a second switch, the second switch is respectively coupled with a second communication module and a second plug detection module, the second communication module is coupled with a second logic processing module, and the second plug detection module is coupled with the second logic processing module. And the second switch is used for switching the second charging chip to work or the second communication module to work.
The charging chip, the communication module, and the plug detection module of fig. 16, 17, and 18 can realize a highly integrated chip. The first charging chip, the first communication module and the first plug detection module on the charging box side can be customized into an integrated circuit chip, namely the chip can integrate the three modules of the first charging chip, the first communication module and the first plug detection module, and the functions of the three modules are combined. The second charging chip, the second communication module and the second plug detection module on the portable device side can be customized into an integrated circuit chip, namely, the chip can integrate the three modules of the second charging chip, the second communication module and the second plug detection module, and the functions of the three modules are combined. In one embodiment, the contact pins between the portable device and the charging cartridge may retain only both power and ground.
Referring to fig. 19, fig. 19 is a schematic structural diagram of a charging communication detection chip according to an embodiment of the present application. As shown in fig. 19, the charging communication detection chip may include a charging chip (charge), a digital control module (digital control), a reset detection (reset detection) module, a watchdog (watch dog) module, a serial peripheral interface (serial peripheral interface, SPI)/a bidirectional two-wire synchronous serial bus (inter-integrated circuit bus, I2C/IIC)/a high-speed bidirectional two-wire synchronous serial bus (advanced inter-integrated circuit bus, I3C)/a universal asynchronous receiver/transmitter (universal asynchronous receiver transmitter, UART) module, an analog bandgap (OSC)/a low dropout regulator (low dropout regulator, LDO) module, a cap opening/closing detection (box cover opening and closing detection) module, a plug detection (insert/unplugging detection) module, a communication detection (communication detection) module, a collision detection (conflict detection) module, a cancellation (loopback cancellation) module, a driving module, a receiving module, and a transmitting module.
The digital signal control module can be used for a module for communicating with the MCU, namely the MCU can enable the chip to work, the chip can send an interrupt signal to the MCU, and the MCU responds; the reset detection module can be used for detecting reset signals on the contact pins, and as the earphone has only two pins which are multiplexed as a power supply and a ground, the reset signals sent by the charging box need to be restored through decoding, so that the situation that after the earphone program runs off, the earphone can be restored only after the battery is completely discharged is prevented; the watchdog module is a watchdog feeding signal which is set by the MCU after the chip is enabled, and if the MCU does not feed dogs again after the specified time is reached, the chip can send a reset signal to the MCU for resetting; the SPI/I2C/I3C/UART module is a module for communicating with the MCU, analog Bandgap/OSC/LDO and the like are Analog parts which are necessary for the operation of the chip, namely, voltage references are needed to be provided for power supply parts such as LDO and the like, an internal oscillator is needed to generate clocks needed by the operation of a digital circuit, or an external crystal or crystal oscillator is needed to generate clocks; the open box detection module can be used for receiving an open cover signal of the charging box, and the signal can be derived from a Hall sensor or a near light sensor on the charging box and used as a valve for starting the earphone access box circuit to work; the plug detection module is used for detecting that the earphone is pulled out or plugged into the charging box; the communication detection module is used for detecting whether the opposite terminal equipment needs to initiate communication or not; the collision detection module is used for detecting whether signals on the contact pins collide or not in communication, and only two pins are used, so that half duplex can be realized, namely, signal collision can exist, and the collision detection module needs to be added. When the earphone sends out signals, the charging box can send out signals at the same time, at the moment, because the signals conflict, the signals on the pins are not the signals sent by the earphone end and the charging box end, then the earphone end or the charging box end can respectively check the signals which the earphone end wants to send out and the signals on the pins (such as the bit by bit check), if the signals are the same, the signals indicate that the signals have no conflict, if the signals are different, the digital signal control module can be informed, according to a pre-negotiated mechanism, for example, the earphone side can avoid waiting for 100ms, the charging box side can firstly communicate for 100ms and the like. The cancellation module is also used for eliminating the detected signal on the contact pin, and the signal sent by one end may have residues, because the devices such as capacitance, inductance and resistance on the pin exist, the contact pin is not charged to a high level or discharged to a ground level without time, but the formula of t=cu/I needs to be satisfied, if only capacitance is considered, the formula becomes more complex after the inductance and the resistance are considered, that is, a certain time is needed to restore the contact pin to an ideal state, the communication speed is affected by the restoration of the waiting state, and if high-speed communication is needed, the signal residues are necessarily present on the contact pin, so that a filtering mechanism of the self signal can be increased, that is, the signal generated by the user at the previous time can be predicted. On the side of the device, whether the collision detection module has a signal of the opposite end or not can be known, and whether the signal of the last time point remains or not can be known when the signal is received. Since the devices such as the resistor, the capacitor and the inductor on the contact pins are passive devices which consume energy, a driver module with certain voltage and current driving capability is needed to charge and discharge the passive devices, the passive devices are parasitic, such as the impedance of the contact pins, the contact impedance, the parasitic capacitance of the input pins of a switch or a charging chip, and the like, and some devices are added to prevent electrostatic discharge (ESD), such as transient diodes (transient voltage suppressor, TVS), or voltage stabilizing capacitors at the input ends of the charging chip are added to stabilize the voltage of the input pins; the receiving (receiver) module is used for receiving the communication signals subjected to noise filtering; a transmission module to enable the driving module to transmit a communication signal; the communication protocol (protocol) is used for encoding signals obtained from the SPI and other data ports into signals to be transmitted by the transmitting module, or decoding signals received by the receiving module and then giving the signals to the MCU through the SPI.
There are a number of implementations of specific codecs. Referring to fig. 20, fig. 20 is a schematic diagram of a modulation signal according to an embodiment of the present application.
As shown in fig. 20 (a), a high level of 66.6% and a low level of 33.4% may be represented by a number 1 and a low level of 33.4% and a high level of 66.6% may be represented by a number 0 in one clock period (the inverse ratio of the communication speed, for example, a communication speed of 1kbps is 1ms for one clock period). Alternatively, the percentages of the high level and the low level may be adjusted to 50% and 50%, or 80% and 20%.
As shown in fig. 20 (b), a 50% early high level and a 50% late low level may be represented by a numeral 1, and a 50% early low level and a 50% late high level may be represented by a numeral 0. Alternatively, the number 1 may represent 80% of the first high level and the number 20% of the second low level, and the number 0 may represent 20% of the first high level and the number 80% of the second low level. Assuming no clock or aligned sync signal, it is necessary to prevent the peer from decoding completely in error due to delay caused by the resistive-capacitive sense on the line.
As shown in fig. 20 (c), a 50% early high level and a 50% late low level may be represented by a number 1, and no signal may be represented by a number 0.
As shown in fig. 20 (d), a more complex modulation scheme may be used, i.e., four 50%/50% high and low levels and two waiting periods may be represented by the numeral 1, and two 50%/50% high and low levels and four waiting periods may be represented by the numeral 0. Or with higher order codec, each three cycles may be represented by a data that contains 1-3 bits (bits) of information. For example, three 50%/50%/50% high and low levels may be represented by numeral 111, two 50%/50% high and low levels and one waiting period may be represented by numeral 110, or three 50%/50%/50% high and low levels may be represented by numeral 11, and two 50%/50% high and low levels and one waiting period may be represented by numeral 10 for anti-interference. Optionally, a cyclic redundancy check (cyclic redundancy check, CRC) or other check means may be added after a packet of data to prevent the erroneous packet from being decoded.
Referring to fig. 21, fig. 21 is a flowchart of a plug detection method according to an embodiment of the present application. The plug detection method is applied to a plug detection circuit, the plug detection circuit is applied to an electronic device, as shown in fig. 8, the electronic device comprises a charging box and a portable device, the charging box comprises a first plug detection circuit and a first logic processing module, and the first plug detection circuit comprises a first voltage excitation module, a first voltage detection module and a current detection module. As shown in fig. 21, the plug detection method may include the following steps.
2101. When the portable device is detected to be in contact with the charging box to generate electric contact through the first voltage excitation module, a first signal is generated.
2102. When the first signal is detected by the first voltage detection module, the first signal is converted into a second signal.
2103. The current of the charging signal of the charging box to the portable device is detected by the current detection module.
2104. Determining, by the first logic processing module, that the portable device is inserted into the charging cartridge when the voltage of the second signal is greater than or equal to the first threshold value, or when the voltage of the second signal is less than or equal to the second threshold value; when the current is less than or equal to the third threshold, it is determined by the first logic processing module that the portable device is unplugged from the charging cartridge.
In one possible embodiment, the charging cartridge may further include a cartridge cover opening and closing detection module, and the plug detection method may further include: the charging box is detected to be opened or closed through the box cover opening and closing detection module, and when the box cover opening and closing detection module detects that the charging box is opened, the first plug detection circuit is controlled to be electrified through the first logic processing module.
The plug detection circuit needs to be started under the condition that the charging box is uncapped, because the charging box structure is not strictly screwed, the portable device side is in the charging box, and misjudgment of software pulling out the portable device side caused by separation of the portable device side and a charging contact pin (pin) of the charging box is prevented in a scene that a user runs and the like easily causes certain vibration.
In one possible implementation manner, the plug detection method may further include: when the current is larger than the third threshold value, the first logic processing module can control the first voltage detection module to be powered off, the first voltage detection module can not be powered off and work continuously, and the first logic processing module can judge that the portable device is pulled out of the charging box without the voltage value detected by the first voltage detection module.
Specifically, the portable device side can be inserted into or removed from the charging box, and the case can be divided into two cases, that is, when the charging box side charges the portable device side or when the charging box does not charge the portable device side.
When the charging cartridge side charges the portable device side, in one embodiment, as shown in fig. 8, a current detection module may be added to the charging path of the charging chip of the charging cartridge to the portable device side, where the current detection module may be used to monitor whether the charging current of the charging cartridge to the portable device side changes. In another embodiment, for the portable device side, it is possible to determine whether the portable device side has pulled out of the charging cartridge by detecting an abrupt change in the input voltage of the input terminal, i.e., the portable device side charging chip. When the portable device side is charged by the charging case, the voltage of the input terminal of the portable device side charging chip is generally higher than the voltage of the battery of the portable device side, but when the portable device side is pulled out of the charging case, the input terminal of the portable device side charging chip floats, that is, the voltage is rapidly reduced to a voltage of extremely low proximity to Ground (GND), so that the judgment that the portable device side is pulled out of the charging case when the portable device side is charged can be realized by the change of the voltage.
When the charging cartridge side does not charge the portable device side, it can be classified into two cases where the charging cartridge and the portable device side are in a communication state and a non-communication state.
In one embodiment, when the portable device is pulled out of the charging cartridge, communication is interrupted immediately for communication between the charging cartridge and the portable device side. In one possible implementation, the communication may be resumed over a number of attempts and after waiting for a number of times, if no more replies are received, it may be determined that the portable device side is not already within the charging cartridge. In another possible implementation manner, the charging box side can also detect whether the charging current exists for secondary confirmation by restoring the charging to the portable device side, and the portable device side can perform the next action, namely, connect back to the mobile phone and wait for confirmation of the mobile phone. If the portable device side is successfully connected to the mobile phone, it can be confirmed that the portable device side has been pulled out of the charging cartridge.
The charging box and the portable device side are in a non-communication state and can be divided into a state that the electric quantity of the portable device side is full and a standby state; or the portable device side end is in a power-off state or a power-on state just awakened from the power-off state for saving power.
For the standby state, both the charging cartridge and the portable device side are in the awake state, and at this time, both the charging cartridge and the charging chip on the portable device side are in the off state, and thus the path is in the high-impedance state. As shown in fig. 12 and 13, if the resistances of the two resistors are equal, the voltage on the portable device side is high when the charging cartridge is not inserted or just pulled out, the voltage on the charging cartridge side is low, and when the portable device side is inserted into the charging cartridge and makes good contact, the voltage is half of the voltage, and then the ADC can determine the value of the voltage on the charging cartridge side and the portable device side, respectively, so that it is possible to detect whether the portable device side is in the charging cartridge.
Alternatively, the current may be amplified by the PGA, etc., before it enters the ADC. For example, the second PGA and the third PGA in fig. 14 are optional, which is not limited in this application.
Referring to fig. 22, fig. 22 is a flowchart of another plug detection method according to an embodiment of the present disclosure. As shown in fig. 22, the method may include the following steps.
2201. Whether the box cover is opened or not is detected by the box cover opening and closing detection module, if yes, step 2202 is executed.
The charging box can receive the box opening operation of a user, so that whether the box cover is opened or not can be detected through the box cover opening and closing detection module.
The charging box determines whether to open the box cover, and if it is determined that the box cover is open, step 2202 is performed. With the open-cover judgment logic, the power saving state of the portable device side in the charging box can be processed by whether the cover is opened or not. The portable device side is allowed to close when the charging cartridge cover is closed. When the lid of the charging box is opened, the charging box outputs a high voltage through the charging chip end, the purpose of starting through the side end of the portable device is achieved, the speed from starting the power-on of the side end of the portable device to the normal work of software is required to be very fast, the speed is within the fastest time required from uncovering to pulling out the side of the portable device by a user, namely, when the side of the portable device is pulled out by the user, the side of the portable device is awake. It is understood that the communication state and the standby state are only the case where the lid is opened and the charging is not performed.
2202. The first plug detection circuit is electrified, and the position of the marker box cover is 1.
2203. The charging box judges whether the portable device side is in the box, if so, step 2206 is executed; if the portable device side is not in the case, step 2204 is performed.
2204. The charging box detects whether the portable device side is inserted, and if the portable device side is detected to be inserted, step 2205 is executed; if no portable device side insertion is detected, step 2208 is performed.
2205. The charging cartridge detects the state position 1 on the portable device side.
2206. The charging box judges whether the portable device side is pulled out, and if the portable device side is detected to be pulled out, step 2207 is executed; if the portable device side pull-out is not detected, step 2208 is performed.
2207. The charging cartridge marks the state position 0 on the portable device side.
2208. Detecting whether the box cover is closed or not through a box cover opening and closing detection module, and executing step 2209 if the box cover is closed; if it is determined that the box cover is not closed, the process returns to step 2203.
2209. The first plug detection circuit is powered down, and the position of the marker box cover is 0.
Among the above steps, the specific implementation manner of step 2203-step 2207 may be as follows:
the voltage excitation of the charging box is assumed to be a pull-up resistor, the pull-up voltage is VDD, the voltage excitation of the portable device side is assumed to be a pull-down resistor, the resistance value is inconsistent with the resistance value of the pull-up resistor of the charging box, the resistor is large, VDD and the charging level are different, VDD/2 and a communication high level signal are different, for example, vdd=3v, the communication high level is 1.2V, and the charging voltage is 3.7V-5V.
Referring to fig. 23, fig. 23 is a schematic diagram of determining a state of a portable device according to an embodiment of the present application. As shown in fig. 23, the second ADC on the charging box side converts the voltage of the first signal from a voltage signal to a digital signal, and after the digital signal is sent to the first logic processing module, the first logic processing module can determine the plugging state of the portable device side and the charging box by monitoring the voltage value from the second ADC. Assuming that the voltage from the second ADC is V2, when the voltage is more than or equal to 3.7V and less than or equal to 5V, the portable device side is in a (in) charging state, judging whether the current of the charging link is more than 0, and if so, continuously monitoring the voltage value of V2; if the value is smaller than 0, the portable device is judged to be pulled out, and the state position of the portable device is 0. When v2=3v, the portable device side is not in the box, and the state position of the portable device side is 0. When v2=1.5v, the portable device side is in a box or box state, judging whether the portable device side needs to be charged, returning to a charging process of the portable device side if the portable device side needs to be charged, and continuously monitoring the voltage value of V2 if the portable device side does not need to be charged; when V2 is more than or equal to 0V and less than or equal to 1.2V, the portable device side is in a communication state. When v2=0v, it is judged that the portable device side is in an abnormal condition, the detection circuit is restarted, and if v2=0v is reported to be wrong after the detection circuit is restarted.
Referring to fig. 24, fig. 24 is a schematic diagram of another embodiment of determining a state of a portable device. As shown in fig. 24, the third ADC on the portable device side converts the input voltage from a voltage signal to a digital signal, and after the digital signal is sent to the second logic processing module, the second logic processing module can determine the plugging state of the portable device side and the charging box by monitoring the voltage value of the input voltage from the third ADC. Assuming that the input voltage from the third ADC is V0, when 3.7 v+.v0+.5v, then the portable device side is in (in) the charged state, continuing to monitor the voltage value of the input voltage. When v0=1.5v, the portable device side is in a box or box state, judging whether the portable device side needs to be charged, returning to the process of charging the portable device side if the portable device side needs to be charged, and continuously monitoring the V0 voltage value if the portable device side does not need to be charged; when V0 is more than or equal to 0 and less than or equal to 1.2V, the portable device side is in a communication state. When v0=0v and the duration is longer than 100ms, it is determined that the portable device side is in the out-of-box state. When V0 is other value, the portable device side is abnormal, the plug detection circuit is restarted, if V0 is still other value after the plug detection circuit is restarted, the error is reported.

Claims (11)

1. The plug detection circuit is characterized by being applied to electronic equipment, wherein the electronic equipment comprises a charging box and a portable device, the charging box comprises a first plug detection circuit and a first logic processing module, and the first plug detection circuit comprises a first voltage excitation module, a first voltage detection module and a current detection module;
the first voltage excitation module is used for generating a first signal when detecting that the portable device is in contact with the charging box to generate electric contact;
the first voltage detection module is used for converting the first signal into a second signal when the first signal is detected;
the current detection module is used for detecting the current of a charging signal of the charging box to the portable device;
the first logic processing module is configured to determine that the portable device is inserted into the charging box when the voltage of the second signal is less than or equal to a second threshold value and determine that the portable device is pulled out of the charging box when the current is less than or equal to a third threshold value, when the voltage of the second signal is greater than or equal to a first threshold value, or when the voltage of the second signal is greater than or equal to a second threshold value, when the voltage of the second signal is greater than or equal to a second threshold value.
2. The circuit of claim 1, wherein the charging cartridge further comprises a cartridge cover opening and closing detection module for detecting that the charging cartridge is opened or closed; the first logic processing module is further configured to control the first plug detection circuit to be powered on when the lid opening/closing detection module detects that the charging box is opened.
3. The circuit of claim 1 or 2, wherein the current detection module comprises a first resistor and a first analog-to-digital converter ADC;
the first analog-digital converter ADC is configured to convert the charging signal flowing through the first resistor into a third signal, and send the third signal to the first logic processing module.
4. The circuit of claim 3, wherein the current detection module further comprises a first programmable gain amplifier PGA;
a first end of the first resistor is coupled to a first input end of the first programmable gain amplifier PGA, a second end of the first resistor is coupled to a second input end of the first programmable gain amplifier PGA, an output end of the first programmable gain amplifier PGA is coupled to a first end of the first analog-to-digital converter ADC, the first end of the first resistor is an input end of the current detection module, and a second end of the first analog-to-digital converter ADC is an output end of the current detection module;
The first programmable gain amplifier PGA is configured to amplify the voltage of the charging signal flowing through the first resistor to obtain a third signal;
the first ADC for converting the charging signal flowing through the first resistor into a third signal, and sending the third signal to the first logic processing module includes:
the first analog-to-digital converter ADC is used for converting the third signal into a fourth signal and sending the fourth signal to the first logic processing module.
5. The circuit of claim 3, wherein the current detection module comprises a first metal oxide semiconductor MOS transistor, a first resistor, and a first analog-to-digital converter ADC;
the grid of the first metal oxide semiconductor MOS tube is a first input end of the current detection module, the drain electrode of the first metal oxide semiconductor MOS tube is a second input end of the current detection module, the first resistor is respectively coupled with the source electrode of the first metal oxide semiconductor MOS tube and the first end of the first analog-digital converter ADC, and the second end of the first analog-digital converter ADC is an output end of the current detection module;
The first metal oxide semiconductor MOS tube is used for proportionally converting the current of the charging signal into a third signal;
the first resistor is used for enabling the voltage of the third signal to be converted into a fourth signal in proportion to the voltage of the third signal;
the first analog-to-digital converter ADC is configured to convert the fourth signal into a fifth signal, and send the fifth signal to the first logic processing module.
6. The circuit of claim 5, wherein the first voltage excitation module comprises a first switch and a second resistor;
the first end of the first switch is an input end of the first voltage excitation module, the second end of the first switch is coupled with the first end of the second resistor, and the second end of the second resistor is an output end of the first voltage excitation module.
7. The circuit of claim 5, wherein the first voltage excitation module comprises a first switch, a second resistor, and a third resistor;
the first end of the first switch is the input end of the first voltage excitation module, the second resistor is respectively coupled with the second end of the first switch and the first end of the third resistor, the first end of the second switch is coupled with the second end of the third resistor, and the second end of the second switch is the output end of the first voltage excitation module.
8. The circuit of claim 7, wherein the first voltage detection module comprises a second ADC for converting the first signal to a second signal.
9. The circuit of claim 8, wherein the first voltage detection module further comprises a second PGA;
the first end of the second PGA is the input end of the first voltage detection module, the second end of the second PGA is coupled with the first end of the second ADC, and the second end of the second ADC is the output end of the first voltage detection module;
the second PGA is configured to amplify the first signal;
the second ADC for converting the first signal to a second signal comprises:
the second ADC is used for converting the amplified first signal into a second signal.
10. The method is applied to a plug detection circuit, the plug detection circuit is applied to an electronic device, the electronic device comprises a charging box and a portable device, the charging box comprises a first plug detection circuit and a first logic processing module, the first plug detection circuit comprises a first voltage excitation module, a first voltage detection module and a current detection module, and the method comprises the following steps:
Generating a first signal when the first voltage excitation module detects that the portable device is in contact with the charging box to generate electric contact;
when the first signal is detected by the first voltage detection module, the first signal is converted into a second signal;
detecting a current of a charging signal of the charging box to the portable device through a current detection module;
in the case where the charging cartridge side is a pull-down resistor, the portable device is a pull-up resistor, when the voltage of the second signal is greater than or equal to a first threshold value, or in the case where the charging cartridge side is a pull-up resistor, when the voltage of the second signal is less than or equal to a second threshold value, it is determined by the first logic processing module that the portable device is inserted into the charging cartridge, and when the current is less than or equal to a third threshold value, it is determined by the first logic processing module that the portable device is pulled out of the charging cartridge.
11. The method of claim 10, wherein the charging cartridge further comprises a cartridge cover opening and closing detection module, the method further comprising:
detecting that the charging box is opened or closed through the box cover opening and closing detection module;
When the box cover opening and closing detection module detects that the charging box is opened, the first plug detection circuit is controlled to be electrified through the first logic processing module.
CN202011269049.9A 2020-11-13 2020-11-13 Plug detection circuit and plug detection method Active CN114501285B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011269049.9A CN114501285B (en) 2020-11-13 2020-11-13 Plug detection circuit and plug detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011269049.9A CN114501285B (en) 2020-11-13 2020-11-13 Plug detection circuit and plug detection method

Publications (2)

Publication Number Publication Date
CN114501285A CN114501285A (en) 2022-05-13
CN114501285B true CN114501285B (en) 2023-05-16

Family

ID=81490093

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011269049.9A Active CN114501285B (en) 2020-11-13 2020-11-13 Plug detection circuit and plug detection method

Country Status (1)

Country Link
CN (1) CN114501285B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117330999A (en) * 2022-06-30 2024-01-02 深圳英集芯科技股份有限公司 Circuit for detecting equipment plug and related electronic equipment
WO2024065180A1 (en) * 2022-09-27 2024-04-04 深圳市韶音科技有限公司 Detection method, electronic device, and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110166871A (en) * 2019-05-31 2019-08-23 歌尔科技有限公司 Earphone charging box, TWS earphone, work state switching method and storage medium
CN209517460U (en) * 2019-03-29 2019-10-18 深圳市烁讯电子有限公司 A kind of earphone charging box
CN110572738A (en) * 2019-10-08 2019-12-13 上海爻火微电子有限公司 wireless earphone charging circuit and wireless earphone box
CN110602598A (en) * 2019-10-24 2019-12-20 歌尔科技有限公司 Wireless earphone, charging box and wireless earphone charging system
CN209930507U (en) * 2019-07-23 2020-01-10 深圳英集芯科技有限公司 A double-circuit plug detection circuitry for TWS bluetooth headset storehouse of charging
CN111131954A (en) * 2019-12-27 2020-05-08 歌尔科技有限公司 Wireless earphone charging box, earphone in-out box detection method, system and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7627128B2 (en) * 2008-01-14 2009-12-01 Apple Inc. Methods of calibrating tone-based communications systems
CN201789630U (en) * 2010-09-08 2011-04-06 中兴通讯股份有限公司 Headset plugging detection circuit

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN209517460U (en) * 2019-03-29 2019-10-18 深圳市烁讯电子有限公司 A kind of earphone charging box
CN110166871A (en) * 2019-05-31 2019-08-23 歌尔科技有限公司 Earphone charging box, TWS earphone, work state switching method and storage medium
CN209930507U (en) * 2019-07-23 2020-01-10 深圳英集芯科技有限公司 A double-circuit plug detection circuitry for TWS bluetooth headset storehouse of charging
CN110572738A (en) * 2019-10-08 2019-12-13 上海爻火微电子有限公司 wireless earphone charging circuit and wireless earphone box
CN110602598A (en) * 2019-10-24 2019-12-20 歌尔科技有限公司 Wireless earphone, charging box and wireless earphone charging system
CN111131954A (en) * 2019-12-27 2020-05-08 歌尔科技有限公司 Wireless earphone charging box, earphone in-out box detection method, system and storage medium

Also Published As

Publication number Publication date
CN114501285A (en) 2022-05-13

Similar Documents

Publication Publication Date Title
US9414147B2 (en) Method and device for earphone and USB to share micro-USB interface
US9615159B2 (en) Method and device for supplying power for active noise cancelation earphone by utilization of power source of electronic equipment
KR20190039515A (en) Systems and techniques for remote bus activation
CN114501285B (en) Plug detection circuit and plug detection method
CN210536885U (en) Earphone charging box circuit, earphone charging box, earphone and communication system
US20130058495A1 (en) System and A Method For Streaming PDM Data From Or To At Least One Audio Component
US11665462B1 (en) Headband identification for a headphone system
KR100979845B1 (en) Intergrated circuit and signal processing device using the same
CN111971904B (en) Data design on power line
US10847979B2 (en) Charging and communication system
CN108733609B (en) Switching circuit, intelligent switching device and switching method of double USB interfaces
KR20140061982A (en) Usb peripheral device detection on an unpowered bus
CN110944076A (en) Electronic equipment and accessory with quick charging and audio transmission functions
CN107889012B (en) Wireless earphone capable of charging wearable device
TW201901459A (en) Method for controlling audio device and system thereof
CN113949116B (en) Data transmission method and device
CN110518673B (en) Wireless earphone charging circuit, wireless earphone and wireless earphone charging method
CN111698597A (en) Charging box and control method thereof, wireless earphone and control method thereof
CN207518016U (en) Wireless charging built-up circuit and device
CN113315209B (en) Charging bin circuit, charging bin terminal, charging method and networking method
CN215818589U (en) Circuit structure of charging box and charging box
CN114286249A (en) Earphone charging box circuit, earphone charging box, earphone circuit, earphone and assembly
CN116095554A (en) Wireless Bluetooth headset charging box system and communication method thereof
CN115699457A (en) 2-pogo pin design for TWS headset
US20220060041A1 (en) Device and method of detecting attachment and detachment of portable device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant