Hi John,
One way to approach this is to attach your tilt switch to an interrupt
line on your microcontroller to wake it up when there was movement.
What you do after that is up to you! The atmega328 datasheet quotes
current consumption of 0.1uA when in power down mode for example,
which gives you a long time on battery (assuming other things like
LEDs aren't turned on!)
Another approach that should work and gives complete control of your
power usage is the power circuit as shown in the attached image. The
idea here is that the voltage regulator that supplies power to your
circuit can be turned on and off. Here we are assuming that the enable
input is active high, so the pull down resistor R2 turns the regulator
off by default. The pull up resistor R1 keeps the PMOS FET turned off
because there is no current flow through D1 or the NMOS FET. When the
switch is pressed (or your tilt switch engages), D1 becomes forward
biased and put the gate of the PMOS FET at whatever the forward bias
voltage of D1 is, which should be sufficient to turn on the PMOS FET.
With the PMOS FET turned on, the enable line goes high and turns the
voltage regulator on. The microcontroller powers up, and the first
thing it does is to ensure that the signal that goes to the NMOS FET
is set high, in order to turn it on. At this point, the switch can be
released because the current path through the NMOS FET keeps the PMOS
FET turned on. R3 and the signal going to the microcontroller can be
used as a means of turning the device back off again, which you may
not want to be possible of course! If everything is powered up and the
switch is open, the pull up resistor R3 means the signal going to the
microcontroller is high. If the switch is now closed, D2 becomes
forward biased and sends a low signal to the microcontroller. If the
microcontroller wishes, it can use this signal to turn the NMOS off
and hence power down the whole circuit. It can of course turn itself
off at any point by controlling the NMOS.
The power consumption of this circuit when powered down is determined
by the off leakage of the NMOS and PMOS FETs as well as the off
current into the Vin pin. It's difficult to get numbers for the FETs
because most manufacturers quote at high Vds values, but for example
the
http://uk.farnell.com/infineon/bss123-l6327/mosfet-n-ch-100v-170ma-sot-23/dp/2212920
quotes Ids current of 10nA with Vds of 100V. That's the best I found
out of the few I looked at - but what would the leakage be at 5V for a
device that had Ids=0.5uA at 48V? I presume it's fairly linear. Either
way, with some careful component selection you should be able to get
sleeping current consumption down to <0.1uA for the entire circuit.
There are a few important points - your switch must be on for long
enough for the microcontroller to turn on (which shouldn't be long at
all) and you need to ensure that the minimum current for your switch
at least matches the value of R1. You want R1 to be large (10k-ish) so
that there is minimal current wasted during powered on operation, but
many switches require more than 100uA to operate for example.
Good luck with your project!
Cheers,
Roger