1
\$\begingroup\$

This is a continuation of a question I asked last week. I'd like to use a button to both enable a boost converter and act as as input to an MCU once the device is powered up.

@jasen was kind enough to suggest a circuit, but I still have a few questions and I didn't want to extend the comments in that thread unnecessarily. I'm a novice, so thanks for your patience with questions that may have obvious answers.

My setup:

A single NiMH cell (0.9-1.4 V) being boosted to 3.0V. There will be times when the MCU is powered by a second source (USB regulated down to 3.0V). As mentioned in my comments to the previous question/answer, it's okay if the boost converter (U2) is enabled while the MCU (U1) is powered by the secondary source, so I don't need to be able to command the EN pin low in that case. The enable pin needs 0.85V to power the boost converter on.

The idea is that GPIO2 will drive EN high once the MCU is powered on, and GPIO1 detects a button press.

If I had to read the analog voltage of GPIO1 to detect whether the button is pressed, that would also be fine, but obviously it be nice if it was a digital input.

Here's my current modification of the circuit:

schematic

simulate this circuit – Schematic created using CircuitLab

My MCU has a requirement that the voltage on pins is not greater than 0.3V when VDD is 0V. I've added the diodes to the GPIO to protect them during the brief time when the battery drives EN high but VDD is still at 0V. I also removed a series resistor between Q1 and EN, but if it's necessary and/or will help protect the GPIO, I can add it back in (my current CicuitLab subscription only allows 10 parts :)).

First question: Will diodes D1 and D4 adequately protect the GPIO? Could they be Schottky diodes and still adequately protect? I didn't add clamping diodes to VDD because I believe they would cause some leakage when the device is powered down. It looks to me like silicon diodes would be okay because even with a high Vf of 1.7V I should still be able to drive EN higher than 0.85V.

Second question: I've added the pulldown R6 because it seems necessary to prevent EN from floating when the system is shut down, correct? Will the value shown suffice for that resistor? Obviously I'd like to keep the power consumption to a minimum.

Third question: If the battery is at 1.0V, will the voltage drop of the Schottky be too great to drive EN high? My understanding is that because there will be minimal current, Vf will be quite low--is that correct? Is that diode necessary to prevent Q1 from conducting in reverse?

UPDATE: I had some input on another forum (I asked a different but related question and we looped back to this circuit), and I've made some updates, namely adding a weak pullup from the base to emitter. Here's the updated circuit:

enter image description here

\$\endgroup\$
9
  • \$\begingroup\$ It's been pointed out to me that I probably can't sense a button press with the silicon diode on GPIO1, so that brings me back to the question of how to protect the GPIO. \$\endgroup\$ Dec 8, 2022 at 0:29
  • \$\begingroup\$ Which boost converter do you want to use? Many of them feed the input voltage to the output via one diode in disabled state, just not switching. \$\endgroup\$
    – Jens
    Dec 8, 2022 at 14:18
  • \$\begingroup\$ Thank you-- I'm currently looking at the TPS610994Y, which has true output disconnection. \$\endgroup\$ Dec 8, 2022 at 16:03
  • \$\begingroup\$ Looks good to me, I think you don't need D2, BE reverse voltage up to 6V should be OK for most BJT. Some uC start with active pull up resistors. In this case R6 is too big. \$\endgroup\$
    – Jens
    Dec 8, 2022 at 16:46
  • \$\begingroup\$ Okay, thanks! I added an updated schematic to the question that shows a current-limiting resistor in place of D2. I also received some input on another forum that I should have a pullup on the PNP base to prevent leakage, so I've shown that as well. \$\endgroup\$ Dec 8, 2022 at 18:07

1 Answer 1

1
\$\begingroup\$

Your circuit has a couple of issues and won't work.

First question: Yes, the diodes will protect the GPIOs, and they could be Schottky types, too.

Second question: It's correct that you need the pulldown. The value should be okay.

