Ultralow power reed switch signal reading with mcu

microcontrollerreedswitches

I'm a newbie in electronics.
I need to build an ultra low power (nA) reed switch signal reading for an mcu.
I'm using the following schematic diagram.
reed schematic diagram

The Vo output goes on a mcu input pin that is a Schmitt Trigger.
Is there any chance this to work ?

Best Answer

What sort of response time do you need when the switch changes state? If the switch will often sit closed for extended periods of time and instant response when it opens isn't required, having a pull-up which is enabled when the CPU is interested in the pin state but disabled otherwise may be more efficient than having a weak pullup which is enabled all the time. If there is a source of periodic pulses, it may be helpful to use something like the following:

schematic

simulate this circuit – Schematic created using CircuitLab

Assume the "clock" outputs a 10us pulse, ten times per second. When the switch is closed, the circuit will consume 1mA, 1/10,000 of the time, which is to say that the switch will consume 1uA on average. Once the switch is open, PinState will go high the next time the clock outputs a pulse, or whenever the CPU outputs PullupReq; it will then remain high until the switch is closed. Note that if the CPU uses "wakeup on pin change" it will remain undisturbed while the switch sits closed, or while it sits open.

The only disadvantages of this approach are that unless CPU explicitly turns on PullupReq, it may take up to 100ms to find out when the switch is open, and it requires a source of pulses for the OR gate. Otherwise, it offers a pretty good trade-off of responsiveness vs power consumption, and--unlike high value resistors, will work even if the switch has some leakage resistance.

Related Topic