Author Topic: Arduino Pro Mini - two copies have different sleep currents  (Read 29519 times)

0 Members and 1 Guest are viewing this topic.

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2008
  • Country: us
I have two 3.3V 8Mhz Pro Minis, one a year old, and one new from a different source.  I have modified both the same way - remove the resistor to the power-on LED, and remove the voltage regulator.

I have a test sketch that turns everything off and goes into PWR_DOWN sleep, at which point I measure the current.  Nothing is connected to the Mini during the test except power and ground.  The old Mini draws about 0.4µA.  That's what it's supposed to draw.

The new Mini draws 150µA.  It works fine while it's awake and running other sketches, but I bought this specifically because it can draw very low current in deep sleep, so this isn't going to work for me unless I can fix it.

Assuming the processor isn't a fake, the only explanation I can come up with is that there must be something different in the bootloader and/or fuse settings between the two Minis, and that the fix would be to burn the stock bootloader and fuses to the new Mini.  But I've never done that before, so before risking that, I wanted to just make sure there isn't something else that I haven't thought of that could account for this problem.  Does anything come to mind?

And if anyone wants to try my test sketch on their Pro Mini, here it is:

Code: [Select]
#include <avr/sleep.h>
#include <avr/wdt.h>
int i;

void setup() {

  for (i = 2; i < 20; i++) {          // all pins to one rail or the other - power saving
    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 during sleep
  sleep_cpu();                        // now go to sleep
}

void loop(){
}
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12865
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #1 on: July 08, 2020, 02:21:59 pm »
Another possibility is ESD damage, insufficient to stop any pins working, but enough to increase one or more pins' I/O driver leakage currents.   Try setting all pins high in your sketch and see if the sleep current changes significantly.
 

Offline DrG

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #2 on: July 08, 2020, 02:41:33 pm »
/--/
Assuming the processor isn't a fake, the only explanation I can come up with is that there must be something different in the bootloader and/or fuse settings between the two Minis, and that the fix would be to burn the stock bootloader and fuses to the new Mini.  But I've never done that before, so before risking that, I wanted to just make sure there isn't something else that I haven't thought of that could account for this problem.  Does anything come to mind?


I don't know, but I like thinking about things and looking around and thinking about things some more. So, for what it is worth....would it be willing useful to try one of the low-power libraries and see if that yields anything different?

I was looking at this one https://github.com/rocketscream/Low-Power/blob/master/LowPower.cpp and noticing how much was there. Again, FWIW.
« Last Edit: July 08, 2020, 03:09:07 pm by DrG »
- Invest in science - it pays big dividends. -
 

Offline Syntax Error

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: gb
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #3 on: July 08, 2020, 02:50:17 pm »
Assuming that both pro minis are identical, even to the clocks and fusing, I would ask, what else is eating current on those boards? What are the 3V3 regulators drawing, for example?
 

Offline DrG

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #4 on: July 08, 2020, 02:51:47 pm »
Assuming that both pro minis are identical, even to the clocks and fusing, I would ask, what else is eating current on those boards? What are the 3V3 regulators drawing, for example?

Since they are removed, I would guess very little  :)
- Invest in science - it pays big dividends. -
 

Offline Syntax Error

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: gb
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #5 on: July 08, 2020, 03:00:11 pm »
No idea then... a deep delve into the Atmel spec.
« Last Edit: July 08, 2020, 03:01:52 pm by Syntax Error »
 

Offline oPossum

  • Super Contributor
  • ***
  • Posts: 1417
  • Country: us
  • Very dangerous - may attack at any time
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #6 on: July 08, 2020, 04:54:00 pm »
I have seen leaky caps cause high sleep current. Have yet to see a defective chip cause high sleep current.
 

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2008
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #7 on: July 08, 2020, 09:38:22 pm »
I was able to learn how to use Avrdude to read out the fuse settings and the bootloader code from the old and new Minis.  They are identical, and the bootloader is the stock bootloader.  So at least that settles that issue.

Changing the IO pins to all high didn't make any difference.

So, it's a physical problem of some kind - possibly something I did when removing the LED resistor and the regulator, or maybe it arrived that way.

I'm not sure it would be time well spent, but at some point I may try to do some comparative resistance readings across caps and other things, looking for differences between the old Mini and the new one.  But whatever produces the 150µA might not even be noticeable, or might be inside the processor.  So I'll probably just save this one for some project where sleep current isn't important.

Anyway, thanks very much for the comments and suggestions.  I'll post a followup if I find the cause.

 

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2008
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #8 on: July 10, 2020, 11:39:07 pm »
Ok, I'm about to go crazy.  I had forgotten that I had ordered two of the new Minis.  So, very carefully, I unpackaged the other new one, removed the LED resistor and the regulator, soldered on the six-pin right-angle header at the end, and flashed my sleep current test sketch.

