Adaptive Push to Talk Switch Detection

Systems and methods for detecting a state of at least one button are disclosed herein. The method detects a first signal of a headset of a user. The first signal is indicative of the headset being coupled to a device. The headset has a microphone and at least one button. The method determines, based on the detected first headset signal, a first voltage of the microphone, and sets, based on the first voltage of the microphone, a threshold voltage for detecting a state of the at least one button. The method stores the threshold voltage and determines a second voltage of the microphone. The method compares the second voltage of the microphone and the stored threshold voltage, and generates, based on the comparison, a signal indicative of a state of the at least one button.

BACKGROUND

A wired analog headset with a 3.5 mm connector (e.g., a phone connector) can connect to a device (e.g., a laptop, tablet, smartphone, etc.) and can support various functions via a plurality of headset buttons (e.g., volume up, volume down, play, stop, etc.). Each button, when pressed by a user, positions a shunt resistor across the microphone connection. These shunt resistors are low value resistors and can sway the resulting voltage level away from the nominal microphone audio signal level to avoid false button press detection. A headset can implement a push to talk (PTT) application via a PTT button which requires a user to press and hold the PTT button when speaking and to release the PTT button when listening. The PTT button, when pressed, positions a resistor across a microphone connection to the device to indicate that PTT is active. A PTT button is not well suited for use with a low value resistor because it can attenuate the microphone audio signal.

DETAILED DESCRIPTION

Examples disclosed herein are directed to a method for detecting a state of at least one button, comprising: detecting a first signal of a headset of a user, the first signal being indicative of the headset being coupled to a device, and the headset having a microphone and at least one button; determining, based on the detected first headset signal, a first voltage of the microphone; setting, based on the first voltage of the microphone, a threshold voltage for detecting a state of the at least one button; storing the threshold voltage; determining a second voltage of the microphone; comparing the second voltage of the microphone and the stored threshold voltage; and generating, based on the comparison, a signal indicative of a state of the at least one button.

Additional examples disclosed herein are directed to a system for detecting a state of at least one button comprising a memory configured to store computer executable instructions; and a processor configured to interface with the memory and execute the computer executable instructions to cause the processor to: detect a first signal of a headset of a user, the first signal being indicative of the headset being coupled to a device, and the headset having a microphone and at least one button, determine, based on the detected first headset signal, a first voltage of the microphone, set, based on the first voltage of the microphone, a threshold voltage for detecting a state of the at least one button, store the threshold voltage in the memory, determine a second voltage of the microphone, compare the second voltage of the microphone and the stored threshold voltage, and generate, based on the comparison, a signal indicative of a state of the at least one button.

Additional examples disclosed herein are directed to a tangible machine-readable medium comprising instructions for detecting a state of at least one button that, when executed, cause a machine to at least: detect a first signal of a headset of a user, the first signal being indicative of the headset being coupled to a device, and the headset having a microphone and at least one button; determine, based on the detected first headset signal, a first voltage of the microphone; set, based on the first voltage of the microphone, a threshold voltage for detecting a state of the at least one button; store the threshold voltage; determine a second voltage of the microphone; compare the second voltage of the microphone and the stored threshold voltage; and generate, based on the comparison, a signal indicative of a state of the at least one button.

As mentioned above, a headset can implement a PTT application via a PTT button which requires a user to press and hold a PTT button when speaking and release the PTT button when listening. The PTT button, when pressed, positions a resistor across a microphone connection to the device to indicate that PTT is active. A PTT button is not well suited for use with a low value resistor because it can attenuate the microphone audio signal.

A known approach includes positioning a higher value resistor (e.g., 8.66K Ω) across the PTT button to minimize attenuation on the microphone audio signal. A device can be interrupted when a resistor is connected in parallel with the microphone. This interrupt is generated by a comparison of the microphone signal to a fixed threshold. For example, when the resistor is connected or disconnected across the microphone (e.g., a PTT button is pressed or released), the threshold is crossed, thus creating an interrupt signal (e.g., via a comparator). However, this approach can make PTT button detection challenging because microphone current can vary greatly from headset to headset. Therefore, setting a fixed universal threshold for all headsets is implausible.

