Momentary action, is this a sensible approach?

Discussion in 'The Projects Forum' started by sirch2, Jun 7, 2014.

  1. sirch2

    Thread Starter Well-Known Member

    Jan 21, 2013
    1,008
    351
    I want to use a reed switch to trigger an interrupt on an MCU. I only need a momentary action to do this and I want to keep the power consumption low but the reed switch stays closed when the magnet is close. Is the circuit below a sensible approach to getting a momentary action? I've tried it and it works but I just wanted to check that this is a reasonable approach.
     
  2. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    It looks fine provided your PIC can detect the temporary pulse from the cap charge when the reed switch closes.

    However it still consumes power through the 1M resistor when the switch is closed.

    If you are prepared to tolerate that power waste you can probably simplify it to just a 1M resistor and a reed switch.

    The PIC input impedance is high enough to work with that, but I would debounce it for safety as noise may still get into the PIC input pin when the pullup resistor is as high as 1M.
     
  3. sirch2

    Thread Starter Well-Known Member

    Jan 21, 2013
    1,008
    351
    Thanks for looking. Its and ATMega not a PIC in this case but the same applies. I had thought about just using a 1 resistor but as you say noise could be an issue. I suppose, in a way, this is like a de-bounced switch.
     
  4. gunrunnerjohn

    New Member

    Jun 8, 2014
    1
    0
    Personally, I'd just debounce it in software.
     
  5. sirch2

    Thread Starter Well-Known Member

    Jan 21, 2013
    1,008
    351
    Thanks but it's not a question about debouncing. The question is how do I convert a "toggle" action to momentary action whilst using least power possible.
     
  6. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Have you considered other options?

    You can "power" it from a digital output pin, so it can be tirned off and use no power at all. Then turn it on for a few uS every now and then to see if the reed is closed. You can then reduce the 1M to a 220k or so, and don't need any caps or other parts.

    Of you can do that from the same pin, using one R and one C, if you don't mind toggling the pin from an input to an output.
     
  7. sirch2

    Thread Starter Well-Known Member

    Jan 21, 2013
    1,008
    351
    I am using the reed to wake the processor from sleep. I had considered what you suggest but that approach would mean waking up every 250mS or so to check and most of the time nothing would have changed which seemed to be a bit of a waste.

    This is for a tipping bucket rain gauge and the original idea was to set up the reed switch so it briefly switched as the bucket tipped but due to hysteresis in the reed switch it tends to stay on once switched. I have just tried a SL353 Hall effect switch which seems pretty good, gives a nice momentary action and only 1.8uA quiescent current so I will probably go with that.
     
    THE_RB likes this.
Loading...