And it behaves exactly like the first one - it sleeps at 150µA.

So it's not ESD, or a leaky capacitor.  And I already confirmed that the bootloader and fuses are identical to the old Mini that sleeps at under 1µA.  So I'm at a loss to understand WTF is going on.

As far as I can tell, the PC boards are identical.  Even the silkscreen.  The markings on the new Minis are:

Atmel
Mega328P
U-TW
35473D
1947X5N

and
1936S2P

The old one is:

Atmel
MEGA328P
U-KR
35473D
1829R5G

Does anyone have an explanation for this?  My sense is that since the current is the same for both new Minis, it's something inherent in the design or perhaps the processor isn't genuine.  In theory it could be a bad batch of leaky caps, but it's improbable the leakage would be identical.   

Where would be a good place to buy Mini clones for delivery to the US?

 

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2008
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #9 on: July 13, 2020, 08:54:33 pm »
Just wanted to confirm that I checked for leaky capacitors and other stuff, and found nothing that would account for the excess sleep current.  That leaves the processor as the most likely culprit.  I hope this doesn't mean the 328P has been revised, and now uses more current.
 

Offline DrG

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #10 on: July 13, 2020, 09:58:45 pm »
Have you ever seen any changes in the datasheet to reflect that?

There is a lot about making them low power and there are certainly different pro mini clones - both 3.3 and 5. On this site https://www.iot-experiments.com/arduino-pro-mini-power-consumption/  he looked at a couple of varieties and his number correspond to you good numbers.

What does your clone look like?

In so far as a good vendor - I don't know, but I have maybe 8 of these in total and at least three 3.3v 8MHz (using resonators not crystals as I recall) that look like the one that the site shows as "The Simple". I have not done any low power mods though.
« Last Edit: July 13, 2020, 10:01:47 pm by DrG »
- Invest in science - it pays big dividends. -
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12865
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #11 on: July 13, 2020, 11:17:21 pm »
It *could* be due to surface contamination, from poor storage or production line.  Try thoroughly cleaning the board that's drawing 150uA: If you don't have a swept frequency ultrasonic cleaner, soak in IPA or solvent flux remover, scrub thoroughly with a brush that wont cause ESD, then scrub under hot water with a trace of detergent (mostly just as a wetting agent), rinse, rinse again with distilled water, shake off as much as possible then rinse with IPA, shake and let dry.  Once visibly dry, put it in a clean very warm (but not over 95 deg C) place for 24H to let any remaining moisture and/or solvents evaporate off.  If you do have a suitable ultrasonic cleaner, use it for the hot water wash stage.

