ATtiny13 doesn't poweroff / uses too much current while sleeping?

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

Hello,

 

I'm learning to work with the ATtiny MCUs and I've made a simple program which should blink a LED on PB4 if and only if an ADC reading of ADC3 goes below a threshold, and to deep-sleep between blinks and measurements. So far, my code looks like this:

 

https://gist.github.com/ivoras/8...

 

Blinking works, ADC reading works, except... the power draw when the LED is off is still about 1 mA, which should be too high if the MCU is actually sleeping.

 

What am I missing?

Last Edited: Fri. Apr 21, 2017 - 11:25 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can't access the link....

 

 

But I think you need to show the schematic too.

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

Post your code here using the "<>" menu above along with your schematic.  Also tell us your toolchain used, i.e. GCC, ICC, CV....

Also tell us how your are measuring the current draw. Details matter when low power is important!

Jim

 

 

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

Well, it turns out the MCU is most likely sleeping fine and it's a red herring. (btw this is Atmel Studio 7 with whatever toolchain it has).

 

It seems like the current is wasted in Zener diodes I've used to limit the voltage in the circuit. The idea is to power this thing from a 5.5V solar cell, which would charge 2 supercapacitors in series, rated at 2.7V each, so I've put a Zener diode to limit the voltage on each capacitor. Since the solar cell is small, I've thought I don't need a resistor to limit the current here (~~150 mA max). I've since measured the current just through diodes such as these and seen they are not really what I need here as their power consumption can be even higher than I've found when in the circuit. So... any good and simple ideas to limit the voltage on the 2.7V capacitors which don't include special ICs and MOSFETs and comparators? :D

 

Schematic

Last Edited: Fri. Apr 21, 2017 - 01:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have used two serial connected super caps in commercial 5v circuits without any other components and they have worked fine, (250k+ units in the field).

In our line powered application, we charged the caps thru a current limiting resistor+diode, but in your solar app, that is not needed as solar panels are current sources, but you will need to enable BOD in your AVR for a circuit like this with slowly rising voltage to ensure proper operation. 

Good luck.

Jim

 

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

So you didn't add anything which would limit the voltage on individual caps? I don't have as much experience with them, I've just found that a lot of people recommend building circuits of various complexity just to keep them from accumulating excess voltage when in series.

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

SuperCaps have enough internal resistance/leakage to self balance, at least that has been my experience, of course YMMV! 

Our application was for a loss of power alarm (555 + buzzer) that needed to last for several hours upon loss of mains power, for an in-home medical appliance. 

 

Jim

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

Well, if it's good enough for a medical appliance, it's good enough for a side-project :) Thanks!

 

While on this topic, which super caps did you use? What do you think about the cheap 100F / 120F ones from AliExpress