As seen before, the best trick we can use to avoid wasting energy is to use an extreme low-current microcontroller that allows us to enter sleep mode. In our case, we have used a PIC18LF14K50, which has the XLP (Extreme Low-Power) capabilities from Microchip. Furthermore, By avoiding the use of LDOs is always a piece of good advice to save some extra energy. That's why we power our microcontroller directly from the CR2032, at a rated voltage of 3.3V.
In addition, the switching frequency and How we treat the displays are pretty important, because we will burn almost all the energy there:
As you can see, we used an inverter to control the displays, as we didn't have enough pinouts in the microcontroller. This means that this IC should also work at a rated voltage of 3.3V.
As previously stated with the project Bytes Counter, the keys are:
- Being as slow as possible: Configure your microcontroller to be at low frequency will save you quite a few mA of consumption.
- Sleep well: Going to sleep at any moment you are not doing anything. This means using interrupts for every interaction or process.
- Software Optimization: Not only do you want to change any timers/delays to naps with the use of interruptions, but depending on how you structure your code can save you some battery. Optimise your code to save energy!
Now, using the Power Kit Profiler II, I was able to capture the consumption of the stopwatch with the display ON:
7.22mA of current... which gives us a total operation time of 32.54h... Ouch!, that's not too much for a StopWatch, but it gets even worse when we have the eight display on:
Which gives us a lifetime of 19.13h... So I implemented a sleep mode which turns off the display (not the timer) after one minute:
Ok... this is better: 146.875h while having enough precision to avoid delays in the time... I am satisfied. Nevertheless, when not counting:
More than 100 years, which is impossible due to the self-discharge of the battery. With that, I am pretty happy about our stand-by current :).
Thanks for reading :)
Disclaimer: The lifetime was calculated with this CR2032 battery.