The next thing to try would be, taking full ESD precautions, to desolder the good and not-so-good chips (don't get them mixed up) and fit brand new ones, purchased from MicrochipDirect or an official distributor, then thoroughly clean as above.

If the problem stays with the bad board you can investigate other components on it. If it goes away, your new supplier has bad chips, and if both are now bad, and you put back the known good chip and its still good, its looking increasingly like a specification change or batch problem so contact Microchip technical support, (but have all your ducks in a row as front-line support is usually swamped by idiots)!
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3025
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #12 on: July 13, 2020, 11:53:48 pm »
Perhaps the new ones are not ATMega328P but actually ATMega328PB in disguise.  The PB has a number of new features which maybe need to be disabled, although I would have thought that in power down mode that shouldn't matter.

Other thought is maybe the brown out detection isn't getting disabled for some reason.    But even then, 150uA seems pretty high even with BOD enabled (unless it was actually in a brown out).

If it was me, I'd reset the fuses to turn off brown out detection completely, and upload using an ISP to nuke the bootloader out of the equation just to be sure. 

There's not much on a Pro Mini that can really explain it once you've lost the regulator and LEDs.

I would pull off the ARef cap, and check the pullup on reset is sensible.  Finally I would probably pull off a good chip and a bad chip swap them over good chip on bad board, bad chip on good board, to determine if it's the chip or something else on the board.




~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2008
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #13 on: July 14, 2020, 02:44:02 pm »
Have you ever seen any changes in the datasheet to reflect that?

There is a lot about making them low power and there are certainly different pro mini clones - both 3.3 and 5. On this site https://www.iot-experiments.com/arduino-pro-mini-power-consumption/  he looked at a couple of varieties and his number correspond to you good numbers.

What does your clone look like?

In so far as a good vendor - I don't know, but I have maybe 8 of these in total and at least three 3.3v 8MHz (using resonators not crystals as I recall) that look like the one that the site shows as "The Simple". I have not done any low power mods though.

I've looked pretty hard at the datasheet and errata, and see nothing that would explain this.

The new ones I received are "The Simple".  And the old good one I have is the same.

My old Mini actually gets lower numbers on Power-Down than the guy on that site gets.  The datasheet is pretty clear - if you take all the right steps, and with no power LED or regulator, the typical Power-Down current is 0.1uA, with a maximum of 4uA.  Not 150uA.
 

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2008
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #14 on: July 14, 2020, 02:54:49 pm »
It *could* be due to surface contamination, from poor storage or production line.

-snip-

Please note that I have two of the new Mini's, and they both sleep at 150uA.  I think it's exceedingly unlikely that they are so equally dirty.

Quote
The next thing to try would be, taking full ESD precautions, to desolder the good and not-so-good chips (don't get them mixed up) and fit brand new ones, purchased from MicrochipDirect or an official distributor, then thoroughly clean as above.

I don't have any rework gear, just a soldering iron.  Replacing the processor is not something I would attempt.

Quote
If the problem stays with the bad board you can investigate other components on it. If it goes away, your new supplier has bad chips, and if both are now bad, and you put back the known good chip and its still good, its looking increasingly like a specification change or batch problem so contact Microchip technical support, (but have all your ducks in a row as front-line support is usually swamped by idiots)!

There's not much left on the board as it is.  But later today I will do some destructive testing by removing everything that's left, one item at a time, and testing again, until I get down to the processor and resonator.  Then if I can figure out how, I think I could change the fuse to make it use the internal 8MHz oscillator, then remove the resonator and try again.  My prediction is, after doing all of that, the sleep current will still be 150uA.  Film at 11.

I would have no idea of how to contact anyone at Microchip who would even talk to me.
 

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2008
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #15 on: July 14, 2020, 03:07:02 pm »
Perhaps the new ones are not ATMega328P but actually ATMega328PB in disguise.  The PB has a number of new features which maybe need to be disabled, although I would have thought that in power down mode that shouldn't matter.

Other thought is maybe the brown out detection isn't getting disabled for some reason.    But even then, 150uA seems pretty high even with BOD enabled (unless it was actually in a brown out).

If it was me, I'd reset the fuses to turn off brown out detection completely, and upload using an ISP to nuke the bootloader out of the equation just to be sure. 

There's not much on a Pro Mini that can really explain it once you've lost the regulator and LEDs.

I would pull off the ARef cap, and check the pullup on reset is sensible.  Finally I would probably pull off a good chip and a bad chip swap them over good chip on bad board, bad chip on good board, to determine if it's the chip or something else on the board.

I though maybe it was a 328 instead of a 328P.  That would account for the increased current.  But I tested the BOD disabling in software, and found that in both the old and new Minis that's a difference of 20uA.  In the 328 there would be no difference since you can't turn off BOD.  I don't know about  the PB version, or how I could tell if it was that.  Of course the markings are pretty clear that it's a 328P, assuming it's genuine in the first place.

I'll do further testing later today if I get time.  But meanwhile I've invested another $10 ordering another batch from a different Ebay source, with different markings.  Picture of those attached.  I'm a little concerned about the marking line that says 354A3P.  All the others have said 35473D.

1023282-0
« Last Edit: July 14, 2020, 03:13:09 pm by Peabody »
 

Offline Syntax Error

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: gb
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #16 on: July 14, 2020, 04:00:15 pm »
Although you have checked for leaky capacitors, do you know what the rated DC leakage is of the decoupling capacitor is meant to be? If your two boards show the same problem, is it another (cheap) part other than the 328 causing trouble?

f.y.i. https://passive-components.eu/understanding-capacitor-leakage-to-make-smart-things-run-longer/
 

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2008
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #17 on: July 14, 2020, 11:34:16 pm »
I finished the destructive testing of one of the new Minis.  I burned a new bootloader and fuses so it runs off the internal 8MHz oscillator, and reinstalled my sleep current test sketch.

Then I began removing everything on the board, testing the current after each removal.  In the end, I had removed everything from the board except the processor, and it still sleeps at 150uA.

So the problem is definitely the processor.  The markings look completely normal, so I don't know what the problem actually is.  I guess it could just be a bad batch.

Anyway, I should have the new batch of Minis here by the weekend, and will see what happens with them.

 
The following users thanked this post: thm_w

Offline DrG

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #18 on: July 14, 2020, 11:49:22 pm »
Is it irresponsible to suspect that it is not a legitimate chip?

I looked at a few that I had hanging around and they are all -AU chips. I can see the AU in the data sheet (page 635 https://ww1.microchip.com/downloads/en/DeviceDoc/ATmega48A-PA-88A-PA-168A-PA-328-P-DS-DS40002061A.pdf) I see no -KR am I missing that or is it new or ?

It is confusing because I guess Atmel changed some labeling and Microchip has their labeling.

excuse the phone pic
« Last Edit: July 14, 2020, 11:51:20 pm by DrG »
- Invest in science - it pays big dividends. -
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12865
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #19 on: July 15, 2020, 12:46:03 am »
You don't *KNOW* its the chip till you've removed it and seen the leakage drop to zero.  It could even be a leaky board, and not necessarily surface contamination.  e.g. if the assembler's PCB house got a batch of PCB on the cheap made with reject resin or incorrect mix ratio.   The leakages for the sample of two boards you have could be pretty similar because, for the same batch of resin the leakage would be mostly determined by the track length and spacing in the layout.

A decade or so back, Microchip Technology used to do special far east market versions of some of their PICs that didn't meet the US datasheet specs, for really cost-sensitive applications.   They were supposedly marked with distinct part numbers, but we all know how that one goes when there are no westerners 'in the loop' . . .  Maybe they've started doing similar with AVRs?
 

Offline Syntax Error

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: gb
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #20 on: July 15, 2020, 01:39:56 pm »
Have you removed absolutely everything else from the board including the ceramic resonator, and then fused the 328 for internal oscillator mode?

 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16626
  • Country: us
  • DavidH
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #21 on: July 15, 2020, 05:12:05 pm »
That would be an awfully lot of leakage for a board.

Could there be an open CMOS input pin?  That will cause excessive power draw.
 

Offline Syntax Error

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: gb
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #22 on: July 15, 2020, 05:18:25 pm »
That would be an awfully lot of leakage for a board.

Could there be an open CMOS input pin?  That will cause excessive power draw.
OP writes in Arduino code...
Code: [Select]
for (i = 2; i < 20; i++) {          // all pins to one rail or the other - power saving
    pinMode(i,OUTPUT);
    digitalWrite(i,LOW);
  }
which sets all pins... so what state is pin 1 left in?
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1641
  • Country: nl
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #23 on: July 15, 2020, 05:33:20 pm »
So the problem is definitely the processor.  The markings look completely normal, so I don't know what the problem actually is.  I guess it could just be a bad batch.

I doubt it's a bad batch, otherwise that's really poor QA on Atmel's part (if it is indeed, an authentic Atmel part). Usually a part/board power consumption is a good indicator of obvious defects or faults, and having a factor 375x over in 1 particular operating mode is such one.

Is it irresponsible to suspect that it is not a legitimate chip?

I looked at a few that I had hanging around and they are all -AU chips. I can see the AU in the data sheet (page 635 https://ww1.microchip.com/downloads/en/DeviceDoc/ATmega48A-PA-88A-PA-168A-PA-328-P-DS-DS40002061A.pdf) I see no -KR am I missing that or is it new or ?

It is confusing because I guess Atmel changed some labeling and Microchip has their labeling.

excuse the phone pic

Not sure how credible  LCSC is sourcing Atmel/Microchip parts, but theirs looks identical to Peabody's: https://lcsc.com/product-detail/ATMEL-AVR_ATMEL_ATMEGA328P-AU_ATMEGA328P-AU_C14877.html
I also looked at the newest product I could find on Sparkfun with an ATMEGA328(P) their labeling looks similar as well: https://www.sparkfun.com/products/16282 (looks like end of june 2020 timeframe)

Assuming Sparkfun is using reputable parts, it's plausible this is still a genuine part.

I would also be interested in what "pin 1" does. In fact, the ATMEGA328P has 23 digital I/O + 2 dedicated ADC inputs, so it's perhaps advisable to make sure all of them are well put.
Alternatively, a dirty way of testing for I/O leakage is by touching all pins with your fingers. If any pin is floating, your body "antenna" will either force the I/O pin high/low, which may initiate a change in leakage current of an input pin.
 
However, in my experience I/O leakage is fairly in-deterministic (e.g. laying the board on a different surface can change the leakage), and seeing that each measurement seems to have little to zero effect, even on 2 boards, it may well be something completely different ...
 

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2008
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #24 on: July 15, 2020, 05:38:11 pm »
Is it irresponsible to suspect that it is not a legitimate chip?

I looked at a few that I had hanging around and they are all -AU chips. I can see the AU in the data sheet (page 635 https://ww1.microchip.com/downloads/en/DeviceDoc/ATmega48A-PA-88A-PA-168A-PA-328-P-DS-DS40002061A.pdf) I see no -KR am I missing that or is it new or ?

It is confusing because I guess Atmel changed some labeling and Microchip has their labeling.

excuse the phone pic

I don't have any Arduinos with the AU marking.  All my stuff, including Nanos, have the second line as U-{something}  Either U-TH, U-TW, or U-KR.  I'm guessing TH is Thailand, TW is Taiwan, and KR is Korea.  But I agree there's nothing in the datasheet that looks like that, so maybe all mine are counterfeits.  I just don't know.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf