Author Topic: Decoupling capacitor for ATtiny  (Read 4236 times)

0 Members and 1 Guest are viewing this topic.

Offline Lee697Topic starter

  • Regular Contributor
  • *
  • Posts: 82
  • Country: au
Decoupling capacitor for ATtiny
« on: September 29, 2019, 09:06:26 pm »
I have a small circuit I'm testing - very basic.....
ATtiny85V, powered by a CR2032 (1, or 2 in parallel). It flashes a morse code sequence to a 3mm red LED, that's it.
LED draws approx 2mA when on, ATtiny draws 0.9mA in between.
I've just had it run for 240hr continuously to assess battery life, and it appeared to do well - surprisingly it was still functioning, seemingly normally, at 1.7V, although the LED was getting pretty dim.....

I wasn't using a decoupling cap in this circuit. I did note Vcc swinging about as the LED flashed.
In reading, a decoupling cap should be installed across Vcc/GND, so I'll do this - but what sort of cap, and what value? Battery life is a priority here - should I expect this to degrade battery life? (I'll test it anyway) Cheers!
 

Offline Audioguru again

  • Regular Contributor
  • *
  • Posts: 115
  • Country: ca
Re: Decoupling capacitor for ATtiny
« Reply #1 on: September 29, 2019, 09:48:55 pm »
When the battery becomes weak then its high internal resistance causes the LED to be dim. Try adding a 10uF electrolytic capacitor for it to charge when the LED is off and help power the LED when it should be on to make the LED brighter. Then of course the battery life will be reduced.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Decoupling capacitor for ATtiny
« Reply #2 on: September 29, 2019, 10:08:19 pm »
a 100nf ceramic capacitor across the power pins as close to the IC as practical is always a good idea. The electrolytic mentioned may also be helpful when using small batteries. So long as the capacitor has a low leakage current it should not affect the battery life.
 

Offline Lee697Topic starter

  • Regular Contributor
  • *
  • Posts: 82
  • Country: au
Re: Decoupling capacitor for ATtiny
« Reply #3 on: September 29, 2019, 10:32:18 pm »
To test this.... is it mainly just a case of checking the voltage trace at Vcc with the scope, and trying different cap values to flatten it out?
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Decoupling capacitor for ATtiny
« Reply #4 on: September 29, 2019, 11:36:07 pm »
Yes, in fact that procedure provides more confidence than "whack a 0.1 on it" does. :-+

It is very likely that 0.1 will be an adequate value, and best placed at the point of measurement, though. :)

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: Lee697

Offline Lee697Topic starter

  • Regular Contributor
  • *
  • Posts: 82
  • Country: au
Re: Decoupling capacitor for ATtiny
« Reply #5 on: September 30, 2019, 12:28:57 am »
Some pics.... I tried a bunch, up to a 47uF tantalum - 100-200nF of ceramic seemed as good as anything, 200nF ceramic was the flattest by a smidge, especially the background when the LED wasn't on. You can see the length of the LED pulses in the traces. This was whilst running from a single 2032, I started with my Jaycar lab supply, but the scope showed it up, with some pretty nasty wandering about.....
 

Offline gcewing

  • Regular Contributor
  • *
  • Posts: 203
  • Country: nz
Re: Decoupling capacitor for ATtiny
« Reply #6 on: September 30, 2019, 12:41:44 am »
It won't do much about the voltage sagging when the LED is on, though. A largeish electrolytic might help, but only if the LED duty cycle is fairly low, otherwise the capacitor won't have enough time to recharge between flashes. If you really want to squeeze out maximum battery life, maybe consider some kind of jewel thief like circuit.
 
The following users thanked this post: Lee697

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Decoupling capacitor for ATtiny
« Reply #7 on: September 30, 2019, 01:09:06 am »
The low frequency content isn't what the capacitor will help with -- that's to be expected, from the cell.  As long as it's within the operating range, and doesn't change too quickly (~V/ms??), it's fine.

The capacitor helps with high frequency stuff -- you'll see the difference in the 100ns to 10us/div range. :)

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: Lee697


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf