Knock detector with sleep

I am trying to build a project that will have very low power utilization and be turned on with a knock detector. I was planning on using an attiny85 and a piezo disk sensor and have the attiny wake up once a second and check to see if there is a knock. Because the power output from the piezo is so momentary, however, it is likely to miss a single knock. I was thinking of hooking up the piezo to a capacitor which would then hold the voltage for long enough for the attiny to awaken and check the voltage. Any suggestions for whether this is feasable and suggestions for specific wiring and capacitor size?

thanks

Consider using a “shake switch” instead of a piezo disk. Those switches consume no power unless activated, and can wake an MCU via an external interrupt. http://www.electroons.com/blog/2013/08/ … h-testing/

It might also be possible for the piezo to wake a processor via an interrupt, but you would need to experiment with RC filters.

Thanks.

I am not familiar with a shake switch so I am imagining therefore that a shake switch would connect from the power supply to the interrupt pin and when it is shaken the switch closes taking the interrupt pin high. Am I envisioning a shake switch correctly?

That would work. A shake switch could also ground a pin that is pulled high by a resistor.

Thanks,

Since the main focus of the project is power saving I would probably not want to use it to pull a pin to ground since that would require keeping the pin energized during sleep state. Since I have to order a shake switch I will try it this weekend with a piezo on the interrupt and see if that works as well.

alangstein:
I would probably not want to use it to pull a pin to ground since that would require keeping the pin energized during sleep state.

Not sure what you mean by this. Pins are energized in the sleep or power down state.

Either way works fine to wake the part up from sleep, using either INT0 or a pin change interrupt, and in principle there is no difference in power consumption during sleep. The input pin leakage is specified to be typically less than 50 nA when externally held high or low.