I'm investigating low-power mode on a Arduino Pro Mini 3.3V / 8MHz module. I'm using the LowPower library on a basic sketch to power down the Arduino for 8 sec and then have it running idle for 1 sec like so:
I removed the power LED from the board and feeding 3.3V into Acc pin. I did not remove the (unused) onboard linear regulator. Basically I was following How to modify an Arduino Pro Mini (clone) for low power consumption and expected similar measurements. No serial attached or used. Bare bones module.
What I'm getting is
The expected current consumption of ca. 9uA
about every 25ms, a sharp current spike of ca. 6mA!
Any explanation?
This shows the transition from idle to powerDown and the mysterious spikes:
The watchdog is the only mechanism keeping track of time and triggering wake-ups. My understanding is that disabling the WDT would prevent the microcontroller from waking up automatically after 8 seconds (and actually may be the library activates it anyway when you call LowPower.powerDown)
I checked that. Using SLEEP_FOREVER does no change anything. I also checked if these are fake 328p clones (they are not, or at least none of the known fakes).
As one potential optimization, set all unconnected GPIO pins to INPUT_PULLUP. High impedance inputs can easily pick up noise and switch states, causing some current to be drawn by the digital input buffers.
It seems likely that you have a counterfeit MCU. ATmega328 counterfeits were first detected because they did not behave properly in low power or deep sleep modes. If so, you are wasting your time with this.
The ATmega design was created by college students over 30 years ago. Today, a competent engineer, using modern tools, can create a completely new design performing all the same operations in a day or two, and make and sell the chips for pennies.
It sounds like you're on the right track for low-power optimization, but those periodic current spikes are interesting. A few things to check:
Watchdog Timer (WDT) Even in power-down mode, the WDT runs and could be causing periodic wake-ups or brief activity. Try disabling it completely and see if the spikes disappear.
Onboard Regulator: Since you didn’t remove the linear regulator, it might still be drawing some current periodically. Some clones have regulators that don't fully shut down. You could try removing it or testing with a different module.
Floating Pins: If any unused pins are left floating, they could be picking up noise and causing unexpected activity. Pulling them low with resistors might help.
Capacitors & Noise: Check if there’s any external noise or insufficient decoupling capacitors causing transient spikes. A small capacitor across the power rails (like 100nF) might help stabilize things.
Let us know if any of these help track down the issue.
25ms is 40Hz. Does that fit into the way the WDT works?
Anyway, load this code into your Pro Mini, and see if you still get the spikes.
// Sleep current should be 1uA or less.
// Some counterfeit chips have sleep current over 100uA.
// This is for a Pro Mini with power LED and voltage regulator removed,
// so the processor is the only thing drawing current.
#include <avr/sleep.h>
#include <avr/wdt.h>
void setup(){
ADCSRA = 0; // disable ADC for power saving
wdt_disable(); // disable WDT for power saving
set_sleep_mode (SLEEP_MODE_PWR_DOWN); // Deep sleep
sleep_enable();
sleep_bod_disable(); // disable brownout detector during sleep
sleep_cpu(); // now go to sleep
}
void loop(){
}
There will still be a little current because the regulator is still there, but there shouldn't be any spikes.
Thank you everyone for their suggestions! I figured it out - it was the onboard voltage regulator. After desoldering, the sleep power is down to a stable 5uA.
I couldn't believe at first that a seemingly simple component as a linear regulator could cause such stable periodic power spikes, but it seems true.
This also proofs that the simple use of the LowPower library (see my original post) is sufficient, no additional code needed.
Regarding fake 328p - I own a few of these as well. They show a constant 100uA draw when sleeping. Caveat - I haven't removed the regulators yet. This might improve it. With the fakes, I never saw any periodic power spikes during sleep, though.
Note that I fed 3.3V into Vcc pin, leaving RAW unconnected. I guess the chip doesn't tolerate voltage on output but not on the input.
I was surprised myself, not expecting such precise spikes (they looked very digital) but removing the regulators fixed the problem, proven in 4 cases at least by now.
Maybe it charged (regulators often have a reverse biased diode) the Vin capacitor and when it was charged, the regulator made an attempt to spew that voltage out.
I like the price point of the Aliexpress Pro Minis. Now that I figured out (3 attempts) where to get genuine 328p, we could suggest that they produce versions without the LED and the regulator. But otoh, low-power still a niche and actually takes only a few mins to desolder.
When using this, one of the above boards comes out fine, the other one has the many suspicious FF bytes mentioned in the video. But both are good on sleep current - unlike counterfeit that I bought years ago.
I recently bought an 8MHz Pro Mini from the second source, the TZT Five-Star store, and the data dump looked good - a variety of values, not just all FFs. But I didn't do a sleep current test because in my application it never sleeps. Probably should have done that. Edit: No, it was a 5V 16Mhz Pro Mini.
Well I guess it's good news that even the fake chips now sleep properly, or at least some of them do.
Maybe we could get the module makers of the Far East to offer a Pro Mini module with the LED, the regulator, and the processor all unpopulated. Then you could stock up on 328Ps at Digikey, and just solder them on the board as needed.