Accordingly, it would be highly beneficial to develop a system and method that can determine and utilize a threshold that is adaptable for different headsets where the threshold is determined when the headset is connected to a device. The systems and methods of the present disclosure address these and other needs.

FIG.1is a diagram of a wired analog headset10and components thereof. The headset10comprises a connector12(e.g., a phone connector), a PTT button14having a clip16and a cord wrap18, a rotatable earpiece20and a cord22that couples the connector12, PTT button14and rotatable earpiece20. The clip16allows a user to attach the PTT button14to clothing of the user and the cord wrap18is an annular recess along a periphery of the PTT button14that allows for wrapping the cord22when storing the headset10.

FIG.2is a circuit diagram50illustrating a PTT application of the wired analog headset10ofFIG.1. As shown inFIG.2, a connector12is coupled to several components including electrostatic discharge suppressors58a,58band58c; capacitors60a,60b, and60c; a potentiometer62; a resistor64(e.g., 8.66K Ω); a PTT switch66(e.g., a PTT button14); a microphone68; and a speaker70. The connector12is coupled to these components via a microphone signal52, ground signals54and a left audio signal56. The headset10can include a PTT feature that allows a user to communicate. Built into the headset is a switch66(e.g., a PTT button14) that the user can press when he/she wishes to speak. As shown inFIG.2, the switch66positions a resistor64(e.g., 8.66K Ω) across the microphone connection52to a mobile device to indicate PTT has been activated.

FIG.3is a table80illustrating current consumption of a microphone. Microphone current can vary greatly from headset to headset. When a resistor is connected in parallel with the microphone, a host device is interrupted. This interrupt is generated by a comparison of the microphone signal to a fixed threshold. For example, when the resistor is connected or disconnected across the microphone (e.g., a PTT button is pressed or released), the threshold is crossed, thus creating an interrupt signal (e.g., via a comparator). Since microphone current can vary greatly from headset to headset, setting a fixed universal threshold for all headsets is implausible.

FIGS.4A and4Bare circuit diagrams of a commonly used headset mircophone respectively illustrating a PTT application when a PTT button is open and when the PTT button is closed. As shown inFIG.4A, the circuit diagram100illustrates a PTT application when a PTT button104is open (e.g., released). The circuit diagram100includes several signals and components including microphone voltage102(e.g., Vmic); PTT button104; microphone bias voltage106(e.g., Mic_Bias); resistors108a(e.g., source resistor Rs),108b(e.g., bias resistor Rb), and108c(e.g., gate resistor Rg); junction-gate field-effect transistor (JFET)110; microphone112; and ground114. The microphone112generates internal current Idcwhen the Mic_Bias voltage106is applied externally via the bias resistor Rb108b. This current induces microphone current Imicthrough the JFET110converter. Since microphone current Imicis the only current through the bias resistor Rb108b, the voltage across Vmic102can be given by Equation 1 below:

As shown inFIG.4B, the circuit diagram150illustrates a PTT application when a PTT button104is closed (e.g., pressed). Microphone current Imicand a button current Ibuttonrun through the bias resistor Rb108bwhen the PTT button104is closed. This results in a voltage change of Rb*Ibuttonacross Vmic102. As such, two distinctive voltages can be detected. These two voltages can vary from headset to headset when internal current Idcor direct current (DC) Imicis not well specified by a microphone manufacturer (e.g., Electret). Thus, there is no defined voltage range for Vmic102when a Mic_Bias voltage106is applied. Therefore, a PTT detector must account for varying biased voltages and voltage differentials. Accordingly, it would be highly beneficial to develop a system and method that can determine an adaptable voltage threshold for different headsets, upon the insertion of a headset into a device, to facilitate PTT detection. The systems and methods of the present disclosure address these and other needs.

The systems and methods of the present disclosure can determine, at the insertion of a headset into a device, a voltage threshold adaptable to the headset. Upon insertion of a headset, a host is notified by a HEADSET_DETECT signal. Once detected, the host can utilize an analog to digital converter (ADC) to measure a microphone voltage (e.g., Vmic). As mentioned above, this voltage can vary from headset to headset and has a direct relationship to the microphone current. The microphone voltage is scaled to an appropriate threshold (e.g., 0.87*Vmic). This scaling is dependent on a PTT resistor and a Mic_Bias voltage, which are fixed and have a tighter tolerance than the microphone current. When a user presses the PTT button, the PTT resistor pulls down on the Vmicnode thereby reducing its voltage. This change in voltage thus crosses the threshold. Crossing the threshold interrupts the host and, in response, the host executes actions required for PTT. The threshold is reset upon the removal of the headset.

