I'm having an Arduino problem that's so strange that I'm at a loss to understand it. I posted on the Arduino Forum, but didn't get much interest.
Anyway, I have a two-year-old Arduino Pro Mini clone, the 3.3V 8MHz version, from which I have removed the voltage regulator and the power-on indicator LED. And since the Pro Mini doesn't even have a UART adapter, the modified Mini is now really just the processor. I power it directly from an 18650, and that works fine. But the key to success is that when
which is in the neighborhood of what the datasheet predicts. So the battery lasts a long time.
Last week I received two new Pro Minis from a different source, but they look identical to the old one - same PCB, same silkscreen even. I removed the LED and regulator from one of them, flashed my sleep current test sketch to it, then measured the sleep current with Vcc at 3.3V.
Well I though it might be a leaky cap or something, but first I used AvrDude to confirm that the bootloader and fuse settings were standard stock, just like the old Mini. Then I did the same modification to the second new Mini, and measured the sleep current. It also came in at
behaving like a 22K resistor from Vcc to ground, but there is no such resistor on any of the Minis.
The processor on all of them is the AtMega328P, At least that's what the markings say. But it seems to me that the problem almost has to be in the processor, yet that doesn't seem logical.
I'll reproduce my very short sketch below for the 328P in case anybody else wants to measure their processor-only deep sleep current.
I don't understand how the exact same sketch, circuit, processor, fuses and bootloader can produce such different results. At the same time, I don't think it's likely to be a bad part on the board else the current wouldn't be the same on the two new Minis. So I don't know what I'm dealing with. Do the two new Minis have couterfeit processors? I haven't heard of that being a problem with the AVR parts.
So I'm stumped. I don't really have the rework capabilty to switch the processors, and I don't know whether I should order yet another batch of Minis.
Well, if anyone comes up with an explanation, please post. Thanks very much for any ideas.
#include #include int i;
void setup(){
for (i = 2; i < 20; i++) { // all GPIO pins to a rail pinMode(i,OUTPUT); digitalWrite(i,LOW); } 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 sleep_cpu(); // now go to sleep
}void loop(){ }