I took advantage of the ATmega1284p's wide operating supply voltage (e.g. 1.8v to 5.5v) and low power sleep state and developed something where the microcontroller can actually sip it's power-down supply current from an automatically rechargeable low-leakage on-board capacitor until more power is needed, effectively lowering the average power-down current *from the battery* to less than 1nA.
(Yes, that ATmega1284p is actually on and in power-down mode - video at the end of the log.)
Phew. Was that really a TL;DR?!
Those following along will remember the above photo from the end of the last project log.
And yes, that ATmega1284p on one of my Pro Mini XL (v2) boards really is "on" and in power-down mode.
Don't believe me? Let's wake it up then by grounding INT0...
See the LED light up despite drawing less than 1nA? It's alive alright!
So what's going on?!
Have you ever noticed that after you disconnect power from some devices, they remain on for a little while?
See that power LED on your phone/laptop charger slowly fading off in to the abyss of nothingness?
There can be a number of reasons for this.
But the one that interested me recently was that of the remaining charge stored in the on-board capacitances.
On-board decoupling capacitors, for example, for the ATmega1284p are typically 100nF, maybe an additional 1µF thrown in there too.
You might also have a 10µF sat on the output of your boost converter or LDO!
It occurred to me that all those capacitances are just energy stores that a powered-down microcontroller could be happily sipping.
If it's powered-down state was low enough, say, less than 1µA...
So long as the voltage this capacitance supplies doesn't fall below the microcontroller's minimum, well, why not make use of it?!
But how to stop it from eventually falling below that minimum?
Why, with some nanoamp-sipping intelligence to periodically measure the supply voltage available and recharge the capacitor(s) up again - but only when necessary!
The charge level could then be configurably and/or programmatically set (even by the microcontroller itself!) and then this new supply voltage system - a sort of "Just-in-Time" Regulator - could be forgotten about when powered-down.
And that's exactly what the video below demonstrates.
There are no huge electrolytics hiding in there, just the ordinary capacitances associated with a regulator and decoupling.
But you could, of course, add one if you wanted to extend maximum potential power-down period.
I've set the "regulated" maximum and minimum to 5v and 1.8v respectively, and am using a switchable boost converter to get 5v from those two AA batteries - that's why the in-rush current is in mA.
I'll update this log with more details about what's going on in the video, probably on Monday.
But I've been able to successfully power additional nA circuitry, for example, custom battery measurement, real-time clocks and sensors from this just-in-time regulator (JiTR?) all without too much impact on the maximum potential power-down period.
More details on all that soon!
And again, thanks to various awesome Internet folk and resources including Nick Gammon, Jean-Claude Wippler (JeeLabs), Charles Hallard (ch2i), Pascal Moreau (MySensors) and others - you all helped make this possible.