FIG.5is a circuit diagram200illustrating an embodiment of the system of the present disclosure. The circuit diagram200includes several signals and components including a headset202, a microphone bias voltage212(e.g., Mic_Bias); resistors214,216, and232; a capacitor218; an insertion detection222; a microcontroller224, a 3.3 voltage source230; a metal oxide semiconductor field effect transistor (MOSFET)234; grounds210,220and236; and a coder-decoder (CODEC)238. The headset202is directly or indirectly coupled to these components via signal lines, the microcontroller224, and the CODEC238. The headset202includes a microphone204, a resistor206(e.g., 8.66K Ω), and a switch208(e.g., single-pole single-throw), the microcontroller224includes an ADC226and general-purpose input/output (GPIO) pins228aand228b, and the CODEC238includes a jack detection (JD) pin240, a microphone audio (e.g., MIC2-R) pin242; and a GPIO pin244.

As shown inFIG.5, on insertion of the headset202, the system measures a voltage of a headset microphone204using the ADC226of the microcontroller224. The system determines a voltage threshold and sets the threshold in the system memory. The system monitors a microphone signal to determine when the microphone signal crosses the threshold. When the microphone signal crosses the threshold (e.g., in either direction), the GPIO pin228ais triggered to indicate PTT detection (e.g., activation or deactivation) to the CODEC238. In response, the CODEC238transmits a signal240indicative of PTT detection via a universal serial bus (USB) human interface device (HID) to the host system. The system resets the threshold when the headset202is disconnected.

FIG.6is a flowchart250illustrating processing steps carried out by the system ofFIG.5. Beginning in step252, the system enters a boot up state. In step254, the system determines whether a headset202is detected. For example, the system determines whether the headset202is coupled to a device. If the system detects a headset202, then the process proceeds to step256. Alternatively, if the system does not detect a headset202, the process returns to step254. Then, in step256, the system measures a first voltage of the microphone204(e.g., Vmic1). In step258, the system sets a threshold (e.g., 0.87*Vmic1) for PTT and, in step260, the system measures a second voltage of the microphone204(e.g., Vmic2). In step262, the system determines whether a headset202is detected. For example, the system determines whether the headset202remains coupled to a device. If the system detects a headset202, then the process proceeds to step266. Alternatively, if the system does not detect a headset202, the process proceeds to step264and, in step264, the system resets the threshold for PTT before returning to step254. In step266, the system determines whether the second microphone voltage Vmic2is less than the threshold. If the system determines the second microphone voltage Vmic2is less than the threshold, then the process proceeds to step270. In step270, the system generates an enable PTT indication (e.g., a signal). The process then returns to step260. Alternatively, if the system determines the second microphone voltage Vmic2is not less than the threshold, then the process proceeds to step268. In step268, the system generates a disable PTT indication (e.g., a signal). The process then returns to step260.

FIG.7is a circuit diagram300illustrating another embodiment of the system of the present disclosure. The circuit diagram300includes several signals and components including a headset microphone302, a microphone bias voltage304(e.g., Mic_Bias_1); a bias resistor306; a microphone bias voltage312(e.g., Mic_Bias_1) and voltage at collector314(e.g., VCC_1) of a potentiometer310(e.g., a digital trimming potentiometer or Digi Trimpot); a low pass filter (LPF)320; an ADC322; a supply voltage326(e.g., VCC_2) of a voltage comparator324; and grounds308,316and326. The system can be implemented via hardware components and software. The system captures a voltage level of the headset microphone302when the headset is inserted and utilizes the voltage level of the headset microphone302as a baseline to accurately detect subsequent voltage changes based on PTT button press and release. As shown inFIG.7, the system filters a signal of the headset microphone302(e.g., MIC Signal) via an LPF320before transmitting the MIC Signal to each of a voltage comparator324and an ADC322. For example, the LPF320transmits a first microphone voltage signal (e.g., Voltage_MIC_1) to the voltage comparator324and a second microphone voltage signal (e.g., Voltage_MIC_2) to the ADC322. The ADC322senses the Voltage_MIC_2 signal when a headset is inserted. Subsequently, the system generates a PTT button voltage detection reference and stores it in a potentiometer310(e.g., a digital trimming potentiometer or Digi Trimpot) via an integrated circuit (I2C) interface. The system compares the Voltage_MIC_1 signal with the detection reference via the voltage comparator324and transmits a PTT interrupt signal when the Voltage_MIC_1 signal crosses the detection reference. Additionally, the system measures, via a central processing unit (CPU), the Voltage_MIC_2 signal to validate a PTT button status.

