implementing low power mode

JSDL

Senior Member
Hi all, I've just built an electronic dice project around a Picaxe 20M2 mcu which reads a piezo transducer using readadc, then generates a random number from 1 to 6 and subsequently lights an LED(s) when the piezo generates a value above a certain threshold. Everything works great. I need some advice, however, on the best way to implement "low power" mode to conserve battery power when not in use. The circuit runs off a single CR2032 battery. I ruled out using the hibernate command, as it appears it does not work with the M2 parts, so I was thinking to use the sleep command in conjunction with the time variable somehow. Ideally I would like the circuit to come out of sleep when a knock on the piezo sensor is sensed, so would somehow have to make use of an interrupt? Any suggestions would be appreciated.
 

hippy

Technical Support
Staff member
The M2's do not have any 'wake from sleep' support so the best which can be done is to NAP or SLEEP, wake or sleep between them to check if it should continue with the main program or go back to sleep.

Power consumption can also be reduced by running at very slow speeds, 'SETFREQ K31'. Slow down when waiting then return to full operating speed, 'SETFREQ MDEFAULT', once woken up.
 

StefanST

New Member
It is interesting to control picaxe with piezo as an input device. Can you add a schematic?

20M2 in the stand by mode consumes approximately 20uA at 3V (disablebod and nap/sleep). If you want to use an interrupt, you can set the frequency to 31 kHz and disablebod.

Battery CR2032 has about 200mAh, so when we reserve 100mAh for stand by, it will be for 100mAH / 20uA = 5000 hours = 200 days = 7 months. Is that enough for you?

When I was doing a dice for an 8-year-old boy, my requirement was 5 years without changing the battery. I have reserved 50mAh for "stand by". Then the current in inactive mode should be 50mAh / 5 years / 355 days / 24 hours = 1uA! So my solution was to completely switch the battery off with two transistors controlled by picaxe instead of real standby mode. There was no separate switch. The number selection button was also used to turn on the power.
 
Top