Ladies and Gentlemen
I have an issue that has been bothering me for over a few years now.
5 years a go I started working on a project of mine. All is working relatively well, and currently I am going through the 10th iteration. I switched MCUs multiple times. I started out with a ATMEGA328P, went to ATTINY85, went back to ATMEGA328P and eventually ended up with the ATMEGA32U4 (build in USB is so handy ).
Anyways, I want to leave my device on during extended periods of time, so frequent use of the sleep power down function is quite important to me. I have always been able to get down to the 5 uA or lower figures with the ATTINY85 and ATMEGA328P during sleep.
When I switched to the ATMEGA32U4 I noticed my standby time dropped, and found some board issues. (stupidly placed pull ups or pull downs, beginner mistakes etc ..). After having these fixed it was better but not quite what I was used to with the ATTINY85 and ATMEGA328P.
Note, I am running my ATMEGA32U4 at 3,3V 8 MHz external clock. The ATTINY85 and ATMEGA328P where at 8 MHz internal clock.
I did some power consumption measurements this week. I tried different things: uCurrent + scope, uCurrent + multimeter, amp measurement on multimeter. All more or less shown a 105'ish uA power consumption during sleep power down.
I tried many things getting this down at least an order of magnitude to the 10 uA range.
Over the last week I have tried multiple scripts and libraries, eventually writing my own libraries based on the avr/xxx.h files, cross checking everything with the 32U4 manual. Result, 105 uA ....
So I am willing to give some extra power consumption to my board design, I am not a grandmaster and there might be some flaws. But nothing in this range.
So I wanted to try with my Pro Micro 3,3V 8 MHz and see what I could get there without any external components. After seeing that I completely bricked it a while back I had to resort to a small ATMEGA32U4 board with 16MHz 5V running the Arduino Leonardo bootloader. This board is almost bare bones, so not much on there that can suck up current.
I used Rocketscream's LowPower.h library.
Used the following code (see below), and measured the current. Still 85 uA .....
I have no clue anymore what is happening. I should be able to go lower.
I also tried my own libraries, old ones, new ones, all with the same results ..
Sparkfun on lower power consumption. I can't get their results, while I am running almost the exact same code..
I ordered a new Pro Micro to replace the brick I now have.
Does anybody have some experience with this? I don't have any ideas where too look anymore.
Any advise or insight will be greatly appreciated!
// **** INCLUDES *****
#include "LowPower.h"
void setup()
{
digitalWrite(LED_BUILTIN, HIGH);
delay(16000);
digitalWrite(LED_BUILTIN, LOW);
}
void loop()
{
// Enter power down state for 8 s with ADC and BOD module disabled
LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
// Do something here
// Example: Read sensor, data logging, data transmission.
for (int i = 0; i <= 16; i++) {
digitalWrite(LED_BUILTIN, HIGH);
delay(250);
digitalWrite(LED_BUILTIN, LOW);
delay(250);
}
}