An earphone AD detection device
By combining a sampling power supply, a voltage sampling circuit, and an analog-to-digital converter, the problem of strict level amplitude requirements in headphone insertion and removal detection is solved, achieving efficient detection over a wide power supply voltage range, reducing costs, and improving headphone audio signal quality.
Patent Information
- Application Number
- CN202110731642.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-30
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2041-06-30
AI Technical Summary
Existing headphone insertion/removal detection methods have strict requirements for the amplitude of level detection, leading to detection failures or increased costs.
By employing a combination of sampling power supply, voltage sampling circuit, detection switch, analog-to-digital converter and processor, the high-precision detection of headphone plug insertion or removal through analog-to-digital converter reduces the requirements for power supply voltage and improves the effectiveness of detection.
It enables effective detection of headphone plug status under a wide range of power supply voltage conditions, reducing product costs and improving detection reliability and headphone audio signal quality.
Smart Images

Figure CN113645557B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of audio speaker products technology, and in particular to an AD detection device for headphones. Background Technology
[0002] Currently, many audio products on the market use a level (1 or 0) detection method for headphone insertion and removal. When headphones are inserted, the plug pushes a mechanical switch inside the headphone socket to change its state (switch on or off). The on or off action of the switch causes the level at the detection point to change to high (1) or low (0). The signal of the high or low level change is transmitted to the CPU detection port. The CPU determines whether the headphone plug is inserted or removed based on the detected high or low level. This detection method has the following disadvantages: when the conversion control level (1) is not high enough or low enough (0), the detection often fails, or the application scenarios are limited. In such cases, the level detection circuit cannot be used, or its use increases costs, etc.
[0003] like Figure 1 As shown, its detection principle is as follows: One end of the pull-up resistor R3 is connected to the power supply VDD. The power supply VDD can be the same as the CPU's power supply or not, but it must share a common ground, and the power supply voltage must be high enough for the CPU to perceive a high level. The other end of resistor R3 is connected to one end of switch (K) (pin 6 of J2), and the other end of switch (K) (pin 1 of J2) is grounded. When the headphone plug is not inserted, the switch (K) is not closed, and the detection point outputs a high detection signal (EAR_DET). The CPU determines that the headphone is not inserted based on the high level of the detection signal (EAR_DET), and the CPU controls the headphone output switch not to output a signal. When the headphone is inserted, the switch (K) is closed, and the detection point outputs a low detection signal (EAR_DET). The CPU determines that the headphone is inserted based on the low level of the detection signal (EAR_DET), and the CPU controls the headphone output switch to output a signal. Therefore, there is an urgent need for a headphone level detection device that solves the problem of strict level amplitude requirements in conventional headphone level detection methods. Summary of the Invention
[0004] In order to overcome the shortcomings of the prior art, the purpose of this invention is to provide an earphone AD detection device, which solves the problem of strict level amplitude requirements in conventional earphone level detection methods.
[0005] This invention provides an earphone AD detection device, including a sampling power supply, a voltage sampling circuit, an earphone jack, a detection switch, an analog-to-digital converter, a processor, and an earphone output switch.
[0006] The sampling power supply is electrically connected to the voltage sampling circuit via the detection switch.
[0007] or
[0008] The sampling power supply is electrically connected to the detection switch via the voltage sampling circuit; the headphone jack is connected to the detection switch.
[0009] The detection switch is connected to the voltage sampling circuit and the analog-to-digital converter, respectively.
[0010] or
[0011] The detection switch is connected to the analog-to-digital converter via the voltage sampling circuit; the analog-to-digital converter is connected to the processor; the processor is connected to the headphone output switch; and the headphone output switch is connected to the headphone jack.
[0012] Furthermore, the voltage sampling circuit consists of pull-up resistors, the sampling power supply is connected to the sixth pin of the detection switch via the pull-up resistors, the detection sampling point is the connection between the pull-up resistors and the sixth pin of the detection switch, and the analog-to-digital converter is connected to the detection sampling point.
[0013] Furthermore, the first pin of the detection switch is grounded, and the headphone output switch is connected to the second and fifth pins of the detection switch.
[0014] Furthermore, half of the sampling power supply is the power supply of the headphone output switch chip and is connected to the first pin of the detection switch. The other half of the sampling power supply is also connected to the first pin of the detection switch.
[0015] Furthermore, the voltage sampling circuit consists of pull-up resistors, one end of which is grounded and the other end is connected to the sixth pin of the detection switch. The detection sampling point is the connection between the pull-up resistor and the sixth pin of the detection switch, and the analog-to-digital converter is connected to the detection sampling point.
[0016] Furthermore, the voltage sampling circuit consists of a pull-up resistor and a second resistor. One end of the pull-up resistor is connected to the sampling power supply, and the other end of the pull-up resistor is connected to one end of the second resistor. The other end of the second resistor is connected to the sixth pin of the detection switch. The detection sampling point is the connection between the pull-up resistor and the second resistor, and the analog-to-digital converter is connected to the detection sampling point.
[0017] Furthermore, the first pin of the detection switch is grounded, and the headphone output switch is connected to the second and fifth pins of the detection switch.
[0018] Furthermore, the sampling power supply is a processor power supply.
[0019] Furthermore, it also includes a first switch, a second resistor, and a second switch. The second resistor is connected in series with the second switch, and the series branch of the second resistor and the second switch is connected in parallel with the first switch. The second resistor is connected between the detection sampling point and the pull-up resistor. One end of the first switch is connected between the connection point of the second resistor and the pull-up resistor and the pull-up resistor, and the other end of the first switch is grounded.
[0020] Furthermore, it also includes a first capacitor, a second capacitor, a third resistor, and a fourth resistor. The second pin of the detection switch is connected to the headphone output switch via the first capacitor. The fifth pin of the detection switch is connected to the headphone output switch via the second capacitor. The second pin of the detection switch is grounded via the third resistor. The third resistor is connected between the second pin of the detection switch and the first capacitor. The fifth pin of the detection switch is grounded via the fourth resistor. The fourth resistor is connected between the fifth pin of the detection switch and the second capacitor.
[0021] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0022] The detection level of this invention does not need to change significantly. As long as the analog-to-digital converter (ADC) accuracy is high enough, the CPU can effectively detect whether the headphone plug is inserted or removed when the level at the detection point changes slightly, thus improving the effectiveness of the detection. The pull-up power supply can be a fixed DC power supply or an AC / DC power supply, increasing the versatility of the pull-up power supply application. When using an AC / DC power supply, the software requires reasonable delay or weighting processing. The power supply requirements for the sampling point are not stringent, and the application scenarios are wide-ranging. For example, if the power supply voltage requirement for the sampling point is not high, as long as the level change at the detection point when the headphone is inserted meets the recognition accuracy of the ADC, it is acceptable. For instance, when the ADC is 10-bit and the ADC IC is powered by 3.3V, the theoretical recognition accuracy conversion voltage is approximately 3.3mV. When the ADC accuracy is higher (e.g., 24-bit / 16-bit / 12-bit), the theoretical recognition conversion voltage is even lower than 3.3mV. This saves on product application costs while improving product quality.
[0023] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it according to the contents of the specification, the preferred embodiments of the present invention are described in detail below with reference to the accompanying drawings. Specific embodiments of the present invention are given in detail below with reference to the accompanying drawings. Attached Figure Description
[0024] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0025] Figure 1 This is a schematic diagram illustrating the working principle of a conventional detection method in the background art of this invention;
[0026] Figure 2 This is a block diagram illustrating the working principle of the headphone AD detection device of the present invention;
[0027] Figure 3 This is a circuit diagram of the headphone AD detection device according to Embodiment 1 of the present invention;
[0028] Figure 4 This is a circuit diagram of the headphone AD detection device according to Embodiment 2 of the present invention;
[0029] Figure 5 This is a circuit diagram of the headphone AD detection device according to Embodiment 3 of the present invention. Detailed Implementation
[0030] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments. It should be noted that, without conflict, the various embodiments or technical features described below can be arbitrarily combined to form new embodiments.
[0031] An earphone AD detection device, such as Figure 2 As shown, the system includes a sampling power supply, a voltage sampling circuit, a headphone jack, a detection switch, an analog-to-digital converter (ADC), a processor, and a headphone output switch. The sampling power supply is electrically connected to the voltage sampling circuit via the detection switch, or the sampling power supply is electrically connected to the detection switch via the voltage sampling circuit. The headphone jack is connected to the detection switch, which is connected to both the voltage sampling circuit and the ADC, or the detection switch is connected to the ADC via the voltage sampling circuit. The ADC is connected to the processor, the processor is connected to the headphone output switch, and the headphone output switch is connected to the headphone jack. The sampling power supply provides power to the voltage sampling circuit, which is controlled by the detection switch of the headphone jack. When the headphone plug is inserted or removed, the detection switch controls the detection sampling point to be open-circuited or short-circuited to ground, or the sampling power supply is disconnected from the voltage sampling circuit, causing the detection sampling point to output a suitable voltage or 0V to ground to the ADC. The ADC converts the input voltage into a digital signal. The processor (CPU) reads the conversion result of the ADC, compares the digital signal with preset parameters, and determines whether a headphone plug is inserted into the headphone jack. When a headphone plug is inserted, the CPU controls the headphone output switch to output a signal; when the headphone plug is not inserted, the CPU controls the headphone output switch to turn off the output signal.
[0032] like Figure 3 As shown, the voltage sampling circuit consists of a pull-up resistor R6. The sampling power supply VDD is connected to the sixth pin of the detection switch (K) of the earphone jack (J1) via the pull-up resistor R6. The detection sampling point is the connection between the pull-up resistor R6 and the sixth pin of the detection switch (K). The output signal EAR_DET is connected to the analog-to-digital converter and the detection sampling point. The first pin of the detection switch (K) is grounded. Figure 3 As shown, it also includes a first capacitor C3, a second capacitor C4, a third resistor R4, and a fourth resistor R5. The second pin of the detection switch (K) is connected to the headphone output switch via the first capacitor C3. The fifth pin of the detection switch (K) is connected to the headphone output switch via the second capacitor C4. The second pin of the detection switch (K) is grounded via the third resistor R4, which is connected between the second pin of the detection switch (K) and the first capacitor C3. The fifth pin of the detection switch (K) is grounded via the fourth resistor R5, which is connected between the fifth pin of the detection switch (K) and the second capacitor C4.
[0033] When the headphone plug is not inserted, the detection switch (K) is in the open state, and the sampling voltage circuit is in open-circuit mode. At this time, the detection signal (EAR_DET) is the sampling power supply voltage output. The ADC acquires the EAR_DET signal and converts it into a digital signal. In this embodiment, the ADC is an internal CPU device, but an external ADC can also be used. The CPU reads the digital signal converted by the ADC and compares it with the preset parameters to determine if the headphone plug is not inserted, and then controls the headphone output switch not to output a headphone signal. When the headphone plug is inserted, the detection switch (K) is in the closed state, and the sampling voltage circuit is in short-circuit mode. At this time, the detection signal (EAR_DET) output is at zero level, the ADC acquires the EAR_DET signal and converts it into a digital signal. The CPU reads the digital signal converted by the ADC and compares it with the preset parameters to determine if the headphone plug is inserted, and then controls the headphone output switch to output a headphone signal.
[0034] The key feature of this embodiment is that the sampling power supply VDD voltage requirement is not stringent, and it can be met in many environments. For example, when the ADC is 10-bit and the AD IC is powered by 3.3V, the theoretical recognition conversion voltage is approximately 3.3mV. If the ADC accuracy is higher (24-bit / 16-bit / 12-bit), the theoretical recognition conversion level accuracy is even lower than 3.3mV. Such power supply conditions are easily met in circuit applications. The sampling power supply VDD must share a common ground with the CPU power supply. To improve the effectiveness and reliability of the circuit, the sampling power supply VDD must be more than twice the recognition accuracy conversion voltage of the ADC.
[0035] like Figure 4As shown, half of the sampling power supply, VDD / 2, comes from half of the headphone output switch chip's power supply, VDD (headphone music output signal reference output 0 level), and is connected to the first pin of the common point of the detection switch (K) of the headphone jack J3. The other half of the sampling power supply, VDD / 2, is also connected to the first pin of the detection switch (K) of the headphone jack J3. The voltage sampling circuit consists of pull-up resistors R9. One end of the pull-up resistor R9 is grounded, and the other end is connected to the sixth pin of the detection switch. The detection sampling point is where the pull-up resistor R9 is connected to the sixth pin of the detection switch, and the output detection signal EAR_DET is generated. The analog-to-digital converter is connected to the detection sampling point, and the detection signal EAR_DET is input to the input terminal of the ADC. When the headphone plug is not inserted, the detection switch (K) is in the open state, and the power supply and pull-up resistor R9 are in open-circuit mode. At this time, the detection signal (EAR_DET) is grounded due to the pull-down resistor R9, and the detection circuit is grounded. The output voltage of the detection signal (EAR_DET) is 0V and sent to the ADC. The ADC acquires the EAR_DET signal and converts it into a digital signal. In this embodiment, the ADC is an internal CPU device, but an external ADC can also be used. The CPU reads the digital signal converted by the ADC and compares it with preset parameters. If the CPU recognizes that the headphone plug is not inserted, it controls the headphone output switch not to output a headphone signal. When the headphone plug is inserted, the detection switch (K) is in the closed state, the sampling voltage circuit is in short-circuit mode, and the detection signal (EAR_DET) outputs at VDD / 2 level. The ADC acquires the EAR_DET signal and converts it into a digital signal. The CPU reads the digital signal converted by the ADC and compares it with preset parameters. If the CPU recognizes that the headphone plug is inserted, it controls the headphone output switch to output a signal.
[0036] The features of this embodiment are: the sampling power supply uses the VDD / 2 headphone output switch chip's power supply voltage (headphone music output reference 0 level), making power connection convenient and eliminating the need for a separate power supply, thus simplifying circuit design. The power supply fully satisfies the CPU's ability to effectively determine whether a headphone plug is inserted when reading ADC data. For example, when the ADC is 10-bit and the ADC IC is powered by 3.3V, the theoretical recognition conversion voltage is approximately 3.3mV, while the operating voltage of the headphone IC is generally greater than or equal to 3.3V. This effectively saves costs and simplifies circuit design: compared to the previous embodiment, this embodiment saves components C3, C4, R4, and R5, as C3 / C4 are large electrolytic capacitors, generally using high-quality capacitors of 100uF or higher, which are not inexpensive. This effectively improves the frequency extension characteristics and sound quality of the headphone output audio signal, thereby effectively improving the headphone's sound effect. Since the capacitance and quality of capacitors C3 / C4 affect the headphone audio signal quality, saving coupling capacitors C3 / C4 improves the headphone audio signal quality.
[0037] like Figure 5 As shown, the sampling power supply VDD comes from the processor power supply. The voltage sampling circuit consists of a pull-up resistor R10 and a second resistor R11. One end of the pull-up resistor R10 is connected to the sampling power supply VDD, and the other end of the pull-up resistor R10 is connected to one end of the second resistor R11. The other end of the second resistor R11 is connected to the sixth pin of the detection switch (K) of the headphone jack (J4). The detection sampling point is at the connection between the pull-up resistor R10 and the second resistor R11. The output signal is EAR_DET. The first pin of the detection switch (K) is grounded, and the analog-to-digital converter is connected to the detection sampling point. Figure 5 As shown, it also includes a first capacitor C5, a second capacitor C6, a third resistor R7, and a fourth resistor R8. The second pin of the detection switch (K) is connected to the headphone output switch via the first capacitor C5. The fifth pin of the detection switch (K) is connected to the headphone output switch via the second capacitor C6. The second pin of the detection switch (K) is grounded via the third resistor R7, which is connected between the second pin of the detection switch (K) and the first capacitor C5. The fifth pin of the detection switch (K) is grounded via the fourth resistor R8, which is connected between the fifth pin of the detection switch (K) and the second capacitor C6. Figure 5 As shown, it also includes a first switch S1, a second resistor R12, and a second switch S2. The second resistor R12 is connected in series with the second switch S2. The series branch of the second resistor R12 and the second switch S2 is connected in parallel with the first switch S1. The second resistor R12 is connected between the detection sampling point and the pull-up resistor R10. One end of the first switch S1 is connected between the connection point of the second resistor R12 and the pull-up resistor R10 and the pull-up resistor R10. The other end of the first switch S1 is grounded.
[0038] When the headphone plug is not inserted, the detection switch (K) is in the open state, the sampling voltage circuit is in open-circuit mode, and the detection signal (EAR_DET) output voltage is VDD voltage (assuming other buttons are not pressed). The ADC acquires the EAR_DET signal and converts it into a digital signal. In this embodiment, the ADC is an internal CPU device, but an external ADC can also be used. The CPU reads the digital signal converted by the ADC and compares it with preset parameters. If the CPU detects that the headphone plug is not inserted, it controls the headphone output switch not to output a headphone signal. When the headphone plug is inserted, the detection switch (K) is in the closed state, the sampling voltage circuit is in short-circuit mode, and the detection signal (EAR_DET) outputs a reasonable level (assuming other buttons are not pressed). The ADC acquires the EAR_DET signal and converts it into a digital signal. The CPU reads the digital signal converted by the ADC and compares it with preset parameters. If it detects that the headphone plug is inserted, it controls the headphone output switch to output a headphone signal.
[0039] The feature of this embodiment is that it saves one I / O port of the CPU and connects the detection to the ADC button function line. When I / O resources are limited, it provides an effective solution for headphone plug detection, but it also increases the complexity of the software. At the same time, it requires that resistor R11 be more than 10 times larger than R12 so that when the detection switch (K) is in a normally closed or normally open circuit, the impact on the ADC button is within a controllable range.
[0040] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any way. Those skilled in the art can readily implement the present invention based on the accompanying drawings and the description above. However, any modifications, alterations, or variations made by those skilled in the art without departing from the scope of the present invention, utilizing the disclosed technical content, are equivalent embodiments of the present invention. Furthermore, any equivalent changes, alterations, or variations made to the above embodiments based on the essential technology of the present invention are still within the protection scope of the present invention.
Claims
1. An earphone AD detection device, characterized in that: It includes a sampling power supply, voltage sampling circuit, headphone jack, detection switch, analog-to-digital converter, processor, and headphone output switch; The sampling power supply is electrically connected to the voltage sampling circuit via the detection switch. or The sampling power supply is electrically connected to the detection switch through the voltage sampling circuit; The headphone jack is connected to the detection switch; The detection switch is connected to the voltage sampling circuit and the analog-to-digital converter, respectively. or The detection switch is connected to the analog-to-digital converter via the voltage sampling circuit; The analog-to-digital converter is connected to the processor, the processor is connected to the headphone output switch, and the headphone output switch is connected to the headphone jack. When the headphone plug is not inserted, the detection switch is in the off state, and the voltage sampling circuit is in open circuit mode. At this time, the detection signal EAR_DET is the sampling power supply voltage output. The analog-to-digital converter collects the EAR_DET signal and converts it into a digital signal. The CPU reads the digital signal converted by the analog-to-digital converter and compares it with the preset parameters to determine whether the headphone plug is not inserted. Then, it controls the headphone output switch to not output the headphone signal. When the headphone plug is inserted, the detection switch is closed, the voltage sampling circuit is in short-circuit mode, the analog-to-digital converter collects the EAR_DET signal, converts it into a digital signal, the CPU reads the digital signal converted by the analog-to-digital converter and compares it with the preset parameters to determine whether the headphone plug is inserted, and then controls the headphone output switch to output the headphone signal. The detection signal EAR_DET is the detection signal output by the detection switch and processed by the voltage sampling circuit.
2. The headphone AD detection device as described in claim 1, characterized in that: The voltage sampling circuit consists of pull-up resistors. The sampling power supply is connected to the sixth pin of the detection switch via the pull-up resistors. The detection sampling point is the connection between the pull-up resistors and the sixth pin of the detection switch. The analog-to-digital converter is connected to the detection sampling point.
3. The headphone AD detection device as described in claim 2, characterized in that: The first pin of the detection switch is grounded, and the headphone output switch is connected to the second and fifth pins of the detection switch.
4. The headphone AD detection device as described in claim 1, characterized in that: Half of the sampling power supply is the power supply of the headphone output switch chip and is connected to the first pin of the detection switch. The other half of the sampling power supply is also connected to the first pin of the detection switch.
5. The headphone AD detection device as described in claim 4, characterized in that: The voltage sampling circuit consists of pull-up resistors, one end of which is grounded and the other end is connected to the sixth pin of the detection switch. The detection sampling point is the connection between the pull-up resistor and the sixth pin of the detection switch, and the analog-to-digital converter is connected to the detection sampling point.
6. The headphone AD detection device as described in claim 1, characterized in that: The voltage sampling circuit consists of a pull-up resistor and a second resistor. One end of the pull-up resistor is connected to the sampling power supply, and the other end of the pull-up resistor is connected to one end of the second resistor. The other end of the second resistor is connected to the sixth pin of the detection switch. The detection sampling point is the connection between the pull-up resistor and the second resistor. The analog-to-digital converter is connected to the detection sampling point.
7. The headphone AD detection device as described in claim 6, characterized in that: The first pin of the detection switch is grounded, and the headphone output switch is connected to the second and fifth pins of the detection switch.
8. The headphone AD detection device as described in claim 6, characterized in that: The sampling power supply is a processor power supply.
9. The headphone AD detection device as described in claim 6, characterized in that: It also includes a first switch, a second resistor, and a second switch. The second resistor is connected in series with the second switch, and the series branch of the second resistor and the second switch is connected in parallel with the first switch. The second resistor is connected between the detection sampling point and the pull-up resistor. One end of the first switch is connected between the connection point of the second resistor and the pull-up resistor and the pull-up resistor, and the other end of the first switch is grounded.
10. An earphone AD detection device as described in claim 3 or 7, characterized in that: It also includes a first capacitor, a second capacitor, a third resistor, and a fourth resistor. The second pin of the detection switch is connected to the headphone output switch via the first capacitor. The fifth pin of the detection switch is connected to the headphone output switch via the second capacitor. The second pin of the detection switch is grounded via the third resistor. The third resistor is connected between the second pin of the detection switch and the first capacitor. The fifth pin of the detection switch is grounded via the fourth resistor. The fourth resistor is connected between the fifth pin of the detection switch and the second capacitor.
Citation Information
Patent Citations
Earphone AD detection device
CN215453275U