1

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 ?

AKR
  • 2,273
  • 4
  • 22
  • 34
ultrabit
  • 13
  • 3
  • 1
    Is this supposed to be switching the micro on and off, or providing an input to the micro? I don't understand 'reed switch signal reading' –  Feb 06 '15 at 23:33
  • Is there a reason why there are more components, other than R3, R4 and S1, if you use the same 2.8V Vdd? – HKOB Feb 06 '15 at 23:37
  • 1
    @ultrabit Please work on your schematics look. Take a read here> http://electronics.stackexchange.com/questions/28251/rules-and-guidelines-for-drawing-good-schematics/ – Triak Feb 06 '15 at 23:53
  • I apologise for this. It is the first time i write on this community. Thanks for your hints. – ultrabit Feb 07 '15 at 10:20
  • @HKOB: the attempt is to have 0 state when switch is opened while 1 state when it is closed. – ultrabit Feb 07 '15 at 11:50
  • @WillDean: it means providing an input to the micro. – ultrabit Feb 07 '15 at 12:12

1 Answers1

0

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.

supercat
  • 45,939
  • 2
  • 84
  • 143
  • Yes! But generate the pull-up voltage from the MCU - if it's a nA circuit then the micro must he sleeping most of the time. When it wakes up it can check the switch. – tomnexus Feb 07 '15 at 03:40
  • @tomnexus: If one needs to have the processor wake up in response to switch events, one can simply have it sleep whenever it's not interested in the switch. Having external hardware poll the switch at e.g. 10Hz may consume less energy than having the CPU wake up every 100ms. – supercat Feb 07 '15 at 05:08
  • True,especially if the application requires a reasonable response time. I suppose he's trying to detect the opening of the switch, if it's normally open, there's no quiescent current. – tomnexus Feb 07 '15 at 05:12
  • Thanks for your reply. Yes, after the switch changes its state it retains this state for a long period of time. While the mcu is always in sleeping mode and goes up with a frequency of 64Hz and the running time is less than .5ms. So, this is not a "wake on pin change" circuit. – ultrabit Feb 07 '15 at 10:29
  • @ultrabit: Fair enough. If your CPU is waking up that often, I'd suggest that using a fairly strong active pull-up is probably the way to go. I'd suggest that you try writing a piece of code which, disables interrupts (if needed), turns on the pullup, waits a few cycles (e.g. via NOP instructions), reads the pin, turns off the pull-up, and re-enables any interrupts that were enabled before. The smaller the pull-up, the less time you'll have to leave it enabled. – supercat Feb 07 '15 at 18:51
  • @supercat: I think so. The only thing, because of the switch is opened almost all the time, i'm thinking to invert the logic to have a state of 0 when opened and a state of 1 when closed. Do you think in this way can i save more power ? – ultrabit Feb 08 '15 at 09:43
  • @ultrabit: The only time the pull-up will draw power is when it's enabled *and* the switch is closed. If the switch will be open almost all the time, then from a power-consumption standpoint it doesn't matter a whole lot what you do. For the discussion above, I was assuming the switch might be closed often enough, or for long enough, that pull-up resistor current would be significant if no effort were made to minimize it. – supercat Feb 08 '15 at 19:02