Third question: The diode will steal too much voltage to enable the boost converter due to the transistor's base-emitter voltage drop. 300mV for the diode and 600mV for the transistor is already 900mV, leaving no voltage left to generate a base current for the transistor to turn on. So this won't work; you won't be able to turn the boost converter on via the button sometimes, depending on the battery voltage. 1 Volt is just barely not enough for a bipolar transistor circuit to operate properly.

It also has more issues: Driving a voltage that exceeds the boost converter's VIN voltage into its EN pin might damage it. Additionally, neither of your circuits will actually be able to sense the button state from the microcontroller. The voltage swing is too low (about 300mV at best, likely even less), and depending on the protection diode's forward voltage, it will just always see a low or high state on GPIO1 regardless of whether the button is pressed or not. It's just not a proper logic signal. Reading it as an analog signal also won't work since the transistor's and diode's forward voltages aren't well defined and the battery voltage changes all the time.

TL;DR: Protection diodes alone won't allow you to do this.

The 74AUP series of logic gates can provide a much simpler solution that doesn't depend on exact GPIO threshold levels and doesn't need protection diodes. This series of logic gates can operate down to 0.8V but it tolerates input voltages higher than its supply voltage (up to 3.6V).

You can use an OR gate to drive the EN pin (so that the button OR the microcontroller can activate it), and you can use an open-drain inverter to translate the button signal from 0.9V up to the 3.3V needed by the microcontroller, but only when the microcontroller is powered. Both gates (OR and inverter) must be powered from the 0.9V battery voltage for this to work.

The circuit below will enable the boost converter either when SW1 is pushed or when GPIO2 is high, and it will pull GPIO1 low when SW1 is pushed. When the MCU's supply voltage is turned off, GPIO1 will not be pulled high, so a protection diode is not necessary.

OR gate: 74AUP1G32; open-drain inverter: 74AUP1G06

schematic

simulate this circuit – Schematic created using CircuitLab

You could even eliminate R3 by using your MCU's integrated pull-up resistors, if it has any.

Alternative circuit that doesn't rely on the battery voltage always being present:

schematic

simulate this circuit

The MOSFET has to be able to operate with 2V gate voltage (a 1.8V logic level type will work fine).

\$\endgroup\$
11
  • \$\begingroup\$ Wow, thanks for this very complete answer. The additional complicating factor that we discussed in the original question that I linked to but I didn't mention here (sorry) is that I'll have a secondary power source (USB regulated to 3.0V) so there could be times when the MCU is powered and would need to detect button presses but the battery could be too low to power the logic inverter. Is there a simple way to allow for that? \$\endgroup\$ Dec 8, 2022 at 19:05
  • 1
    \$\begingroup\$ @AndrewMowry I don't think adding such circuitry is needed - the circuit I posted can operate down to 0.8V while drawing almost no current (about 1µA, which is more than a magnitude lower than the battery's self-discharge rate). If the battery drops below 0.8V, it gets damaged and the user will have to replace it anyway. If it doesn't get replaced when this happens, it will likely leak and damage your device. Operating the device with an over-discharged, damaged battery in it is a bad idea. (And if you have charging circuitry, the battery voltage will instantly jump up anyway.) \$\endgroup\$ Dec 8, 2022 at 19:26
  • \$\begingroup\$ That makes perfect sense. I see that R1 would draw a constant 0.3 mA--could the value of that be any higher? One more thing-- there's a chance that it will make more sense to use a boost converter without an enable pin because I've discovered that the efficiency of the TPS610994 is rather low under my operating conditions and I haven't found a perfect alternative with an enable pin. Without an enable pin, I assume that I can use a load switch like the SLG59M1551V and treat the ON pin exactly like the enable pin in my previous circuits. Do you see any problems with doing that using your setup? \$\endgroup\$ Dec 8, 2022 at 19:34
  • \$\begingroup\$ @AndrewMowry I don't see any problems with that. The SLG59M1551V should be able to do this just fine, but don't apply more than the battery voltage to its ON pin (it definitely can't handle that). The value of R1 can be much higher, even 1 MOhm should work. \$\endgroup\$ Dec 8, 2022 at 19:45
  • 1
    \$\begingroup\$ Yes, that FET will work. \$\endgroup\$ Dec 8, 2022 at 23:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.