FIG.8is a flowchart330illustrating processing steps carried out by the system ofFIG.7for determining and setting a PTT reference voltage. Beginning in step332, the system detects an insertion of a headset. In step334, the system detects a voltage level of a PTT signal via an ADC. Then, in step336, the system determines whether the detected voltage level of the PTT signal is greater than 1.9 volts. If the system determines the detected voltage level of the PTT signal is not greater than 1.9 volts, then the process proceeds to step330. In step330, the system effects a predetermined delay (e.g., 10 ms) before returning to step334. Alternatively, if the system determines the detected voltage level of the PTT signal is greater than 1.9 volts, then the process proceeds to step340. In step340, the system determines a threshold for PTT and sets a trigger threshold. In step342, the system determines a PTT button press based on a High and Low interrupt detection range of the ADC.

FIG.9is a flowchart350illustrating processing steps carried out by the system ofFIG.7for determining a PTT activation. Beginning in step352, the system detects a PTT low trigger interrupt signal. In step354, the system effects a predetermined delay (e.g., 10 ms). In step356, the system determines whether a voltage level of the detected PTT low trigger interrupt signal is within a PTT range. If the system determines the voltage level of the detected PTT low trigger interrupt signal is within a PTT range, then the process proceeds to step358. In step358, the system determines that a PTT button is pressed (e.g., by a user) and the process ends. Alternatively, if the system determines the voltage level of the detected PTT low trigger interrupt signal is not within a PTT range, then the process proceeds to step360. In step360, the system determines whether the voltage level of the detected PTT low trigger interrupt signal is less than a minimum of the PTT range. If the system determines the voltage level of the detected PTT low trigger interrupt signal is less than a minimum of the PTT range, then the process proceeds to step362. Then, in step362, the system determines that a PTT button is not pressed (e.g., by a user) and the process ends. Alternatively, if the system determines the voltage level of the detected PTT low trigger interrupt signal is not less than a minimum of the PTT range, then the process proceeds to step364. In step364, the system determines whether the number of retry attempts is greater than a predetermined threshold (e.g., an integer value such as 3). If the system determines the number of retry attempts is greater than a predetermined threshold, then the process proceeds to step362. Then, in step362, the system determines that a PTT button is not pressed (e.g., by a user) and the process ends. Alternatively, if the system determines the number of retry attempts is not greater than a predetermined threshold, then the process returns to step354.

FIG.10is a flowchart380illustrating processing steps carried out by the system ofFIG.7for determining a PTT deactivation. Beginning in step382, the system detects a PTT high trigger interrupt signal. In step384, the system effects a predetermined delay (e.g., 10 ms). In step386, the system determines whether a voltage level of the detected PTT high trigger interrupt signal is within a PTT range. If the system determines the voltage level of the detected PTT high trigger interrupt signal is within a PTT range, then the process proceeds to step388. In step388, the system determines that a PTT button is not released (e.g., by a user) and the process ends. Alternatively, if the system determines the voltage level of the detected PTT high trigger interrupt signal is not within a PTT range, then the process proceeds to step390. In step390, the system determines that a PTT button is released (e.g., by a user) and the process ends.

Certain expressions may be employed herein to list combinations of elements. Examples of such expressions include: “at least one of A, B, and C”; “one or more of A, B, and C”; “at least one of A, B, or C”; “one or more of A, B, or C”. Unless expressly indicated otherwise, the above expressions encompass any combination of A and/or B and/or C.