This is a multi-part message in MIME format. ------=_NextPart_000_01F0_01C23C79.43E22A40 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit > > When sleeping, the PIC16F628@4MHz consumes about > > 42uA @ 5V. If I suply it with some AA Alkaline batteries, it > > would mean rougly: 2850mAh / 42uA = 67857 hours = > > 2827 days = 7.74 years without use > > What are you basing the "2850mAh" figure on ? Alkaline AAs > I've seen have been under 1000mAh, usually 800mAh, which > would give you more likie 2 years than 8 My somewhat dated tables suggest a figure of around 2300 mAH for Alkaline AA's. Some modern cells will presumably be at the higher figure Edson used. Note that actual delivered mAH depends on laod and low laods tend to give a much higher figure. > I think you could simplify the circuit by eliminating the gates too. > The attached shows two switches. As Aaron says, get the PIC > to hold a port pin high to supply its own Vcc until it's finished > transmitting or learning. After it's powered itself down there will > be NO current consumption at all until the next switch push If I understand this circuit correctly the PIC is holding itself up by its own bootsraps with no visible means of support - ie powering its own Vcc from poert pins which draw power from Vcc which .... Quite possibly I am missing something. A functionally equivalent arrangement is to use the PIC to turn on a transistor (bipolar or FET) which provides Vcc while required and turns itself off by disabling the transistor when finished. The cleanest way is a high side switch (transistor). The trouble is that this needs a low level to be on and a high level to turn off As the PIC pins will usually go to a low state when off (with a high side switch) the polarity is difficult to achieve. Adding 1 extra transistor simplifies design although it could probably be achieved with care with a single transistor. The attached diagram is party of a real world circuit that works. Power is turned on by pressing button "Sw" and is held on by PIC as long as required. Not all the components shown are needed for a simple application but it shows that there can be more to this than meets the eye. Without going back into my design I would not be sure why everything was there now. It looks too complex for what it does but everything there was deemed necessary at the time. (I can't imagine why the zener is there :-) ). The two PIC pins used probably relate to the need for the switch to be functional as a push-button when turned on (input to PIC bo) while the power is held on using PIC b7. Little touches like the BAT85 to prevent input pin being pulled to either 5v need remembering when voltages over 5 volts are used. Russell McMahon ------=_NextPart_000_01F0_01C23C79.43E22A40 Content-Type: image/gif; name="onoffswitch.gif" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="onoffswitch.gif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LLXN6rmDu8NT3HnVFbcGDMQ37IPOkrb+2z9h TLLZi65M3C0a3JfB247J9cCCqaGxW4dvzKsa2sViPK1XzMfoQokqEsYkDMh2lMILeYFYqgy4hnwu J5yaf6y0jTwolMiIciu/7jvJptG5I8a4a/vJy6vJCqZyVlswhSzKFGeublc3p4zKhzaogdvBbozB cpzBtAzHjRs2N9Y1xavLEYzLYJh4rjzMxFzMxmy6nLw/iAy2p3vMzvzM0BzN5oPEEELNJvyi0pzN 2rzN3PxJ/3XJqjzLcQzMtjzOemzOwRrMt3zOv8zOYNjN8BzP8jzP9FzP9nzP+JzPNxEQADs= ------=_NextPart_000_01F0_01C23C79.43E22A40-- -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu