Why am I drawing so much current when asleep mode (Tiny85)?

Go To Last Post
20 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm a newb when it comes to sleep modes so I'd appreciate some guidance from those who aren't. I'm using an ATTiny85, running of the internal 8MHz oscillator and use the following code to put it to sleep (power-down mode):

SREG = 0x80;  // Enable interrupts.  Wait for button press.
MCUCR |= 0x30;   // Set sleep enable bit, power-down mode
asm("sleep");   // Go to sleep
while(!(push))
    ;

When awake (on a pin-change interrupt), the part draws about 4 mA. When asleep, 2.9 mA. I expected a much bigger savings (as in drawing uAs. Am I doing something wrong, or confused, or both? Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What does the hardware look like?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How are you measuring current consumption?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Schematic attached. I've got the ammeter between R3 and the regulator (U$1).

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The regulator on it's own is likey to burn a couple of mA, put the meter on the other side to read what the chip is using.

If you put the meter beween pin 1 and CAP3 add a temporary cap to pin 1 or the regulator may go nuts.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Aaah, that was it. Rookie mistake. CPU draws 1.5 mA awake, .5 uA asleep (less than I was expecting). Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If your diagram(and my understanding of it) is correct, then R3 is dropping 10V. 10V across a 1K resistor is 10mA according to my calculator. You might want to look at a switch mode regulator if you are trying to save power.

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But why the 1K? Is the regulator not 24V compliant on its input ?
@JA Brown.... Take another look. How does R3 drop 10V ???

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am just going by the fact that one end is labelled 24V, and the other end is labelled 14V.
I have no idea why, or what the regulator part number is.

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The regulator's good to 30V but I figured dropping a few volts (10V max., more like 4V continuous) through R3 first would reduce the heat generated by the regulator. Neither R3 nor the regulator get any warmer than ambient. I considered a switching regulator, but it would be much more expensive than this set-up, and I was more concerned about heat than absolute power; the circuit is mains powered, via a 24V DC adapter.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Even with 19V dropped (24V in) one of the plastic TO92 regulators heat really shouldn't be much of a problem until maybe 10 mA!

It is actually pretty easy to calculate the internal temperature of your chip (regulator) in many cases, especially the bog standard linear regulators :)

And btw a low-power switch mode supply is not really that expensive, but as long as your run from mains power I guess it doesn't really matter that much! It would be interesting when running on battery power though!

- Brian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lautman wrote:
The regulator's good to 30V but I figured dropping a few volts (10V max., more like 4V continuous) through R3 first would reduce the heat generated by the regulator. Neither R3 nor the regulator get any warmer than ambient. I considered a switching regulator, but it would be much more expensive than this set-up, and I was more concerned about heat than absolute power; the circuit is mains powered, via a 24V DC adapter.

R3 will reduce the heat generated by the regulator, but only because it's generating that extra heat itself. But you are probably aware of this.

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, watts is watts. But heat dissipated by a resistor has less impact on the life of the resistor than heat dissipated by a regulator has on the life of the regulator. All of these effects are pretty minimal, but the addition of a resistor is a small insurance premium for protecting the regulator.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Geronimo wrote:
And btw a low-power switch mode supply is not really that expensive,
The one I was considering (Recom R-78E5.0-0.5) is $3.65 (qty. 1). The linear regulator I chose (Fairchild MC78L05A) is only $.51.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Take a look at the LM2936Z-5.0 regulator, it has a much lower idling current than the 78L05......
-Jim

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, jc!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I was considering (Recom R-78E5.0-0.5)
I had a bad experience with Recom therefore I will not use them anymore.
Mornsun and others have the same regulators.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's good to know about Recom, for future reference, but Mornsun doesn't appear to make any actual regulators. Their DC-DC converters are unregulated, unless I'm missing something.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did you look at their K78XX-500 Series or the K78XX-1000 Series WIDE INPUT NON-ISOLATED & REGULATED?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Aah, got it. Clicked on two or three others, but not that family. As I said, I might have missed something. Thanks.