Ultra low energy switch detection?

Mar 07, 2011 21 Replies

There is a solution, you just don't want to seem to hear it... Why not answer questions you have been asked like what CPU... What's wrong with a capacitor to debounce the switch ?

OK, I'll play. Currently, the system is a PIC16F877A at 3.58MHz. Why? 'cuz that's what's on my prototyping board, I need to do 4800 baud serial and I'm set up to write code for it. Could I use another processor??? SURE! Can I use a different switch??? Not in this application.

I'm measuring the duration and period of the SPST switch closure. Since I can't do timing if the uC is sleeping, I just report the transitions and let the PDA worry about the timing and logging and user interface. Typical duration is 5 minutes. Typical period is 85 minutes, but can be anything.

But, this is to be a general purpose interface that could be used for anything connecting hardware to a computer. I've described the FIRST application.

I decided, in a fit of boredom, to lose the wall-wart and run it from the RS232 port. But the RS232 port hooks to a battery-powered PDA. Might as well cut the current to as near zero as possible. Maybe I'll want to run it off a vibration power scavenger...I don't know...just try to learn something about low power design... I converted it from polled to interrupt driven, switched from hardware to software uart and put it to sleep between interrupts. It's 333 bytes. Should run on a much lesser PIC. At that point, I realized that the internal pullup resistors were a SIGNIFICANT use of current compared to the sleep mode that it's in almost 100% of the time. A 1M external resistor still consumes 5uA while the switch is closed.

I couldn't come up with a more efficient way of sensing the switch, so I came here to see if anyone else had an idea.

I've been looking at MSP430 and polling with multiple clock speeds. But the gain doesn't seem to justify the effort to build whole new development tools and learning "C". I started working on it, but I think the effort exceeds my attention span.

If the processor is asleep, they all seem to use about the same power...WAY less than the pullup resistor for the switch. Since the duty factor is small, the active power is almost irrelevant too as long as I don't keep waking it up to poll the switch. If I use a big enough battery, NOTHING matters.

My biggest concern is the pullup current for the switch. I attempted to narrow the scope of the thread to address that issue.

If you'd bothered to read the original post, you'd have seen that I already stated that a cap mitigates the bounce problem.

And let me add that I can dispense with the whole uC and hook the switch directly to the PDA serial port and it works fine. The uC was added during another fit of boredom to allow communication of the switch state thru a RS-232 to bluetooth adapter and to add as yet unspecified functionality. It's not possible to communicate all the reasons I might want to sense a switch.

Now that you know what I'm doing, my question is still the same: "is there a clever way to sense the state of a SPST switch at VERY LOW energy consumption? I want to be able to apply the solution to this and alternate and future projects, independent of the processor and whatever other changes YOU THINK I should make to my plan. I'm perfectly capable of making tradeoffs. I'm asking for ADDITIONAL options to consider in this tradeoff process. I put a lot of effort in my original post to narrow the scope of the thread. Capacitors and polling were tradeoffs I stated in the original posting. I'm looking for NEW info that I didn't disclose in my original posting.

I'll say it for the third time...I don't think there is a solution. But, since you claim to have one, Tell me the solution that I don't want to hear...pleaseandthankyou

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required