Electronic – Using a high resistance pull down resistor

gpiomicrocontrollerswitches

I'm trying to make a circuit where closing a switch will change a GPIO from low to high, and I want to minimize current as much as possible to increase battery life. The chip I will be using is Nordic Semiconductors nRF51422 (https://www.nordicsemi.com/eng/Products/ANT/nRF51422).

My understanding of pull up and pull down resistors is that they limit current, protecting the chip and decreasing power usage, while still keeping the GPIO either pulled up or pulled down. Having too large of a pull up/down resistor increases the time constant of the circuit making transitions from high to low slower and 'pushes' the GPIO out of the range where it is recognized high or low.

The exact set up I was envisioning was this. I use a very large pull down resistor (on the order of mega Ohms). The voltage drop across this resistor will be so large that it will essentially behave as a pull up resistor with the added benefit of exceptionally small power usage. I then have a switch that when closed connects the GPIO to ground across the recommended size resistor (13 kOhms). The circuit diagram would then resemble a GPIO connected to ground across two parallel resistors, one very large and one much smaller, which will behave like a single smaller resistor Thus, when the switch is closed the digital value of the GPIO changes from high to low, and when open there is only a small trickle of current which saves battery life immensely.

Would that work? In particular, does my idea with the large resistor even make sense?

EDIT:

I'm gonna rephrase my question and add a schematic.

So my understanding is that GPIO's have high input impedance hence a very small leakage current when connected to ground. If I were to connect a resistor that had a impedance of, say, 10 times the input impedance of the GPIO between the pin of the GPIO and ground would the GPIO pin be at 0.9*VDD? I'm assuming the input impedance of the GPIO is independent of what is connected to it.

I've made a schematic that illustrates what I'm thinking by simplifying the GPIO as a black box resistor. Schematic

Would this work? Is my schematic just straight up wrong?

Best Answer

Thus, when the switch is closed the digital value of the GPIO changes from high to low, and when open there is only a small trickle of current which saves battery life immensely.

You have the wrong idea. A pull up should not result in much current aside from the leak current of the gpio

schematic

simulate this circuit – Schematic created using CircuitLab

In the first picture, a pull up pulls the GPIO IN high. The only current is the leakage current required to measure the voltage input level. This is a few nA, a fraction of a milliamp. This can most often be checked as Input Logic High/Low (ILH, ILL) in a datasheet but I can't find it in your product. Assume 10nA or less on average.

It's only in the second picture that a significant current can be drawn. When the button is pressed, there is a straight path from V+ to Gnd, through R2. Assuming 3.3V, that's 3.3V / 47000Ω = 0.00007A It's 70000 nA. Which looks large in comparison, but that's still only 0.07mA or 70µA.

The significant current draw is only when the button is pressed. So simply design your circuit so the default state of the button is where the button is open.