Method for sourcing current using an audio jack

A peripheral device configured to be plugged into an audio jack of an electronic device includes an audio plug having an input terminal; a load electrically connected to the input terminal of the audio plug and configured to draw a first amount of current; a variable resistor electrically connected to the input terminal; a sensor configured to measure a voltage at the input terminal or an amount of current flowing into the load; and a controller that receives a signal from the sensor and is configured to control a resistance of the variable resistor such that a sum of the first amount of current and a second amount of current flowing through the variable resistor is substantially equal to a predetermined current value.

TECHNICAL FIELD

This disclosure relates to circuitry for sourcing current from a power source.

BACKGROUND

Electronic devices, such as mobile phones, can include external connectors for interfacing with peripherals. For example, one external connector can be an audio jack, e.g., an audio socket. The audio jack can be coupled to an audio plug of a pair of headphones, a microphone headset, or other peripheral device. The peripheral device can be coupled with the electronic device using an audio jack plug.

An electronic device can determine whether the peripheral device is plugged in based on comparing the voltage at a terminal of the external connector to a predetermined voltage. The predetermined voltage can be specified by the electronic device. Generally, a compatible peripheral device has a load, e.g., a resistor, that causes the voltage at the terminal to drop below the predetermined voltage when the peripheral device is connected to the terminal. That is, compatible peripherals can be manufactured according to voltage drop requirements of the electronic device. When the electronic device detects that the voltage has fallen below the predetermined voltage, e.g., using voltage detection circuitry, the electronic device determines that the peripheral is plugged in. On the other hand, when the electronic device does not detect that the voltage has fallen below the predetermined voltage, the electronic device determines that nothing is plugged in.

SUMMARY

An electronic device can detect whether a peripheral device is plugged into an external connector of the electronic device. Generally, the electronic device includes a voltage source that is connected to the external connector. The peripheral device can trigger the detection by including a pull down resistor. Coupling the pull down resistor to the external connector causes the voltage at the external connector to drop to a voltage consistent with a specification of the electronic device. After being detected by the electronic device, the peripheral device can communicate with the electronic device.

Some peripheral devices utilize current from a separate battery instead of current from the voltage supply. However, a battery can run out, and uses volume.

The peripheral device can be configured to draw a predetermined current amount from the voltage source. The peripheral device can include, at least, a load and a variable resistor. The load can draw a first current amount to perform operations. For example, the load can process card swipes from a card reader. The first current amount can vary over time based on the performed operations. The variable resistor can be configured to draw a second current amount such that a sum of the first current amount and the second current amount is equivalent to the predetermined current amount.

In one aspect, a peripheral device configured to be plugged into an audio jack of a electronic device includes an audio plug having an input terminal; a load electrically connected to the input terminal of the audio plug and configured to draw a first amount of current; a variable resistor electrically connected to the input terminal; a sensor configured to measure a voltage at the input terminal or an amount of current flowing into the load; and a controller that receives a signal from the sensor and is configured to control a resistance of the variable resistor such that a sum of the first amount of current and a second amount of current flowing through the variable resistor is substantially equal to a predetermined current value.

Implementations can include one or more of the following features. The load is a microprocessor. The sensor measures voltage and the controller uses a feedback loop to control the resistance. The variable resistor comprises a plurality of resistors in series. The variable resistor comprises a plurality of resistors in parallel.

In another aspect, a method of sourcing current from an audio jack of an electronic device includes determining a voltage drop across a load or a first current amount that is passed to the load, wherein the load is powered at least in part by a voltage source; determining, based on the voltage drop or the first current amount, a second current amount to draw from the voltage source using first circuitry; and drawing a second current amount through second circuitry, wherein the second circuitry draws current from the voltage source based on output of the first circuitry, where a sum of the first current amount and the second current amount is substantially equivalent to a predetermined current value, where the predetermined current value is defined by the electronic device.

Implementations can include one or more of the following features. The first circuitry includes an analog to digital convertor, and where the first circuitry outputs a plurality of digital signals to the second circuitry; and where the second circuitry includes a plurality of resistors, where each resistor is coupled to a corresponding switch, and where each switch is controlled by a corresponding digital signal of the plurality of digital signals. Each of the plurality of resistors are in parallel with each other. Each of the plurality of resistors are in series with each other. The second circuitry includes a variable resistor, and where the variable resistor is modified by the first circuitry. The load is a card reader. The second circuitry is in parallel to the load. The load is grounded.

In another aspect, a system for sourcing current from an audio jack of an electronic device includes first circuitry that includes a load and detection circuitry configured to detect a voltage drop across the first circuitry or a first current amount that flows to the first circuitry, where the first circuitry is coupled to a voltage source; second circuitry configured to determine whether to draw a second current amount from the voltage source based on the first current amount or the voltage drop, where the second circuitry is coupled to the detection circuitry; and third circuitry configured to draw current from the voltage source, where portions of the third circuitry is coupled or decoupled to the voltage source based on output of the second circuitry, where the third circuitry is coupled to the voltage source, and where a sum of the first current amount and the second current amount is substantially equivalent to a predetermined current value, where the predetermined current value is defined by the electronic device.

Implementations can include one or more of the following features. The load and the detection circuitry are in series. The second circuitry includes an analog to digital convertor, and where the second circuitry outputs a plurality of digital signals to the third circuitry; and where the third circuitry includes a plurality of resistors, where each resistor is coupled to a corresponding switch, and where each switch is controlled by a corresponding digital signal of the plurality of digital signals. Each of the plurality of resistors are in parallel with each other. Each of the plurality of resistors are in series with each other. The third circuitry includes a variable resistor, and where the variable resistor is adjusted by the output of the second circuitry.

Advantages may include one or more of the following. A peripheral device that connects with an electronic device can have a load that draws different amounts of current while being recognized as plugged in by the electronic device. The peripheral device can include a variable resistor that dynamically changes resistance values based on current draw from the load. The dynamic resistances can draw additional current from the voltage source. The additional current can be used for additional operations, e.g., powering circuitry of the peripheral device or recharging a battery of the peripheral device. In this way, the peripheral device can mimic a standard electret microphone and pull down a supply voltage of the peripheral device to an appropriate voltage.

DETAILED DESCRIPTION

FIG. 1is a schematic illustration of example architecture for sourcing current using an audio jack of an electronic device100, e.g., a mobile device, e.g., a smartphone or tablet computer. The electronic device100can include a voltage source V_supply112. The audio jack includes a terminal103connected to the voltage source112by a resistor R_supply102.

When nothing is plugged into the audio jack of the electronic device100, the terminal103is open and there is no current flowing from the voltage source112. In this case, the terminal103remains at the voltage V_supply. The electronic device100can detect that the terminal103is above a threshold voltage, V_threshold, and thus determine that no device is plugged into the audio jack.

A peripheral device118, e.g., a microphone or a mobile card reader, can be plugged into the audio jack. The electronic device100can detect that the terminal103is below a threshold voltage, V_threshold, and thus determine that a device is plugged into the audio jack.

In some implementations, in order to determine whether the terminal103is above or below the threshold voltage, the electronic device detects a voltage drop across resistor R_supply102, e.g., using voltage detection circuitry. Alternatively the electronic device can detect a voltage drop between the terminal103and ground.

Specifications for the electronic device can require that the peripheral device be configured such that the voltage at the terminal103falls to a specified voltage V_peripheral114when the peripheral device is plugged into the audio jack. In a conventional headset or the like, the peripheral device includes a resistor that connects the terminal to ground. The resistance of the resistor is such that that the voltage at the terminal falls to the specified voltage V_peripheral. However, this effectively wastes energy; the current flowing through the resistor could be used for other purposes.

The peripheral device118can be configured to draw a predetermined current amount from the terminal103when it is plugged into the audio jack. The predetermined amount of current is sufficient to cause the voltage at the terminal103to fall below the threshold voltage, e.g., to fall to the specified voltage V_peripheral. In some implementations, Ipredeterminedis calculated by the following formula:

The peripheral device118can include detection circuitry104, a load108, a variable resistor110, and logic circuitry106. The detection circuitry104and the load108can be connected in series with each other. The variable resistor110can be connected in parallel with the detection circuitry104and the load108. The logic circuitry106can be coupled to the detection circuitry104. In some implementations, the detection circuitry104is in parallel with the load108. In some other implementations, the logic circuitry106includes the detection circuitry104.

The load108includes circuitry that performs operations, e.g., process a swiped card. In some implementations, the load108is a mobile card reader. The load108can be grounded, e.g., through the connection to the ground in the audio jack. In some implementations, the amount of current drawn by the load108varies over time. For example, if the load108includes a processor, the processor can use different amounts of power at different times, e.g., depending on the computational load, thereby drawing varying amounts of current. The load108can be powered at least in part by current from the terminal103. In some implementations, the load108is also powered by a separate battery.

The detection circuitry104is configured to detect a voltage at the input terminal114, an amount of current that is flowing into the peripheral device118, or an amount of current that is flowing to the load108. In some implementations, the detection circuitry104includes a current sense resistor. The detection circuitry104can measure the voltage drop across the current sense resistor to generate a measurement of current flowing to the load108. The detection circuitry104can include other components, such as a current mirror. The measurement of the voltage drop or the current amount can be received by the logic circuitry106.

The logic circuitry106, e.g., a controller, can control the variable resistor110based on the measured voltage or amount of current. In some implementations, the logic circuitry106includes an analog to digital convertor. The logic circuitry106can output one or more digital signals to the variable resistor110. The digital signals can configure the variable resistor110to increase or decrease resistance. This will be described further below in reference toFIGS. 2 and 3.

By increasing or decreasing the resistance, the logic circuitry106can cause the variable resistor110to draw less or more current, respectively, from the voltage source112. The logic circuitry106can be configured to control the variable resistor110to have a resistance such that a sum of the current flowing through the variable resistor110and the current flowing through the load108is equivalent to the predetermined amount of current. As noted above, the predetermined amount of current can be defined by a specification of the electronic device.

In some implementations, a general formula for determining the amount of current to be drawn by the variable resistor110is:
IVariable Resistor Circuitry=IPredetermined−IVariable Load−Isupplemental

Isupplementalcan be an amount of current that flows through the logic circuitry106. In some cases, Isupplementalis negligible and does not have to be considered by the logic circuitry106.

By drawing a total current amount equivalent to the predetermined amount of current, not only does the peripheral device draw a maximum current allowed from the voltage source, but the electronic device also recognizes the peripheral device is plugged in, thereby allowing communication between the peripheral device and the electronic device.

The variable resistor110can include resistors in series or in parallel. Each resistor can have a corresponding switch that controls whether current flows through the respective resistor. The variable resistor110will be described further below in reference toFIGS. 2 and 3.

FIG. 2is a schematic illustration including an example variable resistor, e.g., the variable resistor110in reference toFIG. 1, for sourcing current using an audio jack. In some implementations, the variable resistor includes resistors208,210, and212in series with a bypass switch that runs parallel to each resistor. The resistors208,210, and212can each have different, e.g., increasing, resistance values, and can correspond to switches202,204, and206, respectively. The logic circuitry106can control the switches202,204, and206with digital signals. For example, the detection circuitry104can detect a first current amount being drawn by the load108. The first current amount can be provided to the logic circuitry106by the detection circuitry104. The logic circuitry106can determine a second current amount to be drawn from the variable resistor. The second current amount can be the difference between a predetermined current value for the electronic device and the first current amount. At least a portion of either the first current amount or the second current amount can be used for additional operations, e.g., powering circuitry of the peripheral device or recharging a battery of the peripheral device.

The logic circuitry106configures switches202,204, and206to draw the second current amount from a voltage source. For example, if the variable resistor can draw the second current amount by having current flow through resistors210and212in series, the logic circuitry106can output a one signal to switch202and zero signals to switches204and206. This allows the second current amount to bypass resistor208through the closed switch202and to flow through resistors210and212.

FIG. 3is another schematic illustration including an example variable resistor, e.g., the variable resistor110in reference toFIG. 1, for sourcing current using an audio jack. Instead of resistors being in series as shown inFIG. 2, resistors302and304can be in parallel. Each resistor302and304can be coupled with a corresponding switch306and308, respectively, in series. The logic circuitry106can determine a second current amount similar to that described in reference toFIG. 2. The logic circuitry106can draw the second current amount by controlling switches306and308. For example, if the variable resistor can draw the second current amount by having current flow through resistor304, the logic circuitry106can output a one signal to switch308and a zero signal to switch306. This allows the second current amount to flow through the resistor304and not the resistor302.