4
\$\begingroup\$

I'm trying to build a low power door monitoring switch. I'm using an MSP430FR2311 with the below circuit. The switch is a SPST reed switch and there is an internal pull-down resistor on pin P1.0 of the MCU.

When the switch is open power consumption is 1 uA but when the switch is in the closed state consumption is 100 uA. I want to be able to run this on a small battery for years at a time. Is there a circuit that will get me low power consumption in both the open and closed states of the switch?

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
5
\$\begingroup\$

The internal pulldown has 20–50 kΩ, typically 30kΩ, which limits your choice of resistor to pull the input up.

Fortunately, you can turn the internal pulldown resistor off, which is also the configuration used to measure the minimal leakage current reported in the datasheet.

schematic

simulate this circuit – Schematic created using CircuitLab

The datasheet suggests a leakage current of 30nA at 3V, so the internal resistance is on the order of 100MΩ. Whether you put an extra resistor in-line here does not affect the leakage current by much, so it can in principle be left out entirely if the inductance of the connection from the switch to the IC is low enough that the voltage won't overshoot.

\$\endgroup\$
  • \$\begingroup\$ Thanks, that makes sense. So, do I pretty much need to use a SPDT style switch to achieve this? I only ask because the existing switches epoxied into the door in question are SPST. \$\endgroup\$ – Pete Jul 9 '17 at 2:49
  • \$\begingroup\$ A SPST needs a pull-up or pull-down resistor somewhere, which means that you are forming a voltage divider when the switch is closed. The absolute values of these resistors can be in the MOhm range, but need to be small enough so the pull-down is strong enough to give a clear 0 against the internal resistance (so ~5–10MΩ), and the resistor in line with the switch needs to be small enough to pull that to a clear 1 (so (250kΩ-1MΩ). With 11MΩ resistance from +3V through the switch and the resistors to ground, you have 272nA leakage current when the switch is closed — more than 20–50nA. \$\endgroup\$ – Simon Richter Jul 9 '17 at 14:39
6
\$\begingroup\$

Turning the internal pull-up (or in your case, pull-down) resistor off is indeed a way to minimize the power consumption when a switch remains asserted against that resistor.

However, by itself that is unlikely to be workable.

What you need to do is turn off the resistor, then put the MCU to sleep with a scheduled wakeup interval at which you will wake up, briefly re-enable the resistor, and check to see if the switch is still closed. If it's still closed, disable the pulling resistor and go back to sleep for a while before checking again.

You may also want to use an extremely high value external resistor to bias the pin in the unconnected case, since a floating input could otherwise end up near the logic threshold voltage, and cause a degree of shoot-through of the upper and lower input transistors, leading to excessive current draw.

\$\endgroup\$
  • \$\begingroup\$ Shoot-through shouldn't be a problem with Schmitt trigger inputs as MCUs typically have. \$\endgroup\$ – Kevin Reid Jul 9 '17 at 4:30
  • \$\begingroup\$ @KevinReid Schmitt-trigger inputs still have shoot-through currents; they are just designed to be able to endure them. \$\endgroup\$ – CL. Jul 9 '17 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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