Momentary action, is this a sensible approach?

Thread Starter

sirch2

Joined Jan 21, 2013
1,037
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.
 

Attachments

THE_RB

Joined Feb 11, 2008
5,438
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.
 

Thread Starter

sirch2

Joined Jan 21, 2013
1,037
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.
 

Thread Starter

sirch2

Joined Jan 21, 2013
1,037
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.
 

THE_RB

Joined Feb 11, 2008
5,438
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.
 

Thread Starter

sirch2

Joined Jan 21, 2013
1,037
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.
 
Top