On Fri, Jan 19, 2007 at 02:47:34PM +1300, Jinx wrote: > > Anyone built anything similar ? > > Peter, I'm experimenting with the attached. A work-in-progress > so values aren't finalised. Why not do what I'm doing and have > the PIC control the load and also a time-out to ignore the button ? It's funny how you can totally ignore the obvious, simple, solution... I did that and the circuit works fine with a very low storage current. Schematic is here if you are interested: http://petertodd.ca/persist/2007-01-21/moment-schematic.png For the switch the PIC initially turns on the soft pull-up for GP2/INT and waits for an interrupt on the falling edge. Once woken up it turns the leds on to half brightness, then waits for 10 seconds of continuous pressing. If the user doesn't let go, the leds kick into full brightness and the rest of the program runs. Upon wake up I have the pic set GP2 as an output again, pulled low in case the switch is touched again. I also turn the DS32khz on via GP4. I put this circuit next to the spot and arc welders at my school while they were running... No activations. Looks the delay should be enough to filter out noise. I assume in your circuit you put the resistor and capacitor in there to do the same, but in hardware? It's funny, I realised this is the first PIC device I've ever made who's code doesn't consist of a configuration phase followed by a single while (1) loop... > I had two goals for this circuit - to reduce current (previously it > used 10uA when switch was left closed) and to increase niose > immunity > > A problem I had was that one particular unit is installed outside > and would be falsely triggered all the time a neighbour was using > a very noisy 2-stroke weedeater. He weedeated again a couple of > days ago, after changes had been made to the circuit, and the unit > ignored it. It even performed its real function whilst being bombarded > at close range (< 1m) by spark plug EMF onto the switch wires Out of curiosity, what does your circuit do anyhow? Judging by the alkaline batteries, I assume you aren't aiming for a 10 year battery life. :) -- http://www.petertodd.ca -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist